diff --git a/Makefile b/Makefile index d3c4c50..419729c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := v1.6.0 +TAG := v1.7.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/README.md b/README.md index 7672426..de9f9e3 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.6.0 +Go wrapper for [TDLib (Telegram Database Library)](https://github.com/tdlib/td) with full support of TDLib v1.7.0 ## TDLib installation diff --git a/client/function.go b/client/function.go index d745901..050253a 100755 --- a/client/function.go +++ b/client/function.go @@ -6,7 +6,7 @@ import ( "errors" ) -// Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state +// Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization func (client *Client) GetAuthorizationState() (AuthorizationState, error) { result, err := client.Send(Request{ meta: meta{ @@ -188,11 +188,11 @@ func (client *Client) CheckAuthenticationCode(req *CheckAuthenticationCodeReques } type RequestQrCodeAuthenticationRequest struct { - // List of user identifiers of other users currently using the client + // List of user identifiers of other users currently using the application OtherUserIds []int32 `json:"other_user_ids"` } -// Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber +// Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword func (client *Client) RequestQrCodeAuthentication(req *RequestQrCodeAuthenticationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -358,7 +358,7 @@ func (client *Client) LogOut() (*Ok, error) { return UnmarshalOk(result.Data) } -// Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent +// Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent. Can be called before initialization func (client *Client) Close() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -377,7 +377,7 @@ func (client *Client) Close() (*Ok, error) { return UnmarshalOk(result.Data) } -// Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed. After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent +// Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed. After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent. Can be called before authorization func (client *Client) Destroy() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -422,7 +422,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. This is an offline method. Can be called before authorization +// 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{ @@ -1005,11 +1005,11 @@ func (client *Client) GetMessageLocally(req *GetMessageLocallyRequest) (*Message type GetRepliedMessageRequest struct { // Identifier of the chat the message belongs to ChatId int64 `json:"chat_id"` - // Identifier of the message reply to which get + // Identifier of the message reply to which to get MessageId int64 `json:"message_id"` } -// Returns information about a message that is replied by given message +// 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 func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1036,7 +1036,7 @@ type GetChatPinnedMessageRequest struct { ChatId int64 `json:"chat_id"` } -// Returns information about a pinned chat message +// Returns information about a newest pinned message in the chat func (client *Client) GetChatPinnedMessage(req *GetChatPinnedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1057,6 +1057,38 @@ func (client *Client) GetChatPinnedMessage(req *GetChatPinnedMessageRequest) (*M return UnmarshalMessage(result.Data) } +type GetCallbackQueryMessageRequest struct { + // Identifier of the chat the message belongs to + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Identifier of the callback query + CallbackQueryId JsonInt64 `json:"callback_query_id"` +} + +// Returns information about a message with the callback button that originated a callback query; for bots only +func (client *Client) GetCallbackQueryMessage(req *GetCallbackQueryMessageRequest) (*Message, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCallbackQueryMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "callback_query_id": req.CallbackQueryId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessage(result.Data) +} + type GetMessagesRequest struct { // Identifier of the chat the messages belong to ChatId int64 `json:"chat_id"` @@ -1086,6 +1118,35 @@ func (client *Client) GetMessages(req *GetMessagesRequest) (*Messages, error) { return UnmarshalMessages(result.Data) } +type GetMessageThreadRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +// Returns information about a message thread. Can be used only if message.can_get_message_thread == true +func (client *Client) GetMessageThread(req *GetMessageThreadRequest) (*MessageThreadInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageThread", + }, + 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 UnmarshalMessageThreadInfo(result.Data) +} + type GetFileRequest struct { // Identifier of the file to get FileId int32 `json:"file_id"` @@ -1119,7 +1180,7 @@ type GetRemoteFileRequest struct { FileType FileType `json:"file_type"` } -// Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client +// Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application func (client *Client) GetRemoteFile(req *GetRemoteFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -1152,7 +1213,7 @@ type GetChatsRequest struct { Limit int32 `json:"limit"` } -// Returns an ordered list of chats in a chat list. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). For optimal performance the number of returned chats is chosen by the library +// Returns an ordered list of chats in a chat list. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). For optimal performance the number of returned chats is chosen by the library func (client *Client) GetChats(req *GetChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1235,7 +1296,7 @@ type SearchChatsRequest struct { Limit int32 `json:"limit"` } -// Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the chat list +// Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list func (client *Client) SearchChats(req *SearchChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1264,7 +1325,7 @@ type SearchChatsOnServerRequest struct { Limit int32 `json:"limit"` } -// Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the chat list +// Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the main chat list func (client *Client) SearchChatsOnServer(req *SearchChatsOnServerRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1540,7 +1601,7 @@ func (client *Client) CheckCreatedPublicChatsLimit(req *CheckCreatedPublicChatsL return UnmarshalOk(result.Data) } -// Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Basic group chats need to be first upgraded to supergroups before they can be set as a discussion group +// Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group. To set a returned supergroup as a discussion group, access to its old messages must be enabled using toggleSupergroupIsAllHistoryAvailable first func (client *Client) GetSuitableDiscussionChats() (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1617,7 +1678,7 @@ type GetChatHistoryRequest struct { FromMessageId int64 `json:"from_message_id"` // Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages Offset int32 `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater or equal to -offset. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached + // 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. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached Limit int32 `json:"limit"` // If true, returns only messages that are available locally without sending network requests OnlyLocal bool `json:"only_local"` @@ -1648,6 +1709,44 @@ func (client *Client) GetChatHistory(req *GetChatHistoryRequest) (*Messages, err return UnmarshalMessages(result.Data) } +type GetMessageThreadHistoryRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier, which thread history needs to be returned + MessageId int64 `json:"message_id"` + // Identifier of the message starting from which history must be fetched; use 0 to get results from the last message + FromMessageId int64 `json:"from_message_id"` + // Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages + Offset int32 `json:"offset"` + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. Fewer messages may be returned than specified by the limit, even if the end of the message thread history has not been reached + Limit int32 `json:"limit"` +} + +// 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. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library +func (client *Client) GetMessageThreadHistory(req *GetMessageThreadHistoryRequest) (*Messages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageThreadHistory", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "from_message_id": req.FromMessageId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessages(result.Data) +} + type DeleteChatHistoryRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -1685,8 +1784,8 @@ type SearchChatMessagesRequest struct { ChatId int64 `json:"chat_id"` // Query to search for Query string `json:"query"` - // If not 0, only messages sent by the specified user will be returned. Not supported in secret chats - SenderUserId int32 `json:"sender_user_id"` + // If not null, only messages sent by the specified sender will be returned. Not supported in secret chats + Sender MessageSender `json:"sender"` // Identifier of the message starting from which history must be fetched; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` // Specify 0 to get results from exactly the from_message_id or a negative offset to get the specified message and some newer messages @@ -1695,6 +1794,8 @@ type SearchChatMessagesRequest struct { Limit int32 `json:"limit"` // Filter for message content in the search results Filter SearchMessagesFilter `json:"filter"` + // If not 0, only messages in the specified thread will be returned; supergroups only + 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 should be used instead), or without an enabled message database. For optimal performance the number of returned messages is chosen by the library @@ -1704,13 +1805,14 @@ func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Messa Type: "searchChatMessages", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "query": req.Query, - "sender_user_id": req.SenderUserId, - "from_message_id": req.FromMessageId, - "offset": req.Offset, - "limit": req.Limit, - "filter": req.Filter, + "chat_id": req.ChatId, + "query": req.Query, + "sender": req.Sender, + "from_message_id": req.FromMessageId, + "offset": req.Offset, + "limit": req.Limit, + "filter": req.Filter, + "message_thread_id": req.MessageThreadId, }, }) if err != nil { @@ -1735,8 +1837,14 @@ type SearchMessagesRequest struct { 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"` - // The maximum number of messages to be returned, up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached + // The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached Limit int32 `json:"limit"` + // Filter for message content in the search results; searchMessagesFilterCall, searchMessagesFilterMissedCall, 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"` + // If not 0, the maximum date of the messages to return + MaxDate int32 `json:"max_date"` } // Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance the number of returned messages is chosen by the library @@ -1752,6 +1860,9 @@ func (client *Client) SearchMessages(req *SearchMessagesRequest) (*Messages, err "offset_chat_id": req.OffsetChatId, "offset_message_id": req.OffsetMessageId, "limit": req.Limit, + "filter": req.Filter, + "min_date": req.MinDate, + "max_date": req.MaxDate, }, }) if err != nil { @@ -1770,11 +1881,11 @@ type SearchSecretMessagesRequest struct { ChatId int64 `json:"chat_id"` // Query to search for. If empty, searchChatMessages should be used instead Query string `json:"query"` - // The identifier from the result of a previous request, use 0 to get results from the last message - FromSearchId JsonInt64 `json:"from_search_id"` + // 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. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached Limit int32 `json:"limit"` - // A filter for the content of messages in the search results + // A filter for message content in the search results Filter SearchMessagesFilter `json:"filter"` } @@ -1785,11 +1896,11 @@ func (client *Client) SearchSecretMessages(req *SearchSecretMessagesRequest) (*F Type: "searchSecretMessages", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "query": req.Query, - "from_search_id": req.FromSearchId, - "limit": req.Limit, - "filter": req.Filter, + "chat_id": req.ChatId, + "query": req.Query, + "offset": req.Offset, + "limit": req.Limit, + "filter": req.Filter, }, }) if err != nil { @@ -1864,7 +1975,7 @@ func (client *Client) SearchChatRecentLocationMessages(req *SearchChatRecentLoca return UnmarshalMessages(result.Data) } -// Returns all active live locations that should be updated by the client. The list is persistent across application restarts only if the message database is used +// Returns all active live locations that should be updated by the application. The list is persistent across application restarts only if the message database is used func (client *Client) GetActiveLiveLocationMessages() (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -1970,6 +2081,41 @@ func (client *Client) GetChatScheduledMessages(req *GetChatScheduledMessagesRequ return UnmarshalMessages(result.Data) } +type GetMessagePublicForwardsRequest struct { + // Chat identifier of the message + 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 string `json:"offset"` + // The maximum number of messages to be returned; must be positive and can't be greater than 100. Fewer messages may be returned than specified by the limit, even if the end of the list has not been reached + Limit int32 `json:"limit"` +} + +// Returns forwarded copies of a channel message to different public channels. For optimal performance the number of returned messages is chosen by the library +func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*FoundMessages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessagePublicForwards", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundMessages(result.Data) +} + type RemoveNotificationRequest struct { // Identifier of notification group to which the notification belongs NotificationGroupId int32 `json:"notification_group_id"` @@ -2028,20 +2174,55 @@ func (client *Client) RemoveNotificationGroup(req *RemoveNotificationGroupReques return UnmarshalOk(result.Data) } -type GetPublicMessageLinkRequest struct { +type GetMessageLinkRequest 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 a link for a whole media album should be returned + // 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"` +} + +// Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. This is an offline request +func (client *Client) GetMessageLink(req *GetMessageLinkRequest) (*MessageLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "for_album": req.ForAlbum, + "for_comment": req.ForComment, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageLink(result.Data) +} + +type GetMessageEmbeddingCodeRequest 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 to return an HTML code for embedding of the whole media album ForAlbum bool `json:"for_album"` } -// Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with a username -func (client *Client) GetPublicMessageLink(req *GetPublicMessageLinkRequest) (*PublicMessageLink, error) { +// Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username +func (client *Client) GetMessageEmbeddingCode(req *GetMessageEmbeddingCodeRequest) (*Text, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getPublicMessageLink", + Type: "getMessageEmbeddingCode", }, Data: map[string]interface{}{ "chat_id": req.ChatId, @@ -2057,36 +2238,7 @@ func (client *Client) GetPublicMessageLink(req *GetPublicMessageLinkRequest) (*P return nil, buildResponseError(result.Data) } - return UnmarshalPublicMessageLink(result.Data) -} - -type GetMessageLinkRequest 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 a private HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. The link will work only for members of the chat -func (client *Client) GetMessageLink(req *GetMessageLinkRequest) (*HttpUrl, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getMessageLink", - }, - 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 UnmarshalHttpUrl(result.Data) + return UnmarshalText(result.Data) } type GetMessageLinkInfoRequest struct { @@ -2118,10 +2270,12 @@ func (client *Client) GetMessageLinkInfo(req *GetMessageLinkInfoRequest) (*Messa type SendMessageRequest struct { // Target chat 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 ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the message - Options *SendMessageOptions `json:"options"` + Options *MessageSendOptions `json:"options"` // Markup for replying to the message; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` // The content of the message to be sent @@ -2136,6 +2290,7 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { }, Data: map[string]interface{}{ "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, "reply_to_message_id": req.ReplyToMessageId, "options": req.Options, "reply_markup": req.ReplyMarkup, @@ -2156,15 +2311,17 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { type SendMessageAlbumRequest struct { // Target chat 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 ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the messages - Options *SendMessageOptions `json:"options"` + Options *MessageSendOptions `json:"options"` // Contents of messages to be sent InputMessageContents []InputMessageContent `json:"input_message_contents"` } -// Sends messages grouped together into an album. Currently only photo and video messages can be grouped into an album. Returns sent messages +// Sends 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{ @@ -2172,6 +2329,7 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, }, Data: map[string]interface{}{ "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, "reply_to_message_id": req.ReplyToMessageId, "options": req.Options, "input_message_contents": req.InputMessageContents, @@ -2223,10 +2381,12 @@ func (client *Client) SendBotStartMessage(req *SendBotStartMessageRequest) (*Mes type SendInlineQueryResultMessageRequest struct { // Target chat 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 ReplyToMessageId int64 `json:"reply_to_message_id"` // Options to be used to send the message - Options *SendMessageOptions `json:"options"` + Options *MessageSendOptions `json:"options"` // Identifier of the inline query QueryId JsonInt64 `json:"query_id"` // Identifier of the inline result @@ -2243,6 +2403,7 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes }, Data: map[string]interface{}{ "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, "reply_to_message_id": req.ReplyToMessageId, "options": req.Options, "query_id": req.QueryId, @@ -2266,15 +2427,13 @@ type ForwardMessagesRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the chat from which to forward messages FromChatId int64 `json:"from_chat_id"` - // Identifiers of the messages to forward + // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order MessageIds []int64 `json:"message_ids"` // Options to be used to send the messages - Options *SendMessageOptions `json:"options"` - // True, if the messages should be grouped into an album after forwarding. For this to work, no more than 10 messages may be forwarded, and all of them must be photo or video messages - AsAlbum bool `json:"as_album"` + Options *MessageSendOptions `json:"options"` // True, if content of the messages needs to be copied without links to the original messages. Always true if the messages are forwarded to a secret chat SendCopy bool `json:"send_copy"` - // True, if media captions of message copies needs to be removed. Ignored if send_copy is false + // True, if media caption of message copies needs to be removed. Ignored if send_copy is false RemoveCaption bool `json:"remove_caption"` } @@ -2289,7 +2448,6 @@ func (client *Client) ForwardMessages(req *ForwardMessagesRequest) (*Messages, e "from_chat_id": req.FromChatId, "message_ids": req.MessageIds, "options": req.Options, - "as_album": req.AsAlbum, "send_copy": req.SendCopy, "remove_caption": req.RemoveCaption, }, @@ -2392,8 +2550,8 @@ func (client *Client) SendChatScreenshotTakenNotification(req *SendChatScreensho type AddLocalMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // Identifier of the user who will be shown as the sender of the message; may be 0 for channel posts - SenderUserId int32 `json:"sender_user_id"` + // The sender sender of the message + Sender MessageSender `json:"sender"` // Identifier of the message to reply to or 0 ReplyToMessageId int64 `json:"reply_to_message_id"` // Pass true to disable notification for the message @@ -2410,7 +2568,7 @@ func (client *Client) AddLocalMessage(req *AddLocalMessageRequest) (*Message, er }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "sender_user_id": req.SenderUserId, + "sender": req.Sender, "reply_to_message_id": req.ReplyToMessageId, "disable_notification": req.DisableNotification, "input_message_content": req.InputMessageContent, @@ -2532,6 +2690,10 @@ type EditMessageLiveLocationRequest struct { ReplyMarkup ReplyMarkup `json:"reply_markup"` // New location content of the message; may be null. Pass null to stop sharing the live location Location *Location `json:"location"` + // The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown + Heading int32 `json:"heading"` + // The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled + ProximityAlertRadius int32 `json:"proximity_alert_radius"` } // Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side @@ -2541,10 +2703,12 @@ func (client *Client) EditMessageLiveLocation(req *EditMessageLiveLocationReques Type: "editMessageLiveLocation", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "reply_markup": req.ReplyMarkup, - "location": req.Location, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reply_markup": req.ReplyMarkup, + "location": req.Location, + "heading": req.Heading, + "proximity_alert_radius": req.ProximityAlertRadius, }, }) if err != nil { @@ -2699,6 +2863,10 @@ type EditInlineMessageLiveLocationRequest struct { ReplyMarkup ReplyMarkup `json:"reply_markup"` // New location content of the message; may be null. Pass null to stop sharing the live location Location *Location `json:"location"` + // The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown + Heading int32 `json:"heading"` + // The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled + ProximityAlertRadius int32 `json:"proximity_alert_radius"` } // Edits the content of a live location in an inline message sent via a bot; for bots only @@ -2708,9 +2876,11 @@ func (client *Client) EditInlineMessageLiveLocation(req *EditInlineMessageLiveLo Type: "editInlineMessageLiveLocation", }, Data: map[string]interface{}{ - "inline_message_id": req.InlineMessageId, - "reply_markup": req.ReplyMarkup, - "location": req.Location, + "inline_message_id": req.InlineMessageId, + "reply_markup": req.ReplyMarkup, + "location": req.Location, + "heading": req.Heading, + "proximity_alert_radius": req.ProximityAlertRadius, }, }) if err != nil { @@ -2854,7 +3024,7 @@ type GetTextEntitiesRequest struct { Text string `json:"text"` } -// Returns all entities (mentions, hashtags, cashtags, bot commands, URLs, and email addresses) contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously +// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously func (client *Client) GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -2876,13 +3046,13 @@ func (client *Client) GetTextEntities(req *GetTextEntitiesRequest) (*TextEntitie } type ParseTextEntitiesRequest struct { - // The text which should be parsed + // The text to parse Text string `json:"text"` // Text parse mode ParseMode TextParseMode `json:"parse_mode"` } -// Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. This is an offline method. Can be called before authorization. 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{ @@ -2904,12 +3074,64 @@ func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*Formatt return UnmarshalFormattedText(result.Data) } +type ParseMarkdownRequest struct { + // The text to parse. For example, "__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" + Text *FormattedText `json:"text"` +} + +// Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously +func (client *Client) ParseMarkdown(req *ParseMarkdownRequest) (*FormattedText, error) { + result, err := client.jsonClient.Execute(Request{ + meta: meta{ + Type: "parseMarkdown", + }, + Data: map[string]interface{}{ + "text": req.Text, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFormattedText(result.Data) +} + +type GetMarkdownTextRequest struct { + // The text + Text *FormattedText `json:"text"` +} + +// 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 +func (client *Client) GetMarkdownText(req *GetMarkdownTextRequest) (*FormattedText, error) { + result, err := client.jsonClient.Execute(Request{ + meta: meta{ + Type: "getMarkdownText", + }, + Data: map[string]interface{}{ + "text": req.Text, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFormattedText(result.Data) +} + type GetFileMimeTypeRequest struct { // The name of the file or path to the file FileName string `json:"file_name"` } -// Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously +// Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously func (client *Client) GetFileMimeType(req *GetFileMimeTypeRequest) (*Text, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -2935,7 +3157,7 @@ type GetFileExtensionRequest struct { MimeType string `json:"mime_type"` } -// Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously +// Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously func (client *Client) GetFileExtension(req *GetFileExtensionRequest) (*Text, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -2961,7 +3183,7 @@ type CleanFileNameRequest struct { FileName string `json:"file_name"` } -// Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously +// Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. Can be called synchronously func (client *Client) CleanFileName(req *CleanFileNameRequest) (*Text, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -2993,7 +3215,7 @@ type GetLanguagePackStringRequest struct { Key string `json:"key"` } -// Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. This is an offline method. Can be called before authorization. Can be called synchronously +// Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. Can be called synchronously func (client *Client) GetLanguagePackString(req *GetLanguagePackStringRequest) (LanguagePackStringValue, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -3034,7 +3256,7 @@ type GetJsonValueRequest struct { Json string `json:"json"` } -// Converts a JSON-serialized string to corresponding JsonValue object. This is an offline method. Can be called before authorization. Can be called synchronously +// Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously func (client *Client) GetJsonValue(req *GetJsonValueRequest) (JsonValue, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -3081,7 +3303,7 @@ type GetJsonStringRequest struct { JsonValue JsonValue `json:"json_value"` } -// Converts a JsonValue object to corresponding JSON-serialized string. This is an offline method. Can be called before authorization. Can be called synchronously +// Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously func (client *Client) GetJsonString(req *GetJsonStringRequest) (*Text, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -3204,6 +3426,32 @@ func (client *Client) StopPoll(req *StopPollRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type HideSuggestedActionRequest struct { + // Suggested action to hide + Action SuggestedAction `json:"action"` +} + +// Hides a suggested action +func (client *Client) HideSuggestedAction(req *HideSuggestedActionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "hideSuggestedAction", + }, + Data: map[string]interface{}{ + "action": req.Action, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetLoginUrlInfoRequest struct { // Chat identifier of the message with the button ChatId int64 `json:"chat_id"` @@ -3665,6 +3913,8 @@ func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) ( type SendChatActionRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` + // If not 0, a message thread identifier in which the action was performed + MessageThreadId int64 `json:"message_thread_id"` // The action description Action ChatAction `json:"action"` } @@ -3676,8 +3926,9 @@ func (client *Client) SendChatAction(req *SendChatActionRequest) (*Ok, error) { Type: "sendChatAction", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "action": req.Action, + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "action": req.Action, }, }) if err != nil { @@ -3746,9 +3997,11 @@ func (client *Client) CloseChat(req *CloseChatRequest) (*Ok, error) { type ViewMessagesRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` + // If not 0, a message thread identifier in which the messages are being viewed + MessageThreadId int64 `json:"message_thread_id"` // The identifiers of the messages being viewed MessageIds []int64 `json:"message_ids"` - // True, if messages in closed chats should be marked as read + // True, if messages in closed chats should be marked as read by the request ForceRead bool `json:"force_read"` } @@ -3759,9 +4012,10 @@ func (client *Client) ViewMessages(req *ViewMessagesRequest) (*Ok, error) { Type: "viewMessages", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_ids": req.MessageIds, - "force_read": req.ForceRead, + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "message_ids": req.MessageIds, + "force_read": req.ForceRead, }, }) if err != nil { @@ -4059,18 +4313,44 @@ func (client *Client) UpgradeBasicGroupChatToSupergroupChat(req *UpgradeBasicGro return UnmarshalChat(result.Data) } -type SetChatChatListRequest struct { +type GetChatListsToAddChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New chat list of the chat +} + +// Returns chat lists to which the chat can be added. This is an offline request +func (client *Client) GetChatListsToAddChat(req *GetChatListsToAddChatRequest) (*ChatLists, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatListsToAddChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatLists(result.Data) +} + +type AddChatToListRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The chat list. Use getChatListsToAddChat to get suitable chat lists ChatList ChatList `json:"chat_list"` } -// Moves a chat to a different chat list. Current chat list of the chat must ne non-null -func (client *Client) SetChatChatList(req *SetChatChatListRequest) (*Ok, error) { +// Adds a chat to a chat list. A chat can't be simultaneously in Main and Archive chat lists, so it is automatically removed from another one if needed +func (client *Client) AddChatToList(req *AddChatToListRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "setChatChatList", + Type: "addChatToList", }, Data: map[string]interface{}{ "chat_id": req.ChatId, @@ -4088,6 +4368,184 @@ func (client *Client) SetChatChatList(req *SetChatChatListRequest) (*Ok, error) return UnmarshalOk(result.Data) } +type GetChatFilterRequest struct { + // Chat filter identifier + ChatFilterId int32 `json:"chat_filter_id"` +} + +// Returns information about a chat filter by its identifier +func (client *Client) GetChatFilter(req *GetChatFilterRequest) (*ChatFilter, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFilter", + }, + Data: map[string]interface{}{ + "chat_filter_id": req.ChatFilterId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFilter(result.Data) +} + +type CreateChatFilterRequest struct { + // Chat filter + Filter *ChatFilter `json:"filter"` +} + +// Creates new chat filter. Returns information about the created chat filter +func (client *Client) CreateChatFilter(req *CreateChatFilterRequest) (*ChatFilterInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createChatFilter", + }, + Data: map[string]interface{}{ + "filter": req.Filter, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFilterInfo(result.Data) +} + +type EditChatFilterRequest struct { + // Chat filter identifier + ChatFilterId int32 `json:"chat_filter_id"` + // The edited chat filter + Filter *ChatFilter `json:"filter"` +} + +// Edits existing chat filter. Returns information about the edited chat filter +func (client *Client) EditChatFilter(req *EditChatFilterRequest) (*ChatFilterInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editChatFilter", + }, + Data: map[string]interface{}{ + "chat_filter_id": req.ChatFilterId, + "filter": req.Filter, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFilterInfo(result.Data) +} + +type DeleteChatFilterRequest struct { + // Chat filter identifier + ChatFilterId int32 `json:"chat_filter_id"` +} + +// Deletes existing chat filter +func (client *Client) DeleteChatFilter(req *DeleteChatFilterRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteChatFilter", + }, + Data: map[string]interface{}{ + "chat_filter_id": req.ChatFilterId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReorderChatFiltersRequest struct { + // Identifiers of chat filters in the new correct order + ChatFilterIds []int32 `json:"chat_filter_ids"` +} + +// Changes the order of chat filters +func (client *Client) ReorderChatFilters(req *ReorderChatFiltersRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderChatFilters", + }, + Data: map[string]interface{}{ + "chat_filter_ids": req.ChatFilterIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns recommended chat filters for the current user +func (client *Client) GetRecommendedChatFilters() (*RecommendedChatFilters, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getRecommendedChatFilters", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRecommendedChatFilters(result.Data) +} + +type GetChatFilterDefaultIconNameRequest struct { + // Chat filter + Filter *ChatFilter `json:"filter"` +} + +// Returns default icon name for a filter. Can be called synchronously +func (client *Client) GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Text, error) { + result, err := client.jsonClient.Execute(Request{ + meta: meta{ + Type: "getChatFilterDefaultIconName", + }, + Data: map[string]interface{}{ + "filter": req.Filter, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type SetChatTitleRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -4095,7 +4553,7 @@ type SetChatTitleRequest struct { Title string `json:"title"` } -// Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The title will not be changed until the request to the server has been completed +// Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights func (client *Client) SetChatTitle(req *SetChatTitleRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4120,11 +4578,11 @@ func (client *Client) SetChatTitle(req *SetChatTitleRequest) (*Ok, error) { type SetChatPhotoRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New chat photo. You can use a zero InputFileId to delete the chat photo. Files that are accessible only by HTTP URL are not acceptable - Photo InputFile `json:"photo"` + // New chat photo. Pass null to delete the chat photo + Photo InputChatPhoto `json:"photo"` } -// Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The photo will not be changed before request to the server has been completed +// Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info rights func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4178,6 +4636,8 @@ func (client *Client) SetChatPermissions(req *SetChatPermissionsRequest) (*Ok, e type SetChatDraftMessageRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` + // If not 0, a message thread identifier in which the draft was changed + MessageThreadId int64 `json:"message_thread_id"` // New draft message; may be null DraftMessage *DraftMessage `json:"draft_message"` } @@ -4189,8 +4649,9 @@ func (client *Client) SetChatDraftMessage(req *SetChatDraftMessageRequest) (*Ok, Type: "setChatDraftMessage", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "draft_message": req.DraftMessage, + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "draft_message": req.DraftMessage, }, }) if err != nil { @@ -4233,35 +4694,6 @@ func (client *Client) SetChatNotificationSettings(req *SetChatNotificationSettin return UnmarshalOk(result.Data) } -type ToggleChatIsPinnedRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of is_pinned - IsPinned bool `json:"is_pinned"` -} - -// Changes the pinned state of a chat. You can pin up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") 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{ - Type: "toggleChatIsPinned", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "is_pinned": req.IsPinned, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type ToggleChatIsMarkedAsUnreadRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -4327,7 +4759,7 @@ type SetChatClientDataRequest struct { ClientData string `json:"client_data"` } -// Changes client data associated with a chat +// Changes application-specific data associated with a chat func (client *Client) SetChatClientData(req *SetChatClientDataRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4381,7 +4813,7 @@ func (client *Client) SetChatDescription(req *SetChatDescriptionRequest) (*Ok, e type SetChatDiscussionGroupRequest struct { // Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup) ChatId int64 `json:"chat_id"` - // Identifier of a new channel's discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats needs to be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable needs to be used first to change that + // Identifier of a new channel's discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats must be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable must be used first to change that DiscussionChatId int64 `json:"discussion_chat_id"` } @@ -4470,11 +4902,13 @@ type PinChatMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the new pinned message MessageId int64 `json:"message_id"` - // True, if there should be no notification about the pinned message + // True, if there should be no 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 + OnlyForSelf bool `json:"only_for_self"` } -// Pins a message in a chat; requires can_pin_messages rights +// Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel func (client *Client) PinChatMessage(req *PinChatMessageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4484,6 +4918,7 @@ func (client *Client) PinChatMessage(req *PinChatMessageRequest) (*Ok, error) { "chat_id": req.ChatId, "message_id": req.MessageId, "disable_notification": req.DisableNotification, + "only_for_self": req.OnlyForSelf, }, }) if err != nil { @@ -4500,14 +4935,43 @@ func (client *Client) PinChatMessage(req *PinChatMessageRequest) (*Ok, error) { type UnpinChatMessageRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` + // Identifier of the removed pinned message + MessageId int64 `json:"message_id"` } -// Removes the pinned message from a chat; requires can_pin_messages rights in the group or channel +// Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel func (client *Client) UnpinChatMessage(req *UnpinChatMessageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "unpinChatMessage", }, + 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 UnpinAllChatMessagesRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` +} + +// Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel +func (client *Client) UnpinAllChatMessages(req *UnpinAllChatMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "unpinAllChatMessages", + }, Data: map[string]interface{}{ "chat_id": req.ChatId, }, @@ -4953,6 +5417,38 @@ func (client *Client) ResetAllNotificationSettings() (*Ok, error) { return UnmarshalOk(result.Data) } +type ToggleChatIsPinnedRequest struct { + // Chat list in which to change the pinned state of the chat + ChatList ChatList `json:"chat_list"` + // Chat identifier + ChatId int64 `json:"chat_id"` + // 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/arhive chat list +func (client *Client) ToggleChatIsPinned(req *ToggleChatIsPinnedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleChatIsPinned", + }, + Data: map[string]interface{}{ + "chat_list": req.ChatList, + "chat_id": req.ChatId, + "is_pinned": req.IsPinned, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetPinnedChatsRequest struct { // Chat list in which to change the order of pinned chats ChatList ChatList `json:"chat_list"` @@ -5145,7 +5641,7 @@ type WriteGeneratedFilePartRequest struct { Data []byte `json:"data"` } -// Writes a part of a generated file. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file +// Writes a part of a generated file. 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 write to the destination file func (client *Client) WriteGeneratedFilePart(req *WriteGeneratedFilePartRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5238,7 +5734,7 @@ type ReadFilePartRequest struct { Count int32 `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 client has no direct access to TDLib's file system, because it is usually slower than a direct read from the file +// 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 func (client *Client) ReadFilePart(req *ReadFilePartRequest) (*FilePart, error) { result, err := client.Send(Request{ meta: meta{ @@ -5368,8 +5864,10 @@ func (client *Client) JoinChatByInviteLink(req *JoinChatByInviteLinkRequest) (*C type CreateCallRequest struct { // Identifier of the user to be called UserId int32 `json:"user_id"` - // Description of the call protocols supported by the client + // Description of the call protocols supported by the application Protocol *CallProtocol `json:"protocol"` + // True, if a video call needs to be created + IsVideo bool `json:"is_video"` } // Creates a new call @@ -5381,6 +5879,7 @@ func (client *Client) CreateCall(req *CreateCallRequest) (*CallId, error) { Data: map[string]interface{}{ "user_id": req.UserId, "protocol": req.Protocol, + "is_video": req.IsVideo, }, }) if err != nil { @@ -5397,7 +5896,7 @@ func (client *Client) CreateCall(req *CreateCallRequest) (*CallId, error) { type AcceptCallRequest struct { // Call identifier CallId int32 `json:"call_id"` - // Description of the call protocols supported by the client + // Description of the call protocols supported by the application Protocol *CallProtocol `json:"protocol"` } @@ -5423,6 +5922,35 @@ func (client *Client) AcceptCall(req *AcceptCallRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SendCallSignalingDataRequest struct { + // Call identifier + CallId int32 `json:"call_id"` + // The data + Data []byte `json:"data"` +} + +// Sends call signaling data +func (client *Client) SendCallSignalingData(req *SendCallSignalingDataRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendCallSignalingData", + }, + Data: map[string]interface{}{ + "call_id": req.CallId, + "data": req.Data, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type DiscardCallRequest struct { // Call identifier CallId int32 `json:"call_id"` @@ -5430,6 +5958,8 @@ type DiscardCallRequest struct { IsDisconnected bool `json:"is_disconnected"` // The call duration, in seconds Duration int32 `json:"duration"` + // 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"` } @@ -5444,6 +5974,7 @@ func (client *Client) DiscardCall(req *DiscardCallRequest) (*Ok, error) { "call_id": req.CallId, "is_disconnected": req.IsDisconnected, "duration": req.Duration, + "is_video": req.IsVideo, "connection_id": req.ConnectionId, }, }) @@ -5522,19 +6053,22 @@ func (client *Client) SendCallDebugInformation(req *SendCallDebugInformationRequ return UnmarshalOk(result.Data) } -type BlockUserRequest struct { - // User identifier - UserId int32 `json:"user_id"` +type ToggleMessageSenderIsBlockedRequest struct { + // Message Sender + Sender MessageSender `json:"sender"` + // New value of is_blocked + IsBlocked bool `json:"is_blocked"` } -// Adds a user to the blacklist -func (client *Client) BlockUser(req *BlockUserRequest) (*Ok, error) { +// Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked +func (client *Client) ToggleMessageSenderIsBlocked(req *ToggleMessageSenderIsBlockedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "blockUser", + Type: "toggleMessageSenderIsBlocked", }, Data: map[string]interface{}{ - "user_id": req.UserId, + "sender": req.Sender, + "is_blocked": req.IsBlocked, }, }) if err != nil { @@ -5548,19 +6082,28 @@ func (client *Client) BlockUser(req *BlockUserRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type UnblockUserRequest struct { - // User identifier - UserId int32 `json:"user_id"` +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 + DeleteMessage bool `json:"delete_message"` + // Pass true if all messages from the same sender must be deleted + DeleteAllMessages bool `json:"delete_all_messages"` + // Pass true if the sender must be reported to the Telegram moderators + ReportSpam bool `json:"report_spam"` } -// Removes a user from the blacklist -func (client *Client) UnblockUser(req *UnblockUserRequest) (*Ok, error) { +// Blocks an original sender of a message in the Replies chat +func (client *Client) BlockMessageSenderFromReplies(req *BlockMessageSenderFromRepliesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "unblockUser", + Type: "blockMessageSenderFromReplies", }, Data: map[string]interface{}{ - "user_id": req.UserId, + "message_id": req.MessageId, + "delete_message": req.DeleteMessage, + "delete_all_messages": req.DeleteAllMessages, + "report_spam": req.ReportSpam, }, }) if err != nil { @@ -5574,18 +6117,18 @@ func (client *Client) UnblockUser(req *UnblockUserRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GetBlockedUsersRequest struct { - // Number of users to skip in the result; must be non-negative +type GetBlockedMessageSendersRequest struct { + // Number of users and chats to skip in the result; must be non-negative Offset int32 `json:"offset"` - // The maximum number of users to return; up to 100 + // The maximum number of users and chats to return; up to 100 Limit int32 `json:"limit"` } -// Returns users that were blocked by the current user -func (client *Client) GetBlockedUsers(req *GetBlockedUsersRequest) (*Users, error) { +// Returns users and chats that were blocked by the current user +func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequest) (*MessageSenders, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getBlockedUsers", + Type: "getBlockedMessageSenders", }, Data: map[string]interface{}{ "offset": req.Offset, @@ -5600,7 +6143,7 @@ func (client *Client) GetBlockedUsers(req *GetBlockedUsersRequest) (*Users, erro return nil, buildResponseError(result.Data) } - return UnmarshalUsers(result.Data) + return UnmarshalMessageSenders(result.Data) } type AddContactRequest struct { @@ -5832,7 +6375,7 @@ type GetUserProfilePhotosRequest struct { } // Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already -func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*UserProfilePhotos, error) { +func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*ChatPhotos, error) { result, err := client.Send(Request{ meta: meta{ Type: "getUserProfilePhotos", @@ -5851,7 +6394,7 @@ func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*U return nil, buildResponseError(result.Data) } - return UnmarshalUserProfilePhotos(result.Data) + return UnmarshalChatPhotos(result.Data) } type GetStickersRequest struct { @@ -5970,13 +6513,23 @@ func (client *Client) GetArchivedStickerSets(req *GetArchivedStickerSetsRequest) return UnmarshalStickerSets(result.Data) } -// Returns a list of trending sticker sets -func (client *Client) GetTrendingStickerSets() (*StickerSets, error) { +type GetTrendingStickerSetsRequest struct { + // 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; must be non-negative. Fewer sticker sets may be returned than specified by the limit, even if the end of the list has not been reached + Limit int32 `json:"limit"` +} + +// Returns a list of trending sticker sets. For the optimal performance the number of returned sticker sets is chosen by the library +func (client *Client) GetTrendingStickerSets(req *GetTrendingStickerSetsRequest) (*StickerSets, error) { result, err := client.Send(Request{ meta: meta{ Type: "getTrendingStickerSets", }, - Data: map[string]interface{}{}, + Data: map[string]interface{}{ + "offset": req.Offset, + "limit": req.Limit, + }, }) if err != nil { return nil, err @@ -6424,8 +6977,8 @@ type SearchEmojisRequest struct { Text string `json:"text"` // True, if only emojis, which exactly match text needs to be returned ExactMatch bool `json:"exact_match"` - // IETF language tag of the user's input language; may be empty if unknown - InputLanguageCode string `json:"input_language_code"` + // List of possible IETF language tags of the user's input language; may be empty if unknown + InputLanguageCodes []string `json:"input_language_codes"` } // Searches for emojis by keywords. Supported only if the file database is enabled @@ -6435,9 +6988,9 @@ func (client *Client) SearchEmojis(req *SearchEmojisRequest) (*Emojis, error) { Type: "searchEmojis", }, Data: map[string]interface{}{ - "text": req.Text, - "exact_match": req.ExactMatch, - "input_language_code": req.InputLanguageCode, + "text": req.Text, + "exact_match": req.ExactMatch, + "input_language_codes": req.InputLanguageCodes, }, }) if err != nil { @@ -6678,11 +7231,11 @@ func (client *Client) GetWebPageInstantView(req *GetWebPageInstantViewRequest) ( } type SetProfilePhotoRequest struct { - // Profile photo to set. inputFileId and inputFileRemote may still be unsupported - Photo InputFile `json:"photo"` + // Profile photo to set + Photo InputChatPhoto `json:"photo"` } -// Uploads a new profile photo for the current user. If something changes, updateUser will be sent +// Changes a profile photo for the current user func (client *Client) SetProfilePhoto(req *SetProfilePhotoRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6708,7 +7261,7 @@ type DeleteProfilePhotoRequest struct { ProfilePhotoId JsonInt64 `json:"profile_photo_id"` } -// Deletes a profile photo. If something changes, updateUser will be sent +// Deletes a profile photo func (client *Client) DeleteProfilePhoto(req *DeleteProfilePhotoRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6736,7 +7289,7 @@ type SetNameRequest struct { LastName string `json:"last_name"` } -// Changes the first and last name of the current user. If something changes, updateUser will be sent +// Changes the first and last name of the current user func (client *Client) SetName(req *SetNameRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6789,7 +7342,7 @@ type SetUsernameRequest struct { Username string `json:"username"` } -// Changes the username of the current user. If something changes, updateUser will be sent +// Changes the username of the current user func (client *Client) SetUsername(req *SetUsernameRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6810,6 +7363,32 @@ func (client *Client) SetUsername(req *SetUsernameRequest) (*Ok, error) { 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 +func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setLocation", + }, + Data: map[string]interface{}{ + "location": req.Location, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ChangePhoneNumberRequest struct { // The new phone number of the user in international format PhoneNumber string `json:"phone_number"` @@ -6884,6 +7463,32 @@ func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCode return UnmarshalOk(result.Data) } +type SetCommandsRequest struct { + // List of the bot's commands + Commands []*BotCommand `json:"commands"` +} + +// Sets the list of commands supported by the bot; for bots only +func (client *Client) SetCommands(req *SetCommandsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setCommands", + }, + Data: map[string]interface{}{ + "commands": req.Commands, + }, + }) + 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{ @@ -7163,7 +7768,7 @@ func (client *Client) ReportSupergroupSpam(req *ReportSupergroupSpamRequest) (*O type GetSupergroupMembersRequest struct { // Identifier of the supergroup or channel SupergroupId int32 `json:"supergroup_id"` - // The type of users to return. By default, supergroupMembersRecent + // The type of users to return. By default, supergroupMembersFilterRecent Filter SupergroupMembersFilter `json:"filter"` // Number of users to skip Offset int32 `json:"offset"` @@ -7496,7 +8101,7 @@ func (client *Client) GetSupportUser() (*User, error) { } type GetBackgroundsRequest struct { - // True, if the backgrounds needs to be ordered for dark theme + // True, if the backgrounds must be ordered for dark theme ForDarkTheme bool `json:"for_dark_theme"` } @@ -7739,7 +8344,7 @@ type SynchronizeLanguagePackRequest struct { LanguagePackId string `json:"language_pack_id"` } -// Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization +// Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method shouldn't be called explicitly for the current used/base language packs. Can be called before authorization func (client *Client) SynchronizeLanguagePack(req *SynchronizeLanguagePackRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7899,7 +8504,7 @@ func (client *Client) DeleteLanguagePack(req *DeleteLanguagePackRequest) (*Ok, e type RegisterDeviceRequest struct { // Device token DeviceToken DeviceToken `json:"device_token"` - // List of user identifiers of other users currently using the client + // List of user identifiers of other users currently using the application OtherUserIds []int32 `json:"other_user_ids"` } @@ -7956,7 +8561,7 @@ type GetPushReceiverIdRequest struct { Payload string `json:"payload"` } -// Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. This is an offline method. Can be called before authorization. Can be called synchronously +// Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. Can be called synchronously func (client *Client) GetPushReceiverId(req *GetPushReceiverIdRequest) (*PushReceiverId, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -8234,7 +8839,7 @@ type ReportChatRequest struct { MessageIds []int64 `json:"message_ids"` } -// Reports a chat to the Telegram moderators. Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by moderators, or when the report is done from the chat action bar +// Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if this is a private chats 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 func (client *Client) ReportChat(req *ReportChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -8266,7 +8871,7 @@ type GetChatStatisticsUrlRequest struct { IsDark bool `json:"is_dark"` } -// Returns an HTTP URL with the chat statistics. Currently this method can be used only for channels. Can be used only if SupergroupFullInfo.can_view_statistics == true +// Returns an HTTP URL with the chat statistics. Currently this method of getting the statistics are disabled and can be deleted in the future func (client *Client) GetChatStatisticsUrl(req *GetChatStatisticsUrlRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -8289,6 +8894,120 @@ func (client *Client) GetChatStatisticsUrl(req *GetChatStatisticsUrlRequest) (*H return UnmarshalHttpUrl(result.Data) } +type GetChatStatisticsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Pass true if a dark theme is used by the application + 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 +func (client *Client) GetChatStatistics(req *GetChatStatisticsRequest) (ChatStatistics, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatStatistics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "is_dark": req.IsDark, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeChatStatisticsSupergroup: + return UnmarshalChatStatisticsSupergroup(result.Data) + + case TypeChatStatisticsChannel: + return UnmarshalChatStatisticsChannel(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +type GetMessageStatisticsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Pass true if a dark theme is used by the application + IsDark bool `json:"is_dark"` +} + +// Returns detailed statistics about a message. Can be used only if Message.can_get_statistics == true +func (client *Client) GetMessageStatistics(req *GetMessageStatisticsRequest) (*MessageStatistics, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageStatistics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "is_dark": req.IsDark, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageStatistics(result.Data) +} + +type GetStatisticalGraphRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The token for graph loading + Token string `json:"token"` + // X-value for zoomed in graph or 0 otherwise + X int64 `json:"x"` +} + +// Loads an asynchronous or a zoomed in statistical graph +func (client *Client) GetStatisticalGraph(req *GetStatisticalGraphRequest) (StatisticalGraph, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStatisticalGraph", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "token": req.Token, + "x": req.X, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeStatisticalGraphData: + return UnmarshalStatisticalGraphData(result.Data) + + case TypeStatisticalGraphAsync: + return UnmarshalStatisticalGraphAsync(result.Data) + + case TypeStatisticalGraphError: + return UnmarshalStatisticalGraphError(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type GetStorageStatisticsRequest struct { // The maximum number of chats with the largest storage usage for which separate statistics should be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0 ChatLimit int32 `json:"chat_limit"` @@ -8368,6 +9087,8 @@ type OptimizeStorageRequest struct { ChatIds []int64 `json:"chat_ids"` // If not empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos) ExcludeChatIds []int64 `json:"exclude_chat_ids"` + // Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics + ReturnDeletedFileStatistics bool `json:"return_deleted_file_statistics"` // Same as in getStorageStatistics. Affects only returned statistics ChatLimit int32 `json:"chat_limit"` } @@ -8379,14 +9100,15 @@ func (client *Client) OptimizeStorage(req *OptimizeStorageRequest) (*StorageStat Type: "optimizeStorage", }, Data: map[string]interface{}{ - "size": req.Size, - "ttl": req.Ttl, - "count": req.Count, - "immunity_delay": req.ImmunityDelay, - "file_types": req.FileTypes, - "chat_ids": req.ChatIds, - "exclude_chat_ids": req.ExcludeChatIds, - "chat_limit": req.ChatLimit, + "size": req.Size, + "ttl": req.Ttl, + "count": req.Count, + "immunity_delay": req.ImmunityDelay, + "file_types": req.FileTypes, + "chat_ids": req.ChatIds, + "exclude_chat_ids": req.ExcludeChatIds, + "return_deleted_file_statistics": req.ReturnDeletedFileStatistics, + "chat_limit": req.ChatLimit, }, }) if err != nil { @@ -8497,7 +9219,7 @@ func (client *Client) ResetNetworkStatistics() (*Ok, error) { return UnmarshalOk(result.Data) } -// Returns auto-download settings presets for the currently logged in user +// Returns auto-download settings presets for the current user func (client *Client) GetAutoDownloadSettingsPresets() (*AutoDownloadSettingsPresets, error) { result, err := client.Send(Request{ meta: meta{ @@ -8545,6 +9267,32 @@ func (client *Client) SetAutoDownloadSettings(req *SetAutoDownloadSettingsReques return UnmarshalOk(result.Data) } +type GetBankCardInfoRequest struct { + // The bank card number + BankCardNumber string `json:"bank_card_number"` +} + +// Returns information about a bank card +func (client *Client) GetBankCardInfo(req *GetBankCardInfoRequest) (*BankCardInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBankCardInfo", + }, + Data: map[string]interface{}{ + "bank_card_number": req.BankCardNumber, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBankCardInfo(result.Data) +} + type GetPassportElementRequest struct { // Telegram Passport element type Type PassportElementType `json:"type"` @@ -9010,7 +9758,7 @@ type SendPassportAuthorizationFormRequest struct { Types []PassportElementType `json:"types"` } -// Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements need to be used +// Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements are going to be reused func (client *Client) SendPassportAuthorizationForm(req *SendPassportAuthorizationFormRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9141,7 +9889,7 @@ func (client *Client) SetBotUpdatesStatus(req *SetBotUpdatesStatusRequest) (*Ok, type UploadStickerFileRequest struct { // Sticker file owner UserId int32 `json:"user_id"` - // PNG image with the sticker; must be up to 512 kB in size and fit in 512x512 square + // PNG image with the sticker; must be up to 512 KB in size and fit in 512x512 square PngSticker InputFile `json:"png_sticker"` } @@ -9174,10 +9922,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); 1-64 characters Name string `json:"name"` - // True, if stickers are masks + // 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 - Stickers []*InputSticker `json:"stickers"` + // List of stickers to be added to the set; must be non-empty. All stickers must be of the same type + Stickers []InputSticker `json:"stickers"` } // Creates a new sticker set; for bots only. Returns the newly created sticker set @@ -9211,7 +9959,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 @@ -9237,6 +9985,38 @@ func (client *Client) AddStickerToSet(req *AddStickerToSetRequest) (*StickerSet, return UnmarshalStickerSet(result.Data) } +type SetStickerSetThumbnailRequest struct { + // Sticker set owner + UserId int32 `json:"user_id"` + // Sticker set name + Name string `json:"name"` + // Thumbnail to set in PNG or TGS format. Animated thumbnail must be set for animated sticker sets and only for them. Pass a zero InputFileId to delete the thumbnail + Thumbnail InputFile `json:"thumbnail"` +} + +// Sets a sticker set thumbnail; for bots only. Returns the sticker set +func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) (*StickerSet, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStickerSetThumbnail", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "name": req.Name, + "thumbnail": req.Thumbnail, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickerSet(result.Data) +} + type SetStickerPositionInSetRequest struct { // Sticker Sticker InputFile `json:"sticker"` @@ -9422,7 +10202,7 @@ type SetAlarmRequest struct { Seconds float64 `json:"seconds"` } -// Succeeds after a specified amount of time has passed. Can be called before authorization. Can be called before initialization +// Succeeds after a specified amount of time has passed. Can be called before initialization func (client *Client) SetAlarm(req *SetAlarmRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9443,7 +10223,26 @@ func (client *Client) SetAlarm(req *SetAlarmRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -// Uses current user IP to found their country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization +// Returns information about existing countries. Can be called before authorization +func (client *Client) GetCountries() (*Countries, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCountries", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCountries(result.Data) +} + +// Uses current user IP address to find their country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization func (client *Client) GetCountryCode() (*Text, error) { result, err := client.Send(Request{ meta: meta{ @@ -9462,6 +10261,32 @@ func (client *Client) GetCountryCode() (*Text, error) { return UnmarshalText(result.Data) } +type GetPhoneNumberInfoRequest struct { + // The phone number prefix + PhoneNumberPrefix string `json:"phone_number_prefix"` +} + +// Returns information about a phone number by its prefix. Can be called before authorization +func (client *Client) GetPhoneNumberInfo(req *GetPhoneNumberInfoRequest) (*PhoneNumberInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPhoneNumberInfo", + }, + Data: map[string]interface{}{ + "phone_number_prefix": req.PhoneNumberPrefix, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPhoneNumberInfo(result.Data) +} + // Returns the default text for invitation messages to be used as a placeholder when the current user invites friends to Telegram func (client *Client) GetInviteText() (*Text, error) { result, err := client.Send(Request{ @@ -9799,7 +10624,7 @@ type SetLogStreamRequest struct { LogStream LogStream `json:"log_stream"` } -// Sets new log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously +// Sets new log stream for internal logging of TDLib. Can be called synchronously func (client *Client) SetLogStream(req *SetLogStreamRequest) (*Ok, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -9820,7 +10645,7 @@ func (client *Client) SetLogStream(req *SetLogStreamRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -// Returns information about currently used log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously +// Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously func (client *Client) GetLogStream() (LogStream, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -9856,7 +10681,7 @@ type SetLogVerbosityLevelRequest struct { NewVerbosityLevel int32 `json:"new_verbosity_level"` } -// Sets the verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously +// Sets the verbosity level of the internal logging of TDLib. Can be called synchronously func (client *Client) SetLogVerbosityLevel(req *SetLogVerbosityLevelRequest) (*Ok, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -9877,7 +10702,7 @@ func (client *Client) SetLogVerbosityLevel(req *SetLogVerbosityLevelRequest) (*O return UnmarshalOk(result.Data) } -// Returns current verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously +// Returns current verbosity level of the internal logging of TDLib. Can be called synchronously func (client *Client) GetLogVerbosityLevel() (*LogVerbosityLevel, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -9896,7 +10721,7 @@ func (client *Client) GetLogVerbosityLevel() (*LogVerbosityLevel, error) { return UnmarshalLogVerbosityLevel(result.Data) } -// Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. This is an offline method. Can be called before authorization. Can be called synchronously +// Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously func (client *Client) GetLogTags() (*LogTags, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -9922,7 +10747,7 @@ type SetLogTagVerbosityLevelRequest struct { NewVerbosityLevel int32 `json:"new_verbosity_level"` } -// Sets the verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously +// Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously func (client *Client) SetLogTagVerbosityLevel(req *SetLogTagVerbosityLevelRequest) (*Ok, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -9949,7 +10774,7 @@ type GetLogTagVerbosityLevelRequest struct { Tag string `json:"tag"` } -// Returns current verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously +// Returns current verbosity level for a specified TDLib internal log tag. Can be called synchronously func (client *Client) GetLogTagVerbosityLevel(req *GetLogTagVerbosityLevelRequest) (*LogVerbosityLevel, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -9977,7 +10802,7 @@ type AddLogMessageRequest struct { Text string `json:"text"` } -// Adds a message to TDLib internal log. This is an offline method. Can be called before authorization. Can be called synchronously +// Adds a message to TDLib internal log. Can be called synchronously func (client *Client) AddLogMessage(req *AddLogMessageRequest) (*Ok, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -10314,8 +11139,11 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateMessageEdited: return UnmarshalUpdateMessageEdited(result.Data) - case TypeUpdateMessageViews: - return UnmarshalUpdateMessageViews(result.Data) + case TypeUpdateMessageIsPinned: + return UnmarshalUpdateMessageIsPinned(result.Data) + + case TypeUpdateMessageInteractionInfo: + return UnmarshalUpdateMessageInteractionInfo(result.Data) case TypeUpdateMessageContentOpened: return UnmarshalUpdateMessageContentOpened(result.Data) @@ -10329,9 +11157,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateNewChat: return UnmarshalUpdateNewChat(result.Data) - case TypeUpdateChatChatList: - return UnmarshalUpdateChatChatList(result.Data) - case TypeUpdateChatTitle: return UnmarshalUpdateChatTitle(result.Data) @@ -10344,17 +11169,14 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatLastMessage: return UnmarshalUpdateChatLastMessage(result.Data) - case TypeUpdateChatOrder: - return UnmarshalUpdateChatOrder(result.Data) - - case TypeUpdateChatIsPinned: - return UnmarshalUpdateChatIsPinned(result.Data) + case TypeUpdateChatPosition: + return UnmarshalUpdateChatPosition(result.Data) case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(result.Data) - case TypeUpdateChatIsSponsored: - return UnmarshalUpdateChatIsSponsored(result.Data) + case TypeUpdateChatIsBlocked: + return UnmarshalUpdateChatIsBlocked(result.Data) case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(result.Data) @@ -10380,15 +11202,15 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(result.Data) - case TypeUpdateChatPinnedMessage: - return UnmarshalUpdateChatPinnedMessage(result.Data) - case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(result.Data) case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(result.Data) + case TypeUpdateChatFilters: + return UnmarshalUpdateChatFilters(result.Data) + case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(result.Data) @@ -10449,6 +11271,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateCall: return UnmarshalUpdateCall(result.Data) + case TypeUpdateNewCallSignalingData: + return UnmarshalUpdateNewCallSignalingData(result.Data) + case TypeUpdateUserPrivacySettingRules: return UnmarshalUpdateUserPrivacySettingRules(result.Data) @@ -10461,6 +11286,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateOption: return UnmarshalUpdateOption(result.Data) + case TypeUpdateStickerSet: + return UnmarshalUpdateStickerSet(result.Data) + case TypeUpdateInstalledStickerSets: return UnmarshalUpdateInstalledStickerSets(result.Data) @@ -10491,6 +11319,15 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(result.Data) + case TypeUpdateDiceEmojis: + return UnmarshalUpdateDiceEmojis(result.Data) + + case TypeUpdateAnimationSearchParameters: + return UnmarshalUpdateAnimationSearchParameters(result.Data) + + case TypeUpdateSuggestedActions: + return UnmarshalUpdateSuggestedActions(result.Data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(result.Data) @@ -10531,7 +11368,7 @@ type TestReturnErrorRequest struct { Error *Error `json:"error"` } -// Returns the specified error and ensures that the Error object is used; for testing only. This is an offline method. Can be called before authorization. Can be called synchronously +// Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously func (client *Client) TestReturnError(req *TestReturnErrorRequest) (*Error, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ diff --git a/client/tdjson_static.go b/client/tdjson_static.go index f512da8..46b7c41 100644 --- a/client/tdjson_static.go +++ b/client/tdjson_static.go @@ -5,6 +5,6 @@ package client /* #cgo linux CFLAGS: -I/usr/local/include -#cgo linux LDFLAGS: -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm +#cgo linux LDFLAGS: -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltdapi -ltddb -ltdsqlite -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm */ import "C" diff --git a/client/tdlib.go b/client/tdlib.go index 1241151..9edce04 100644 --- a/client/tdlib.go +++ b/client/tdlib.go @@ -144,7 +144,11 @@ func (jsonInt64 JsonInt64) MarshalJSON() ([]byte, error) { // UnmarshalJSON unmarshals from json func (jsonInt64 *JsonInt64) UnmarshalJSON(data []byte) error { - jsonBigInt, err := strconv.ParseInt(string(data[1:len(data)-1]), 10, 64) + if len(data) > 2 && data[0] == '"' && data[len(data)-1] == '"' { + data = data[1 : len(data)-1] + } + + jsonBigInt, err := strconv.ParseInt(string(data), 10, 64) if err != nil { return err } diff --git a/client/type.go b/client/type.go index 60e4a0d..243cae4 100755 --- a/client/type.go +++ b/client/type.go @@ -7,246 +7,280 @@ import ( ) const ( - ClassAuthenticationCodeType = "AuthenticationCodeType" - ClassAuthorizationState = "AuthorizationState" - ClassInputFile = "InputFile" - ClassMaskPoint = "MaskPoint" - ClassPollType = "PollType" - ClassUserType = "UserType" - ClassChatMemberStatus = "ChatMemberStatus" - ClassChatMembersFilter = "ChatMembersFilter" - ClassSupergroupMembersFilter = "SupergroupMembersFilter" - ClassSecretChatState = "SecretChatState" - ClassMessageForwardOrigin = "MessageForwardOrigin" - ClassMessageSendingState = "MessageSendingState" - ClassNotificationSettingsScope = "NotificationSettingsScope" - ClassChatType = "ChatType" - ClassChatList = "ChatList" - ClassPublicChatType = "PublicChatType" - ClassChatActionBar = "ChatActionBar" - ClassKeyboardButtonType = "KeyboardButtonType" - ClassInlineKeyboardButtonType = "InlineKeyboardButtonType" - ClassReplyMarkup = "ReplyMarkup" - ClassLoginUrlInfo = "LoginUrlInfo" - ClassRichText = "RichText" - ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment" - ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" - ClassPageBlock = "PageBlock" - ClassInputCredentials = "InputCredentials" - ClassPassportElementType = "PassportElementType" - ClassPassportElement = "PassportElement" - ClassInputPassportElement = "InputPassportElement" - ClassPassportElementErrorSource = "PassportElementErrorSource" - ClassInputPassportElementErrorSource = "InputPassportElementErrorSource" - ClassMessageContent = "MessageContent" - ClassTextEntityType = "TextEntityType" - ClassMessageSchedulingState = "MessageSchedulingState" - ClassInputMessageContent = "InputMessageContent" - ClassSearchMessagesFilter = "SearchMessagesFilter" - ClassChatAction = "ChatAction" - ClassUserStatus = "UserStatus" - ClassCallDiscardReason = "CallDiscardReason" - ClassCallState = "CallState" - ClassCallProblem = "CallProblem" - ClassInputInlineQueryResult = "InputInlineQueryResult" - ClassInlineQueryResult = "InlineQueryResult" - ClassCallbackQueryPayload = "CallbackQueryPayload" - ClassChatEventAction = "ChatEventAction" - ClassLanguagePackStringValue = "LanguagePackStringValue" - ClassDeviceToken = "DeviceToken" - ClassBackgroundFill = "BackgroundFill" - ClassBackgroundType = "BackgroundType" - ClassInputBackground = "InputBackground" - ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" - ClassCheckChatUsernameResult = "CheckChatUsernameResult" - ClassPushMessageContent = "PushMessageContent" - ClassNotificationType = "NotificationType" - ClassNotificationGroupType = "NotificationGroupType" - ClassOptionValue = "OptionValue" - ClassJsonValue = "JsonValue" - ClassUserPrivacySettingRule = "UserPrivacySettingRule" - ClassUserPrivacySetting = "UserPrivacySetting" - ClassChatReportReason = "ChatReportReason" - ClassFileType = "FileType" - ClassNetworkType = "NetworkType" - ClassNetworkStatisticsEntry = "NetworkStatisticsEntry" - ClassConnectionState = "ConnectionState" - ClassTopChatCategory = "TopChatCategory" - ClassTMeUrlType = "TMeUrlType" - ClassTextParseMode = "TextParseMode" - ClassProxyType = "ProxyType" - ClassUpdate = "Update" - ClassLogStream = "LogStream" - ClassError = "Error" - ClassOk = "Ok" - ClassTdlibParameters = "TdlibParameters" - ClassAuthenticationCodeInfo = "AuthenticationCodeInfo" - ClassEmailAddressAuthenticationCodeInfo = "EmailAddressAuthenticationCodeInfo" - ClassTextEntity = "TextEntity" - ClassTextEntities = "TextEntities" - ClassFormattedText = "FormattedText" - ClassTermsOfService = "TermsOfService" - ClassPasswordState = "PasswordState" - ClassRecoveryEmailAddress = "RecoveryEmailAddress" - ClassTemporaryPasswordState = "TemporaryPasswordState" - ClassLocalFile = "LocalFile" - ClassRemoteFile = "RemoteFile" - ClassFile = "File" - ClassPhotoSize = "PhotoSize" - ClassMinithumbnail = "Minithumbnail" - ClassMaskPosition = "MaskPosition" - ClassPollOption = "PollOption" - ClassAnimation = "Animation" - ClassAudio = "Audio" - ClassDocument = "Document" - ClassPhoto = "Photo" - ClassSticker = "Sticker" - ClassVideo = "Video" - ClassVideoNote = "VideoNote" - ClassVoiceNote = "VoiceNote" - ClassContact = "Contact" - ClassLocation = "Location" - ClassVenue = "Venue" - ClassGame = "Game" - ClassPoll = "Poll" - ClassProfilePhoto = "ProfilePhoto" - ClassChatPhoto = "ChatPhoto" - ClassBotCommand = "BotCommand" - ClassBotInfo = "BotInfo" - ClassChatLocation = "ChatLocation" - ClassUser = "User" - ClassUserFullInfo = "UserFullInfo" - ClassUserProfilePhoto = "UserProfilePhoto" - ClassUserProfilePhotos = "UserProfilePhotos" - ClassUsers = "Users" - ClassChatAdministrator = "ChatAdministrator" - ClassChatAdministrators = "ChatAdministrators" - ClassChatPermissions = "ChatPermissions" - ClassChatMember = "ChatMember" - ClassChatMembers = "ChatMembers" - ClassBasicGroup = "BasicGroup" - ClassBasicGroupFullInfo = "BasicGroupFullInfo" - ClassSupergroup = "Supergroup" - ClassSupergroupFullInfo = "SupergroupFullInfo" - ClassSecretChat = "SecretChat" - ClassMessageForwardInfo = "MessageForwardInfo" - ClassMessage = "Message" - ClassMessages = "Messages" - ClassFoundMessages = "FoundMessages" - ClassChatNotificationSettings = "ChatNotificationSettings" - ClassScopeNotificationSettings = "ScopeNotificationSettings" - ClassDraftMessage = "DraftMessage" - ClassChat = "Chat" - ClassChats = "Chats" - ClassChatNearby = "ChatNearby" - ClassChatsNearby = "ChatsNearby" - ClassChatInviteLink = "ChatInviteLink" - ClassChatInviteLinkInfo = "ChatInviteLinkInfo" - ClassKeyboardButton = "KeyboardButton" - ClassInlineKeyboardButton = "InlineKeyboardButton" - ClassPageBlockCaption = "PageBlockCaption" - ClassPageBlockListItem = "PageBlockListItem" - ClassPageBlockTableCell = "PageBlockTableCell" - ClassPageBlockRelatedArticle = "PageBlockRelatedArticle" - ClassWebPageInstantView = "WebPageInstantView" - ClassWebPage = "WebPage" - ClassAddress = "Address" - ClassLabeledPricePart = "LabeledPricePart" - ClassInvoice = "Invoice" - ClassOrderInfo = "OrderInfo" - ClassShippingOption = "ShippingOption" - ClassSavedCredentials = "SavedCredentials" - ClassPaymentsProviderStripe = "PaymentsProviderStripe" - ClassPaymentForm = "PaymentForm" - ClassValidatedOrderInfo = "ValidatedOrderInfo" - ClassPaymentResult = "PaymentResult" - ClassPaymentReceipt = "PaymentReceipt" - ClassDatedFile = "DatedFile" - ClassDate = "Date" - ClassPersonalDetails = "PersonalDetails" - ClassIdentityDocument = "IdentityDocument" - ClassInputIdentityDocument = "InputIdentityDocument" - ClassPersonalDocument = "PersonalDocument" - ClassInputPersonalDocument = "InputPersonalDocument" - ClassPassportElements = "PassportElements" - ClassPassportElementError = "PassportElementError" - ClassPassportSuitableElement = "PassportSuitableElement" - ClassPassportRequiredElement = "PassportRequiredElement" - ClassPassportAuthorizationForm = "PassportAuthorizationForm" - ClassPassportElementsWithErrors = "PassportElementsWithErrors" - ClassEncryptedCredentials = "EncryptedCredentials" - ClassEncryptedPassportElement = "EncryptedPassportElement" - ClassInputPassportElementError = "InputPassportElementError" - ClassInputThumbnail = "InputThumbnail" - ClassSendMessageOptions = "SendMessageOptions" - ClassStickers = "Stickers" - ClassEmojis = "Emojis" - ClassStickerSet = "StickerSet" - ClassStickerSetInfo = "StickerSetInfo" - ClassStickerSets = "StickerSets" - ClassCallProtocol = "CallProtocol" - ClassCallConnection = "CallConnection" - ClassCallId = "CallId" - ClassCall = "Call" - ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" - ClassAnimations = "Animations" - ClassImportedContacts = "ImportedContacts" - ClassHttpUrl = "HttpUrl" - ClassInlineQueryResults = "InlineQueryResults" - ClassCallbackQueryAnswer = "CallbackQueryAnswer" - ClassCustomRequestResult = "CustomRequestResult" - ClassGameHighScore = "GameHighScore" - ClassGameHighScores = "GameHighScores" - ClassChatEvent = "ChatEvent" - ClassChatEvents = "ChatEvents" - ClassChatEventLogFilters = "ChatEventLogFilters" - ClassLanguagePackString = "LanguagePackString" - ClassLanguagePackStrings = "LanguagePackStrings" - ClassLanguagePackInfo = "LanguagePackInfo" - ClassLocalizationTargetInfo = "LocalizationTargetInfo" - ClassPushReceiverId = "PushReceiverId" - ClassBackground = "Background" - ClassBackgrounds = "Backgrounds" - ClassHashtags = "Hashtags" - ClassNotification = "Notification" - ClassNotificationGroup = "NotificationGroup" - ClassJsonObjectMember = "JsonObjectMember" - ClassUserPrivacySettingRules = "UserPrivacySettingRules" - ClassAccountTtl = "AccountTtl" - ClassSession = "Session" - ClassSessions = "Sessions" - ClassConnectedWebsite = "ConnectedWebsite" - ClassConnectedWebsites = "ConnectedWebsites" - ClassPublicMessageLink = "PublicMessageLink" - ClassMessageLinkInfo = "MessageLinkInfo" - ClassFilePart = "FilePart" - ClassStorageStatisticsByFileType = "StorageStatisticsByFileType" - ClassStorageStatisticsByChat = "StorageStatisticsByChat" - ClassStorageStatistics = "StorageStatistics" - ClassStorageStatisticsFast = "StorageStatisticsFast" - ClassDatabaseStatistics = "DatabaseStatistics" - ClassNetworkStatistics = "NetworkStatistics" - ClassAutoDownloadSettings = "AutoDownloadSettings" - ClassAutoDownloadSettingsPresets = "AutoDownloadSettingsPresets" - ClassTMeUrl = "TMeUrl" - ClassTMeUrls = "TMeUrls" - ClassCount = "Count" - ClassText = "Text" - ClassSeconds = "Seconds" - ClassDeepLinkInfo = "DeepLinkInfo" - ClassProxy = "Proxy" - ClassProxies = "Proxies" - ClassInputSticker = "InputSticker" - ClassUpdates = "Updates" - ClassLogVerbosityLevel = "LogVerbosityLevel" - ClassLogTags = "LogTags" - ClassTestInt = "TestInt" - ClassTestString = "TestString" - ClassTestBytes = "TestBytes" - ClassTestVectorInt = "TestVectorInt" - ClassTestVectorIntObject = "TestVectorIntObject" - ClassTestVectorString = "TestVectorString" - ClassTestVectorStringObject = "TestVectorStringObject" + ClassAuthenticationCodeType = "AuthenticationCodeType" + ClassAuthorizationState = "AuthorizationState" + ClassInputFile = "InputFile" + ClassThumbnailFormat = "ThumbnailFormat" + ClassMaskPoint = "MaskPoint" + ClassPollType = "PollType" + ClassUserType = "UserType" + ClassInputChatPhoto = "InputChatPhoto" + ClassChatMemberStatus = "ChatMemberStatus" + ClassChatMembersFilter = "ChatMembersFilter" + ClassSupergroupMembersFilter = "SupergroupMembersFilter" + ClassSecretChatState = "SecretChatState" + ClassMessageSender = "MessageSender" + ClassMessageForwardOrigin = "MessageForwardOrigin" + ClassMessageSendingState = "MessageSendingState" + ClassNotificationSettingsScope = "NotificationSettingsScope" + ClassChatType = "ChatType" + ClassChatList = "ChatList" + ClassChatSource = "ChatSource" + ClassPublicChatType = "PublicChatType" + ClassChatActionBar = "ChatActionBar" + ClassKeyboardButtonType = "KeyboardButtonType" + ClassInlineKeyboardButtonType = "InlineKeyboardButtonType" + ClassReplyMarkup = "ReplyMarkup" + ClassLoginUrlInfo = "LoginUrlInfo" + ClassRichText = "RichText" + ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment" + ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" + ClassPageBlock = "PageBlock" + ClassInputCredentials = "InputCredentials" + ClassPassportElementType = "PassportElementType" + ClassPassportElement = "PassportElement" + ClassInputPassportElement = "InputPassportElement" + ClassPassportElementErrorSource = "PassportElementErrorSource" + ClassInputPassportElementErrorSource = "InputPassportElementErrorSource" + ClassMessageContent = "MessageContent" + ClassTextEntityType = "TextEntityType" + ClassMessageSchedulingState = "MessageSchedulingState" + ClassInputMessageContent = "InputMessageContent" + ClassSearchMessagesFilter = "SearchMessagesFilter" + ClassChatAction = "ChatAction" + ClassUserStatus = "UserStatus" + ClassCallDiscardReason = "CallDiscardReason" + ClassCallServerType = "CallServerType" + ClassCallState = "CallState" + ClassCallProblem = "CallProblem" + ClassDiceStickers = "DiceStickers" + ClassInputInlineQueryResult = "InputInlineQueryResult" + ClassInlineQueryResult = "InlineQueryResult" + ClassCallbackQueryPayload = "CallbackQueryPayload" + ClassChatEventAction = "ChatEventAction" + ClassLanguagePackStringValue = "LanguagePackStringValue" + ClassDeviceToken = "DeviceToken" + ClassBackgroundFill = "BackgroundFill" + ClassBackgroundType = "BackgroundType" + ClassInputBackground = "InputBackground" + ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" + ClassCheckChatUsernameResult = "CheckChatUsernameResult" + ClassPushMessageContent = "PushMessageContent" + ClassNotificationType = "NotificationType" + ClassNotificationGroupType = "NotificationGroupType" + ClassOptionValue = "OptionValue" + ClassJsonValue = "JsonValue" + ClassUserPrivacySettingRule = "UserPrivacySettingRule" + ClassUserPrivacySetting = "UserPrivacySetting" + ClassChatReportReason = "ChatReportReason" + ClassFileType = "FileType" + ClassNetworkType = "NetworkType" + ClassNetworkStatisticsEntry = "NetworkStatisticsEntry" + ClassConnectionState = "ConnectionState" + ClassTopChatCategory = "TopChatCategory" + ClassTMeUrlType = "TMeUrlType" + ClassSuggestedAction = "SuggestedAction" + ClassTextParseMode = "TextParseMode" + ClassProxyType = "ProxyType" + ClassInputSticker = "InputSticker" + ClassStatisticalGraph = "StatisticalGraph" + ClassChatStatistics = "ChatStatistics" + ClassUpdate = "Update" + ClassLogStream = "LogStream" + ClassError = "Error" + ClassOk = "Ok" + ClassTdlibParameters = "TdlibParameters" + ClassAuthenticationCodeInfo = "AuthenticationCodeInfo" + ClassEmailAddressAuthenticationCodeInfo = "EmailAddressAuthenticationCodeInfo" + ClassTextEntity = "TextEntity" + ClassTextEntities = "TextEntities" + ClassFormattedText = "FormattedText" + ClassTermsOfService = "TermsOfService" + ClassPasswordState = "PasswordState" + ClassRecoveryEmailAddress = "RecoveryEmailAddress" + ClassTemporaryPasswordState = "TemporaryPasswordState" + ClassLocalFile = "LocalFile" + ClassRemoteFile = "RemoteFile" + ClassFile = "File" + ClassPhotoSize = "PhotoSize" + ClassMinithumbnail = "Minithumbnail" + ClassThumbnail = "Thumbnail" + ClassMaskPosition = "MaskPosition" + ClassPollOption = "PollOption" + ClassAnimation = "Animation" + ClassAudio = "Audio" + ClassDocument = "Document" + ClassPhoto = "Photo" + ClassSticker = "Sticker" + ClassVideo = "Video" + ClassVideoNote = "VideoNote" + ClassVoiceNote = "VoiceNote" + ClassContact = "Contact" + ClassLocation = "Location" + ClassVenue = "Venue" + ClassGame = "Game" + ClassPoll = "Poll" + ClassProfilePhoto = "ProfilePhoto" + ClassChatPhotoInfo = "ChatPhotoInfo" + ClassBotCommand = "BotCommand" + ClassBotInfo = "BotInfo" + ClassChatLocation = "ChatLocation" + ClassAnimatedChatPhoto = "AnimatedChatPhoto" + ClassChatPhoto = "ChatPhoto" + ClassChatPhotos = "ChatPhotos" + ClassUser = "User" + ClassUserFullInfo = "UserFullInfo" + ClassUsers = "Users" + ClassChatAdministrator = "ChatAdministrator" + ClassChatAdministrators = "ChatAdministrators" + ClassChatPermissions = "ChatPermissions" + ClassChatMember = "ChatMember" + ClassChatMembers = "ChatMembers" + ClassBasicGroup = "BasicGroup" + ClassBasicGroupFullInfo = "BasicGroupFullInfo" + ClassSupergroup = "Supergroup" + ClassSupergroupFullInfo = "SupergroupFullInfo" + ClassSecretChat = "SecretChat" + ClassMessageSenders = "MessageSenders" + ClassMessageForwardInfo = "MessageForwardInfo" + ClassMessageReplyInfo = "MessageReplyInfo" + ClassMessageInteractionInfo = "MessageInteractionInfo" + ClassMessage = "Message" + ClassMessages = "Messages" + ClassFoundMessages = "FoundMessages" + ClassChatNotificationSettings = "ChatNotificationSettings" + ClassScopeNotificationSettings = "ScopeNotificationSettings" + ClassDraftMessage = "DraftMessage" + ClassChatFilter = "ChatFilter" + ClassChatFilterInfo = "ChatFilterInfo" + ClassRecommendedChatFilter = "RecommendedChatFilter" + ClassRecommendedChatFilters = "RecommendedChatFilters" + ClassChatLists = "ChatLists" + ClassChatPosition = "ChatPosition" + ClassChat = "Chat" + ClassChats = "Chats" + ClassChatNearby = "ChatNearby" + ClassChatsNearby = "ChatsNearby" + ClassChatInviteLink = "ChatInviteLink" + ClassChatInviteLinkInfo = "ChatInviteLinkInfo" + ClassKeyboardButton = "KeyboardButton" + ClassInlineKeyboardButton = "InlineKeyboardButton" + ClassMessageThreadInfo = "MessageThreadInfo" + ClassPageBlockCaption = "PageBlockCaption" + ClassPageBlockListItem = "PageBlockListItem" + ClassPageBlockTableCell = "PageBlockTableCell" + ClassPageBlockRelatedArticle = "PageBlockRelatedArticle" + ClassWebPageInstantView = "WebPageInstantView" + ClassWebPage = "WebPage" + ClassCountryInfo = "CountryInfo" + ClassCountries = "Countries" + ClassPhoneNumberInfo = "PhoneNumberInfo" + ClassBankCardActionOpenUrl = "BankCardActionOpenUrl" + ClassBankCardInfo = "BankCardInfo" + ClassAddress = "Address" + ClassLabeledPricePart = "LabeledPricePart" + ClassInvoice = "Invoice" + ClassOrderInfo = "OrderInfo" + ClassShippingOption = "ShippingOption" + ClassSavedCredentials = "SavedCredentials" + ClassPaymentsProviderStripe = "PaymentsProviderStripe" + ClassPaymentForm = "PaymentForm" + ClassValidatedOrderInfo = "ValidatedOrderInfo" + ClassPaymentResult = "PaymentResult" + ClassPaymentReceipt = "PaymentReceipt" + ClassDatedFile = "DatedFile" + ClassDate = "Date" + ClassPersonalDetails = "PersonalDetails" + ClassIdentityDocument = "IdentityDocument" + ClassInputIdentityDocument = "InputIdentityDocument" + ClassPersonalDocument = "PersonalDocument" + ClassInputPersonalDocument = "InputPersonalDocument" + ClassPassportElements = "PassportElements" + ClassPassportElementError = "PassportElementError" + ClassPassportSuitableElement = "PassportSuitableElement" + ClassPassportRequiredElement = "PassportRequiredElement" + ClassPassportAuthorizationForm = "PassportAuthorizationForm" + ClassPassportElementsWithErrors = "PassportElementsWithErrors" + ClassEncryptedCredentials = "EncryptedCredentials" + ClassEncryptedPassportElement = "EncryptedPassportElement" + ClassInputPassportElementError = "InputPassportElementError" + ClassInputThumbnail = "InputThumbnail" + ClassMessageSendOptions = "MessageSendOptions" + ClassMessageCopyOptions = "MessageCopyOptions" + ClassStickers = "Stickers" + ClassEmojis = "Emojis" + ClassStickerSet = "StickerSet" + ClassStickerSetInfo = "StickerSetInfo" + ClassStickerSets = "StickerSets" + ClassCallProtocol = "CallProtocol" + ClassCallServer = "CallServer" + ClassCallId = "CallId" + ClassCall = "Call" + ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" + ClassAnimations = "Animations" + ClassImportedContacts = "ImportedContacts" + ClassHttpUrl = "HttpUrl" + ClassInlineQueryResults = "InlineQueryResults" + ClassCallbackQueryAnswer = "CallbackQueryAnswer" + ClassCustomRequestResult = "CustomRequestResult" + ClassGameHighScore = "GameHighScore" + ClassGameHighScores = "GameHighScores" + ClassChatEvent = "ChatEvent" + ClassChatEvents = "ChatEvents" + ClassChatEventLogFilters = "ChatEventLogFilters" + ClassLanguagePackString = "LanguagePackString" + ClassLanguagePackStrings = "LanguagePackStrings" + ClassLanguagePackInfo = "LanguagePackInfo" + ClassLocalizationTargetInfo = "LocalizationTargetInfo" + ClassPushReceiverId = "PushReceiverId" + ClassBackground = "Background" + ClassBackgrounds = "Backgrounds" + ClassHashtags = "Hashtags" + ClassNotification = "Notification" + ClassNotificationGroup = "NotificationGroup" + ClassJsonObjectMember = "JsonObjectMember" + ClassUserPrivacySettingRules = "UserPrivacySettingRules" + ClassAccountTtl = "AccountTtl" + ClassSession = "Session" + ClassSessions = "Sessions" + ClassConnectedWebsite = "ConnectedWebsite" + ClassConnectedWebsites = "ConnectedWebsites" + ClassMessageLink = "MessageLink" + ClassMessageLinkInfo = "MessageLinkInfo" + ClassFilePart = "FilePart" + ClassStorageStatisticsByFileType = "StorageStatisticsByFileType" + ClassStorageStatisticsByChat = "StorageStatisticsByChat" + ClassStorageStatistics = "StorageStatistics" + ClassStorageStatisticsFast = "StorageStatisticsFast" + ClassDatabaseStatistics = "DatabaseStatistics" + ClassNetworkStatistics = "NetworkStatistics" + ClassAutoDownloadSettings = "AutoDownloadSettings" + ClassAutoDownloadSettingsPresets = "AutoDownloadSettingsPresets" + ClassTMeUrl = "TMeUrl" + ClassTMeUrls = "TMeUrls" + ClassCount = "Count" + ClassText = "Text" + ClassSeconds = "Seconds" + ClassDeepLinkInfo = "DeepLinkInfo" + ClassProxy = "Proxy" + ClassProxies = "Proxies" + ClassDateRange = "DateRange" + ClassStatisticalValue = "StatisticalValue" + ClassChatStatisticsMessageInteractionInfo = "ChatStatisticsMessageInteractionInfo" + ClassChatStatisticsMessageSenderInfo = "ChatStatisticsMessageSenderInfo" + ClassChatStatisticsAdministratorActionsInfo = "ChatStatisticsAdministratorActionsInfo" + ClassChatStatisticsInviterInfo = "ChatStatisticsInviterInfo" + ClassMessageStatistics = "MessageStatistics" + ClassUpdates = "Updates" + ClassLogVerbosityLevel = "LogVerbosityLevel" + ClassLogTags = "LogTags" + ClassTestInt = "TestInt" + ClassTestString = "TestString" + ClassTestBytes = "TestBytes" + ClassTestVectorInt = "TestVectorInt" + ClassTestVectorIntObject = "TestVectorIntObject" + ClassTestVectorString = "TestVectorString" + ClassTestVectorStringObject = "TestVectorStringObject" ) const ( @@ -286,6 +320,13 @@ const ( 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" @@ -308,7 +349,7 @@ const ( TypeGame = "game" TypePoll = "poll" TypeProfilePhoto = "profilePhoto" - TypeChatPhoto = "chatPhoto" + TypeChatPhotoInfo = "chatPhotoInfo" TypeUserTypeRegular = "userTypeRegular" TypeUserTypeDeleted = "userTypeDeleted" TypeUserTypeBot = "userTypeBot" @@ -316,10 +357,14 @@ const ( TypeBotCommand = "botCommand" TypeBotInfo = "botInfo" TypeChatLocation = "chatLocation" + TypeAnimatedChatPhoto = "animatedChatPhoto" + TypeChatPhoto = "chatPhoto" + TypeChatPhotos = "chatPhotos" + TypeInputChatPhotoPrevious = "inputChatPhotoPrevious" + TypeInputChatPhotoStatic = "inputChatPhotoStatic" + TypeInputChatPhotoAnimation = "inputChatPhotoAnimation" TypeUser = "user" TypeUserFullInfo = "userFullInfo" - TypeUserProfilePhoto = "userProfilePhoto" - TypeUserProfilePhotos = "userProfilePhotos" TypeUsers = "users" TypeChatAdministrator = "chatAdministrator" TypeChatAdministrators = "chatAdministrators" @@ -335,6 +380,7 @@ const ( TypeChatMembersFilterContacts = "chatMembersFilterContacts" TypeChatMembersFilterAdministrators = "chatMembersFilterAdministrators" TypeChatMembersFilterMembers = "chatMembersFilterMembers" + TypeChatMembersFilterMention = "chatMembersFilterMention" TypeChatMembersFilterRestricted = "chatMembersFilterRestricted" TypeChatMembersFilterBanned = "chatMembersFilterBanned" TypeChatMembersFilterBots = "chatMembersFilterBots" @@ -344,6 +390,7 @@ const ( TypeSupergroupMembersFilterSearch = "supergroupMembersFilterSearch" TypeSupergroupMembersFilterRestricted = "supergroupMembersFilterRestricted" TypeSupergroupMembersFilterBanned = "supergroupMembersFilterBanned" + TypeSupergroupMembersFilterMention = "supergroupMembersFilterMention" TypeSupergroupMembersFilterBots = "supergroupMembersFilterBots" TypeBasicGroup = "basicGroup" TypeBasicGroupFullInfo = "basicGroupFullInfo" @@ -353,10 +400,16 @@ const ( TypeSecretChatStateReady = "secretChatStateReady" TypeSecretChatStateClosed = "secretChatStateClosed" TypeSecretChat = "secretChat" + TypeMessageSenderUser = "messageSenderUser" + TypeMessageSenderChat = "messageSenderChat" + TypeMessageSenders = "messageSenders" TypeMessageForwardOriginUser = "messageForwardOriginUser" + TypeMessageForwardOriginChat = "messageForwardOriginChat" TypeMessageForwardOriginHiddenUser = "messageForwardOriginHiddenUser" TypeMessageForwardOriginChannel = "messageForwardOriginChannel" TypeMessageForwardInfo = "messageForwardInfo" + TypeMessageReplyInfo = "messageReplyInfo" + TypeMessageInteractionInfo = "messageInteractionInfo" TypeMessageSendingStatePending = "messageSendingStatePending" TypeMessageSendingStateFailed = "messageSendingStateFailed" TypeMessage = "message" @@ -372,8 +425,17 @@ const ( 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" TypeChat = "chat" TypeChats = "chats" TypeChatNearby = "chatNearby" @@ -395,6 +457,7 @@ const ( TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl" TypeInlineKeyboardButtonTypeCallback = "inlineKeyboardButtonTypeCallback" + TypeInlineKeyboardButtonTypeCallbackWithPassword = "inlineKeyboardButtonTypeCallbackWithPassword" TypeInlineKeyboardButtonTypeCallbackGame = "inlineKeyboardButtonTypeCallbackGame" TypeInlineKeyboardButtonTypeSwitchInline = "inlineKeyboardButtonTypeSwitchInline" TypeInlineKeyboardButtonTypeBuy = "inlineKeyboardButtonTypeBuy" @@ -405,6 +468,7 @@ const ( TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard" TypeLoginUrlInfoOpen = "loginUrlInfoOpen" TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation" + TypeMessageThreadInfo = "messageThreadInfo" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" TypeRichTextItalic = "richTextItalic" @@ -418,7 +482,9 @@ const ( TypeRichTextMarked = "richTextMarked" TypeRichTextPhoneNumber = "richTextPhoneNumber" TypeRichTextIcon = "richTextIcon" + TypeRichTextReference = "richTextReference" TypeRichTextAnchor = "richTextAnchor" + TypeRichTextAnchorLink = "richTextAnchorLink" TypeRichTexts = "richTexts" TypePageBlockCaption = "pageBlockCaption" TypePageBlockListItem = "pageBlockListItem" @@ -461,6 +527,11 @@ const ( TypePageBlockMap = "pageBlockMap" TypeWebPageInstantView = "webPageInstantView" TypeWebPage = "webPage" + TypeCountryInfo = "countryInfo" + TypeCountries = "countries" + TypePhoneNumberInfo = "phoneNumberInfo" + TypeBankCardActionOpenUrl = "bankCardActionOpenUrl" + TypeBankCardInfo = "bankCardInfo" TypeAddress = "address" TypeLabeledPricePart = "labeledPricePart" TypeInvoice = "invoice" @@ -563,6 +634,7 @@ const ( TypeMessageLocation = "messageLocation" TypeMessageVenue = "messageVenue" TypeMessageContact = "messageContact" + TypeMessageDice = "messageDice" TypeMessageGame = "messageGame" TypeMessagePoll = "messagePoll" TypeMessageInvoice = "messageInvoice" @@ -588,6 +660,7 @@ const ( TypeMessageWebsiteConnected = "messageWebsiteConnected" TypeMessagePassportDataSent = "messagePassportDataSent" TypeMessagePassportDataReceived = "messagePassportDataReceived" + TypeMessageProximityAlertTriggered = "messageProximityAlertTriggered" TypeMessageUnsupported = "messageUnsupported" TypeTextEntityTypeMention = "textEntityTypeMention" TypeTextEntityTypeHashtag = "textEntityTypeHashtag" @@ -596,6 +669,7 @@ const ( TypeTextEntityTypeUrl = "textEntityTypeUrl" TypeTextEntityTypeEmailAddress = "textEntityTypeEmailAddress" TypeTextEntityTypePhoneNumber = "textEntityTypePhoneNumber" + TypeTextEntityTypeBankCardNumber = "textEntityTypeBankCardNumber" TypeTextEntityTypeBold = "textEntityTypeBold" TypeTextEntityTypeItalic = "textEntityTypeItalic" TypeTextEntityTypeUnderline = "textEntityTypeUnderline" @@ -608,7 +682,8 @@ const ( TypeInputThumbnail = "inputThumbnail" TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate" TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline" - TypeSendMessageOptions = "sendMessageOptions" + TypeMessageSendOptions = "messageSendOptions" + TypeMessageCopyOptions = "messageCopyOptions" TypeInputMessageText = "inputMessageText" TypeInputMessageAnimation = "inputMessageAnimation" TypeInputMessageAudio = "inputMessageAudio" @@ -621,6 +696,7 @@ const ( TypeInputMessageLocation = "inputMessageLocation" TypeInputMessageVenue = "inputMessageVenue" TypeInputMessageContact = "inputMessageContact" + TypeInputMessageDice = "inputMessageDice" TypeInputMessageGame = "inputMessageGame" TypeInputMessageInvoice = "inputMessageInvoice" TypeInputMessagePoll = "inputMessagePoll" @@ -641,6 +717,8 @@ const ( TypeSearchMessagesFilterVoiceAndVideoNote = "searchMessagesFilterVoiceAndVideoNote" TypeSearchMessagesFilterMention = "searchMessagesFilterMention" TypeSearchMessagesFilterUnreadMention = "searchMessagesFilterUnreadMention" + TypeSearchMessagesFilterFailedToSend = "searchMessagesFilterFailedToSend" + TypeSearchMessagesFilterPinned = "searchMessagesFilterPinned" TypeChatActionTyping = "chatActionTyping" TypeChatActionRecordingVideo = "chatActionRecordingVideo" TypeChatActionUploadingVideo = "chatActionUploadingVideo" @@ -671,7 +749,9 @@ const ( TypeCallDiscardReasonDisconnected = "callDiscardReasonDisconnected" TypeCallDiscardReasonHungUp = "callDiscardReasonHungUp" TypeCallProtocol = "callProtocol" - TypeCallConnection = "callConnection" + TypeCallServerTypeTelegramReflector = "callServerTypeTelegramReflector" + TypeCallServerTypeWebrtc = "callServerTypeWebrtc" + TypeCallServer = "callServer" TypeCallId = "callId" TypeCallStatePending = "callStatePending" TypeCallStateExchangingKeys = "callStateExchangingKeys" @@ -686,13 +766,16 @@ const ( TypeCallProblemSilentLocal = "callProblemSilentLocal" TypeCallProblemSilentRemote = "callProblemSilentRemote" TypeCallProblemDropped = "callProblemDropped" + TypeCallProblemDistortedVideo = "callProblemDistortedVideo" + TypeCallProblemPixelatedVideo = "callProblemPixelatedVideo" TypeCall = "call" TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings" TypeAnimations = "animations" + TypeDiceStickersRegular = "diceStickersRegular" + TypeDiceStickersSlotMachine = "diceStickersSlotMachine" TypeImportedContacts = "importedContacts" TypeHttpUrl = "httpUrl" - TypeInputInlineQueryResultAnimatedGif = "inputInlineQueryResultAnimatedGif" - TypeInputInlineQueryResultAnimatedMpeg4 = "inputInlineQueryResultAnimatedMpeg4" + TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation" TypeInputInlineQueryResultArticle = "inputInlineQueryResultArticle" TypeInputInlineQueryResultAudio = "inputInlineQueryResultAudio" TypeInputInlineQueryResultContact = "inputInlineQueryResultContact" @@ -718,6 +801,7 @@ const ( TypeInlineQueryResultVoiceNote = "inlineQueryResultVoiceNote" TypeInlineQueryResults = "inlineQueryResults" TypeCallbackQueryPayloadData = "callbackQueryPayloadData" + TypeCallbackQueryPayloadDataWithPassword = "callbackQueryPayloadDataWithPassword" TypeCallbackQueryPayloadGame = "callbackQueryPayloadGame" TypeCallbackQueryAnswer = "callbackQueryAnswer" TypeCustomRequestResult = "customRequestResult" @@ -862,7 +946,7 @@ const ( TypeChatReportReasonCopyright = "chatReportReasonCopyright" TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation" TypeChatReportReasonCustom = "chatReportReasonCustom" - TypePublicMessageLink = "publicMessageLink" + TypeMessageLink = "messageLink" TypeMessageLinkInfo = "messageLinkInfo" TypeFilePart = "filePart" TypeFileTypeNone = "fileTypeNone" @@ -914,6 +998,8 @@ const ( TypeTMeUrlTypeStickerSet = "tMeUrlTypeStickerSet" TypeTMeUrl = "tMeUrl" TypeTMeUrls = "tMeUrls" + TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats" + TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber" TypeCount = "count" TypeText = "text" TypeSeconds = "seconds" @@ -925,7 +1011,20 @@ const ( TypeProxyTypeMtproto = "proxyTypeMtproto" TypeProxy = "proxy" TypeProxies = "proxies" - TypeInputSticker = "inputSticker" + 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" TypeUpdateAuthorizationState = "updateAuthorizationState" TypeUpdateNewMessage = "updateNewMessage" TypeUpdateMessageSendAcknowledged = "updateMessageSendAcknowledged" @@ -933,20 +1032,19 @@ const ( TypeUpdateMessageSendFailed = "updateMessageSendFailed" TypeUpdateMessageContent = "updateMessageContent" TypeUpdateMessageEdited = "updateMessageEdited" - TypeUpdateMessageViews = "updateMessageViews" + TypeUpdateMessageIsPinned = "updateMessageIsPinned" + TypeUpdateMessageInteractionInfo = "updateMessageInteractionInfo" TypeUpdateMessageContentOpened = "updateMessageContentOpened" TypeUpdateMessageMentionRead = "updateMessageMentionRead" TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed" TypeUpdateNewChat = "updateNewChat" - TypeUpdateChatChatList = "updateChatChatList" TypeUpdateChatTitle = "updateChatTitle" TypeUpdateChatPhoto = "updateChatPhoto" TypeUpdateChatPermissions = "updateChatPermissions" TypeUpdateChatLastMessage = "updateChatLastMessage" - TypeUpdateChatOrder = "updateChatOrder" - TypeUpdateChatIsPinned = "updateChatIsPinned" + TypeUpdateChatPosition = "updateChatPosition" TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" - TypeUpdateChatIsSponsored = "updateChatIsSponsored" + TypeUpdateChatIsBlocked = "updateChatIsBlocked" TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" TypeUpdateChatReadInbox = "updateChatReadInbox" @@ -955,9 +1053,9 @@ const ( TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" TypeUpdateChatActionBar = "updateChatActionBar" - TypeUpdateChatPinnedMessage = "updateChatPinnedMessage" TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" TypeUpdateChatDraftMessage = "updateChatDraftMessage" + TypeUpdateChatFilters = "updateChatFilters" TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" TypeUpdateNotification = "updateNotification" TypeUpdateNotificationGroup = "updateNotificationGroup" @@ -978,10 +1076,12 @@ const ( TypeUpdateFileGenerationStart = "updateFileGenerationStart" TypeUpdateFileGenerationStop = "updateFileGenerationStop" TypeUpdateCall = "updateCall" + TypeUpdateNewCallSignalingData = "updateNewCallSignalingData" TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" TypeUpdateUnreadChatCount = "updateUnreadChatCount" TypeUpdateOption = "updateOption" + TypeUpdateStickerSet = "updateStickerSet" TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" TypeUpdateTrendingStickerSets = "updateTrendingStickerSets" TypeUpdateRecentStickers = "updateRecentStickers" @@ -992,6 +1092,9 @@ const ( TypeUpdateConnectionState = "updateConnectionState" TypeUpdateTermsOfService = "updateTermsOfService" TypeUpdateUsersNearby = "updateUsersNearby" + TypeUpdateDiceEmojis = "updateDiceEmojis" + TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" + TypeUpdateSuggestedActions = "updateSuggestedActions" TypeUpdateNewInlineQuery = "updateNewInlineQuery" TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult" TypeUpdateNewCallbackQuery = "updateNewCallbackQuery" @@ -1022,7 +1125,7 @@ type AuthenticationCodeType interface { AuthenticationCodeTypeType() string } -// Represents the current authorization state of the client +// Represents the current authorization state of the TDLib client type AuthorizationState interface { AuthorizationStateType() string } @@ -1032,6 +1135,11 @@ type InputFile interface { InputFileType() string } +// Describes format of the thumbnail +type ThumbnailFormat interface { + ThumbnailFormatType() string +} + // Part of the face, relative to which a mask should be placed type MaskPoint interface { MaskPointType() string @@ -1047,6 +1155,11 @@ type UserType interface { UserTypeType() string } +// Describes a photo to be set as a user profile or chat photo +type InputChatPhoto interface { + InputChatPhotoType() string +} + // Provides information about the status of a member in a chat type ChatMemberStatus interface { ChatMemberStatusType() string @@ -1067,6 +1180,11 @@ type SecretChatState interface { SecretChatStateType() string } +// Contains information about the sender of a message +type MessageSender interface { + MessageSenderType() string +} + // Contains information about the origin of a forwarded message type MessageForwardOrigin interface { MessageForwardOriginType() string @@ -1092,6 +1210,11 @@ type ChatList interface { ChatListType() string } +// Describes a reason why an external chat is shown in a chat list +type ChatSource interface { + ChatSourceType() string +} + // Describes a type of public chats type PublicChatType interface { PublicChatTypeType() string @@ -1212,6 +1335,11 @@ type CallDiscardReason interface { CallDiscardReasonType() string } +// Describes the type of a call server +type CallServerType interface { + CallServerTypeType() string +} + // Describes the current call state type CallState interface { CallStateType() string @@ -1222,6 +1350,11 @@ type CallProblem interface { CallProblemType() string } +// Contains animated stickers which should be used for dice animation rendering +type DiceStickers interface { + DiceStickersType() string +} + // Represents a single result of an inline query; for bots only type InputInlineQueryResult interface { InputInlineQueryResultType() string @@ -1247,7 +1380,7 @@ type LanguagePackStringValue interface { LanguagePackStringValueType() string } -// Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, you must specify the correct application platform and upload valid server authentication data at https://my.telegram.org +// 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 } @@ -1347,6 +1480,11 @@ type TMeUrlType interface { TMeUrlTypeType() string } +// Describes an action suggested to the current user +type SuggestedAction interface { + SuggestedActionType() string +} + // Describes the way the text should be parsed for TextEntities type TextParseMode interface { TextParseModeType() string @@ -1357,6 +1495,21 @@ 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 +} + +// Contains a detailed statistics about a chat +type ChatStatistics interface { + ChatStatisticsType() string +} + // Contains notifications about data changes type Update interface { UpdateType() string @@ -1438,7 +1591,7 @@ type TdlibParameters struct { 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; must be non-empty + // 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"` @@ -1464,7 +1617,7 @@ func (*TdlibParameters) GetType() string { return TypeTdlibParameters } -// An authentication code is delivered via a private Telegram message, which can be viewed in another client +// An authentication code is delivered via a private Telegram message, which can be viewed from another active session type AuthenticationCodeTypeTelegramMessage struct { meta // Length of the code @@ -1654,7 +1807,7 @@ func (*EmailAddressAuthenticationCodeInfo) GetType() string { // Represents a part of the text that needs to be formatted in some unusual way type TextEntity struct { meta - // Offset of the entity in UTF-16 code units + // Offset of the entity, in UTF-16 code units Offset int32 `json:"offset"` // Length of the entity, in UTF-16 code units Length int32 `json:"length"` @@ -2182,7 +2335,7 @@ func (*LocalFile) GetType() string { // Represents a remote file type RemoteFile struct { meta - // Remote file identifier; may be empty. Can be used across application restarts or even from other devices for the current user. 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 client with the HTTP URL in the original_path and "#url#" as the conversion string. Clients should 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 should 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"` @@ -2268,7 +2421,7 @@ func (*InputFileId) InputFileType() string { return TypeInputFileId } -// A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client +// A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application type InputFileRemote struct { meta // Remote file identifier @@ -2322,7 +2475,7 @@ func (*InputFileLocal) InputFileType() string { return TypeInputFileLocal } -// A file generated by the client +// A file generated by the application type InputFileGenerated struct { meta // Local path to a file from which the file is generated; may be empty if there is no such file @@ -2353,17 +2506,19 @@ func (*InputFileGenerated) InputFileType() string { return TypeInputFileGenerated } -// Photo description +// Describes an image in JPEG format type PhotoSize struct { meta - // Thumbnail type (see https://core.telegram.org/constructor/photoSize) + // Image type (see https://core.telegram.org/constructor/photoSize) Type string `json:"type"` - // Information about the photo file + // Information about the image file Photo *File `json:"photo"` - // Photo width + // Image width Width int32 `json:"width"` - // Photo height + // Image height Height int32 `json:"height"` + // Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image + ProgressiveSizes []int32 `json:"progressive_sizes"` } func (entity *PhotoSize) MarshalJSON() ([]byte, error) { @@ -2409,6 +2564,208 @@ func (*Minithumbnail) GetType() string { return TypeMinithumbnail } +// The thumbnail is in JPEG format +type ThumbnailFormatJpeg struct { + meta +} + +func (entity *ThumbnailFormatJpeg) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatJpeg + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatJpeg) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatJpeg) GetType() string { + return TypeThumbnailFormatJpeg +} + +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 +} + +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 +} + +func (entity *ThumbnailFormatTgs) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatTgs + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatTgs) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatTgs) GetType() string { + return TypeThumbnailFormatTgs +} + +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 { + 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 +} + +// Represents a thumbnail +type Thumbnail struct { + meta + // Thumbnail format + Format ThumbnailFormat `json:"format"` + // Thumbnail width + Width int32 `json:"width"` + // Thumbnail height + Height int32 `json:"height"` + // The thumbnail + File *File `json:"file"` +} + +func (entity *Thumbnail) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Thumbnail + + return json.Marshal((*stub)(entity)) +} + +func (*Thumbnail) GetClass() string { + return ClassThumbnail +} + +func (*Thumbnail) GetType() string { + return TypeThumbnail +} + +func (thumbnail *Thumbnail) UnmarshalJSON(data []byte) error { + var tmp struct { + Format json.RawMessage `json:"format"` + Width int32 `json:"width"` + Height int32 `json:"height"` + File *File `json:"file"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + thumbnail.Width = tmp.Width + thumbnail.Height = tmp.Height + thumbnail.File = tmp.File + + fieldFormat, _ := UnmarshalThumbnailFormat(tmp.Format) + thumbnail.Format = fieldFormat + + return nil +} + // A mask should be placed relatively to the forehead type MaskPointForehead struct { meta @@ -2624,6 +2981,8 @@ type PollTypeQuiz struct { meta // 0-based identifier of the correct answer option; -1 for a yet unanswered poll CorrectOptionId int32 `json:"correct_option_id"` + // Text that is shown when the user chooses an incorrect answer or taps on the lamp icon, 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll + Explanation *FormattedText `json:"explanation"` } func (entity *PollTypeQuiz) MarshalJSON() ([]byte, error) { @@ -2659,10 +3018,12 @@ type Animation struct { FileName string `json:"file_name"` // MIME type of the file, usually "image/gif" or "video/mp4" MimeType string `json:"mime_type"` + // True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets + HasStickers bool `json:"has_stickers"` // Animation minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` - // Animation thumbnail; may be null - Thumbnail *PhotoSize `json:"thumbnail"` + // Animation thumbnail in JPEG or MPEG4 format; may be null + Thumbnail *Thumbnail `json:"thumbnail"` // File containing the animation Animation *File `json:"animation"` } @@ -2698,8 +3059,8 @@ 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; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null - AlbumCoverThumbnail *PhotoSize `json:"album_cover_thumbnail"` + // The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null + AlbumCoverThumbnail *Thumbnail `json:"album_cover_thumbnail"` // File containing the audio Audio *File `json:"audio"` } @@ -2730,7 +3091,7 @@ type Document struct { // Document minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` // Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null - Thumbnail *PhotoSize `json:"thumbnail"` + Thumbnail *Thumbnail `json:"thumbnail"` // File containing the document Document *File `json:"document"` } @@ -2754,7 +3115,7 @@ func (*Document) GetType() string { // Describes a photo type Photo struct { meta - // True, if stickers were added to the photo + // True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets HasStickers bool `json:"has_stickers"` // Photo minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` @@ -2796,7 +3157,7 @@ type Sticker struct { // Position where the mask should be placed; may be null MaskPosition *MaskPosition `json:"mask_position"` // Sticker thumbnail in WEBP or JPEG format; may be null - Thumbnail *PhotoSize `json:"thumbnail"` + Thumbnail *Thumbnail `json:"thumbnail"` // File containing the sticker Sticker *File `json:"sticker"` } @@ -2830,14 +3191,14 @@ type Video struct { FileName string `json:"file_name"` // MIME type of the file; as defined by the sender MimeType string `json:"mime_type"` - // True, if stickers were added to the video + // True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets HasStickers bool `json:"has_stickers"` // True, if the video should be tried to be streamed SupportsStreaming bool `json:"supports_streaming"` // Video minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` - // Video thumbnail; as defined by the sender; may be null - Thumbnail *PhotoSize `json:"thumbnail"` + // Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null + Thumbnail *Thumbnail `json:"thumbnail"` // File containing the video Video *File `json:"video"` } @@ -2867,8 +3228,8 @@ type VideoNote struct { Length int32 `json:"length"` // Video minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` - // Video thumbnail; as defined by the sender; may be null - Thumbnail *PhotoSize `json:"thumbnail"` + // Video thumbnail in JPEG format; as defined by the sender; may be null + Thumbnail *Thumbnail `json:"thumbnail"` // File containing the video Video *File `json:"video"` } @@ -2956,6 +3317,8 @@ type Location struct { Latitude float64 `json:"latitude"` // Longitude of the location, in degrees; as defined by the sender Longitude float64 `json:"longitude"` + // The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown + HorizontalAccuracy float64 `json:"horizontal_accuracy"` } func (entity *Location) MarshalJSON() ([]byte, error) { @@ -2983,7 +3346,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" needs 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"` @@ -3047,7 +3410,7 @@ type Poll struct { meta // Unique poll identifier Id JsonInt64 `json:"id"` - // Poll question, 1-255 characters + // Poll question, 1-300 characters Question string `json:"question"` // List of poll answer options Options []*PollOption `json:"options"` @@ -3059,6 +3422,10 @@ type Poll struct { IsAnonymous bool `json:"is_anonymous"` // Type of the poll Type PollType `json:"type"` + // Amount of time the poll will be active after creation, in seconds + OpenPeriod int32 `json:"open_period"` + // Point in time (Unix timestamp) when the poll will be automatically closed + CloseDate int32 `json:"close_date"` // True, if the poll is closed IsClosed bool `json:"is_closed"` } @@ -3088,6 +3455,8 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { RecentVoterUserIds []int32 `json:"recent_voter_user_ids"` IsAnonymous bool `json:"is_anonymous"` Type json.RawMessage `json:"type"` + OpenPeriod int32 `json:"open_period"` + CloseDate int32 `json:"close_date"` IsClosed bool `json:"is_closed"` } @@ -3102,6 +3471,8 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { poll.TotalVoterCount = tmp.TotalVoterCount poll.RecentVoterUserIds = tmp.RecentVoterUserIds poll.IsAnonymous = tmp.IsAnonymous + poll.OpenPeriod = tmp.OpenPeriod + poll.CloseDate = tmp.CloseDate poll.IsClosed = tmp.IsClosed fieldType, _ := UnmarshalPollType(tmp.Type) @@ -3113,12 +3484,14 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { // Describes a user profile photo type ProfilePhoto struct { meta - // Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of userProfilePhotos + // Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos Id JsonInt64 `json:"id"` // A small (160x160) user profile photo. The file can be downloaded only before the photo is changed Small *File `json:"small"` // A big (640x640) user profile photo. The file can be downloaded only before the photo is changed Big *File `json:"big"` + // True, if the photo has animated variant + HasAnimation bool `json:"has_animation"` } func (entity *ProfilePhoto) MarshalJSON() ([]byte, error) { @@ -3137,29 +3510,31 @@ func (*ProfilePhoto) GetType() string { return TypeProfilePhoto } -// Describes the photo of a chat -type ChatPhoto struct { +// Contains basic information about the photo of a chat +type ChatPhotoInfo struct { meta - // A small (160x160) chat photo. The file can be downloaded only before the photo is changed + // A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed Small *File `json:"small"` - // A big (640x640) chat photo. The file can be downloaded only before the photo is changed + // A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed Big *File `json:"big"` + // True, if the photo has animated variant + HasAnimation bool `json:"has_animation"` } -func (entity *ChatPhoto) MarshalJSON() ([]byte, error) { +func (entity *ChatPhotoInfo) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatPhoto + type stub ChatPhotoInfo return json.Marshal((*stub)(entity)) } -func (*ChatPhoto) GetClass() string { - return ClassChatPhoto +func (*ChatPhotoInfo) GetClass() string { + return ClassChatPhotoInfo } -func (*ChatPhoto) GetType() string { - return TypeChatPhoto +func (*ChatPhotoInfo) GetType() string { + return TypeChatPhotoInfo } // A regular user @@ -3221,7 +3596,7 @@ type UserTypeBot struct { CanReadAllGroupMessages bool `json:"can_read_all_group_messages"` // True, if the bot supports inline queries IsInline bool `json:"is_inline"` - // Placeholder for inline queries (displayed on the client input field) + // Placeholder for inline queries (displayed on the application input field) InlineQueryPlaceholder string `json:"inline_query_placeholder"` // True, if the location of the user should be sent with every inline query to this bot NeedLocation bool `json:"need_location"` @@ -3272,7 +3647,7 @@ func (*UserTypeUnknown) UserTypeType() string { return TypeUserTypeUnknown } -// Represents commands supported by a bot +// Represents a command supported by a bot type BotCommand struct { meta // Text of the bot command @@ -3347,6 +3722,207 @@ func (*ChatLocation) GetType() string { return TypeChatLocation } +// Animated variant of a chat photo in MPEG4 format +type AnimatedChatPhoto struct { + meta + // Animation width and height + Length int32 `json:"length"` + // Information about the animation file + File *File `json:"file"` + // Timestamp of the frame, used as a static chat photo + MainFrameTimestamp float64 `json:"main_frame_timestamp"` +} + +func (entity *AnimatedChatPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AnimatedChatPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*AnimatedChatPhoto) GetClass() string { + return ClassAnimatedChatPhoto +} + +func (*AnimatedChatPhoto) GetType() string { + return TypeAnimatedChatPhoto +} + +// Describes a chat or user profile photo +type ChatPhoto struct { + meta + // Unique photo identifier + Id JsonInt64 `json:"id"` + // Point in time (Unix timestamp) when the photo has been added + AddedDate int32 `json:"added_date"` + // Photo minithumbnail; may be null + Minithumbnail *Minithumbnail `json:"minithumbnail"` + // Available variants of the photo in JPEG format, in different size + Sizes []*PhotoSize `json:"sizes"` + // Animated variant of the photo in MPEG4 format; may be null + Animation *AnimatedChatPhoto `json:"animation"` +} + +func (entity *ChatPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhoto) GetClass() string { + return ClassChatPhoto +} + +func (*ChatPhoto) GetType() string { + return TypeChatPhoto +} + +// Contains a list of chat or user profile photos +type ChatPhotos struct { + meta + // Total number of photos + TotalCount int32 `json:"total_count"` + // List of photos + Photos []*ChatPhoto `json:"photos"` +} + +func (entity *ChatPhotos) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhotos + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhotos) GetClass() string { + return ClassChatPhotos +} + +func (*ChatPhotos) GetType() string { + return TypeChatPhotos +} + +// A previously used profile photo of the current user +type InputChatPhotoPrevious struct { + meta + // Identifier of the profile photo to reuse + ChatPhotoId JsonInt64 `json:"chat_photo_id"` +} + +func (entity *InputChatPhotoPrevious) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputChatPhotoPrevious + + return json.Marshal((*stub)(entity)) +} + +func (*InputChatPhotoPrevious) GetClass() string { + return ClassInputChatPhoto +} + +func (*InputChatPhotoPrevious) GetType() string { + return TypeInputChatPhotoPrevious +} + +func (*InputChatPhotoPrevious) InputChatPhotoType() string { + return TypeInputChatPhotoPrevious +} + +// A static photo in JPEG format +type InputChatPhotoStatic struct { + meta + // Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed + Photo InputFile `json:"photo"` +} + +func (entity *InputChatPhotoStatic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputChatPhotoStatic + + return json.Marshal((*stub)(entity)) +} + +func (*InputChatPhotoStatic) GetClass() string { + return ClassInputChatPhoto +} + +func (*InputChatPhotoStatic) GetType() string { + return TypeInputChatPhotoStatic +} + +func (*InputChatPhotoStatic) InputChatPhotoType() string { + return TypeInputChatPhotoStatic +} + +func (inputChatPhotoStatic *InputChatPhotoStatic) UnmarshalJSON(data []byte) error { + var tmp struct { + Photo json.RawMessage `json:"photo"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) + inputChatPhotoStatic.Photo = fieldPhoto + + return nil +} + +// An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 800 and be at most 2MB in size +type InputChatPhotoAnimation struct { + meta + // Animation to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed + Animation InputFile `json:"animation"` + // Timestamp of the frame, which will be used as static chat photo + MainFrameTimestamp float64 `json:"main_frame_timestamp"` +} + +func (entity *InputChatPhotoAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputChatPhotoAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*InputChatPhotoAnimation) GetClass() string { + return ClassInputChatPhoto +} + +func (*InputChatPhotoAnimation) GetType() string { + return TypeInputChatPhotoAnimation +} + +func (*InputChatPhotoAnimation) InputChatPhotoType() string { + return TypeInputChatPhotoAnimation +} + +func (inputChatPhotoAnimation *InputChatPhotoAnimation) UnmarshalJSON(data []byte) error { + var tmp struct { + Animation json.RawMessage `json:"animation"` + MainFrameTimestamp float64 `json:"main_frame_timestamp"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputChatPhotoAnimation.MainFrameTimestamp = tmp.MainFrameTimestamp + + fieldAnimation, _ := UnmarshalInputFile(tmp.Animation) + inputChatPhotoAnimation.Animation = fieldAnimation + + return nil +} + // Represents a user type User struct { meta @@ -3449,13 +4025,17 @@ func (user *User) UnmarshalJSON(data []byte) error { return nil } -// Contains full information about a user (except the full list of profile photos) +// Contains full information about a user type UserFullInfo struct { meta - // True, if the user is blacklisted by the current user + // User profile photo; may be null + Photo *ChatPhoto `json:"photo"` + // True, if the user is blocked by the current user IsBlocked bool `json:"is_blocked"` // True, if the user can be called CanBeCalled bool `json:"can_be_called"` + // True, if a video call can be created with the user + SupportsVideoCalls bool `json:"supports_video_calls"` // True, if the user can't be called due to their privacy settings HasPrivateCalls bool `json:"has_private_calls"` // True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used @@ -3486,58 +4066,6 @@ func (*UserFullInfo) GetType() string { return TypeUserFullInfo } -// Contains full information about a user profile photo -type UserProfilePhoto struct { - meta - // Unique user profile photo identifier - Id JsonInt64 `json:"id"` - // Point in time (Unix timestamp) when the photo has been added - AddedDate int32 `json:"added_date"` - // Available variants of the user photo, in different sizes - Sizes []*PhotoSize `json:"sizes"` -} - -func (entity *UserProfilePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserProfilePhoto - - return json.Marshal((*stub)(entity)) -} - -func (*UserProfilePhoto) GetClass() string { - return ClassUserProfilePhoto -} - -func (*UserProfilePhoto) GetType() string { - return TypeUserProfilePhoto -} - -// Contains part of the list of user photos -type UserProfilePhotos struct { - meta - // Total number of user profile photos - TotalCount int32 `json:"total_count"` - // A list of photos - Photos []*UserProfilePhoto `json:"photos"` -} - -func (entity *UserProfilePhotos) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserProfilePhotos - - return json.Marshal((*stub)(entity)) -} - -func (*UserProfilePhotos) GetClass() string { - return ClassUserProfilePhotos -} - -func (*UserProfilePhotos) GetType() string { - return TypeUserProfilePhotos -} - // Represents a list of users type Users struct { meta @@ -3622,7 +4150,7 @@ type ChatPermissions struct { 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, and stickers and use inline bots. Implies can_send_messages permissions + // 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"` @@ -3655,6 +4183,8 @@ type ChatMemberStatusCreator struct { meta // A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only CustomTitle string `json:"custom_title"` + // True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only + IsAnonymous bool `json:"is_anonymous"` // True, if the user is a member of the chat IsMember bool `json:"is_member"` } @@ -3702,6 +4232,8 @@ type ChatMemberStatusAdministrator struct { 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 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) { @@ -3839,11 +4371,11 @@ type ChatMember struct { UserId int32 `json:"user_id"` // Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown InviterUserId int32 `json:"inviter_user_id"` - // Point in time (Unix timestamp) when the user joined a chat + // Point in time (Unix timestamp) when the user joined the chat JoinedChatDate int32 `json:"joined_chat_date"` // Status of the member in the chat Status ChatMemberStatus `json:"status"` - // If the user is a bot, information about the bot; may be null. Can be null even for a bot if the bot is not a chat member + // If the user is a bot, information about the bot; may be null. Can be null even for a bot if the bot is not the chat member BotInfo *BotInfo `json:"bot_info"` } @@ -3988,6 +4520,33 @@ func (*ChatMembersFilterMembers) ChatMembersFilterType() string { return TypeChatMembersFilterMembers } +// Returns users which can be mentioned in the chat +type ChatMembersFilterMention struct { + meta + // If non-zero, the identifier of the current message thread + MessageThreadId int64 `json:"message_thread_id"` +} + +func (entity *ChatMembersFilterMention) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMembersFilterMention + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMembersFilterMention) GetClass() string { + return ClassChatMembersFilter +} + +func (*ChatMembersFilterMention) GetType() string { + return TypeChatMembersFilterMention +} + +func (*ChatMembersFilterMention) ChatMembersFilterType() string { + return TypeChatMembersFilterMention +} + // Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup type ChatMembersFilterRestricted struct { meta @@ -4221,6 +4780,35 @@ func (*SupergroupMembersFilterBanned) SupergroupMembersFilterType() string { return TypeSupergroupMembersFilterBanned } +// Returns users which can be mentioned in the supergroup +type SupergroupMembersFilterMention struct { + meta + // Query to search for + Query string `json:"query"` + // If non-zero, the identifier of the current message thread + MessageThreadId int64 `json:"message_thread_id"` +} + +func (entity *SupergroupMembersFilterMention) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SupergroupMembersFilterMention + + return json.Marshal((*stub)(entity)) +} + +func (*SupergroupMembersFilterMention) GetClass() string { + return ClassSupergroupMembersFilter +} + +func (*SupergroupMembersFilterMention) GetType() string { + return TypeSupergroupMembersFilterMention +} + +func (*SupergroupMembersFilterMention) SupergroupMembersFilterType() string { + return TypeSupergroupMembersFilterMention +} + // Returns bot members of the supergroup or channel type SupergroupMembersFilterBots struct { meta @@ -4305,6 +4893,8 @@ func (basicGroup *BasicGroup) UnmarshalJSON(data []byte) error { // Contains full information about a basic group type BasicGroupFullInfo struct { meta + // Chat photo; may be null + Photo *ChatPhoto `json:"photo"` // Group description Description string `json:"description"` // User identifier of the creator of the group; 0 if unknown @@ -4342,7 +4932,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"` - // Member count; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was found through SearchPublicChats + // 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"` @@ -4422,6 +5012,8 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { // Contains full information about a supergroup or channel type SupergroupFullInfo struct { meta + // Chat photo; may be null + Photo *ChatPhoto `json:"photo"` // Supergroup or channel description Description string `json:"description"` // Number of members in the supergroup or channel; 0 if unknown @@ -4446,8 +5038,8 @@ type SupergroupFullInfo struct { CanSetStickerSet bool `json:"can_set_sticker_set"` // True, if the supergroup location can be changed CanSetLocation bool `json:"can_set_location"` - // True, if the channel statistics is available through getChatStatisticsUrl - CanViewStatistics bool `json:"can_view_statistics"` + // 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 IsAllHistoryAvailable bool `json:"is_all_history_available"` // Identifier of the supergroup sticker set; 0 if none @@ -4568,7 +5160,7 @@ type SecretChat struct { Ttl int32 `json:"ttl"` // 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 other client. Video notes are supported if the layer >= 66; 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. Video notes are supported if the layer >= 66; nested text entities and underline and strikethrough entities are supported if the layer >= 101 Layer int32 `json:"layer"` } @@ -4617,7 +5209,86 @@ func (secretChat *SecretChat) UnmarshalJSON(data []byte) error { return nil } -// The message was originally written by a known user +// The message was sent by a known user +type MessageSenderUser struct { + meta + // Identifier of the user that sent the message + UserId int32 `json:"user_id"` +} + +func (entity *MessageSenderUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSenderUser + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSenderUser) GetClass() string { + return ClassMessageSender +} + +func (*MessageSenderUser) GetType() string { + return TypeMessageSenderUser +} + +func (*MessageSenderUser) MessageSenderType() string { + return TypeMessageSenderUser +} + +// The message was sent on behalf of a chat +type MessageSenderChat struct { + meta + // Identifier of the chat that sent the message + ChatId int64 `json:"chat_id"` +} + +func (entity *MessageSenderChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSenderChat + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSenderChat) GetClass() string { + return ClassMessageSender +} + +func (*MessageSenderChat) GetType() string { + return TypeMessageSenderChat +} + +func (*MessageSenderChat) MessageSenderType() string { + return TypeMessageSenderChat +} + +// Represents a list of message senders +type MessageSenders struct { + meta + // Approximate total count of messages senders found + TotalCount int32 `json:"total_count"` + // List of message senders + Senders []MessageSender `json:"senders"` +} + +func (entity *MessageSenders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSenders + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSenders) GetClass() string { + return ClassMessageSenders +} + +func (*MessageSenders) GetType() string { + return TypeMessageSenders +} + +// The message was originally sent by a known user type MessageForwardOriginUser struct { meta // Identifier of the user that originally sent the message @@ -4644,7 +5315,36 @@ func (*MessageForwardOriginUser) MessageForwardOriginType() string { return TypeMessageForwardOriginUser } -// The message was originally written by a user, which is hidden by their privacy settings +// The message was originally sent by an anonymous chat administrator on behalf of the chat +type MessageForwardOriginChat struct { + meta + // Identifier of the chat that originally sent the message + SenderChatId int64 `json:"sender_chat_id"` + // Original message author signature + AuthorSignature string `json:"author_signature"` +} + +func (entity *MessageForwardOriginChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForwardOriginChat + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForwardOriginChat) GetClass() string { + return ClassMessageForwardOrigin +} + +func (*MessageForwardOriginChat) GetType() string { + return TypeMessageForwardOriginChat +} + +func (*MessageForwardOriginChat) MessageForwardOriginType() string { + return TypeMessageForwardOriginChat +} + +// The message was originally sent by a user, which is hidden by their privacy settings type MessageForwardOriginHiddenUser struct { meta // Name of the sender @@ -4676,7 +5376,7 @@ type MessageForwardOriginChannel struct { meta // Identifier of the chat from which the message was originally forwarded ChatId int64 `json:"chat_id"` - // Message identifier of the original message; 0 if unknown + // Message identifier of the original message MessageId int64 `json:"message_id"` // Original post author signature AuthorSignature string `json:"author_signature"` @@ -4709,9 +5409,11 @@ type MessageForwardInfo struct { Origin MessageForwardOrigin `json:"origin"` // Point in time (Unix timestamp) when the message was originally sent Date int32 `json:"date"` - // For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown + // The type of a public service announcement for the forwarded message + PublicServiceAnnouncementType string `json:"public_service_announcement_type"` + // For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown FromChatId int64 `json:"from_chat_id"` - // For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown + // For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown FromMessageId int64 `json:"from_message_id"` } @@ -4733,10 +5435,11 @@ func (*MessageForwardInfo) GetType() string { func (messageForwardInfo *MessageForwardInfo) UnmarshalJSON(data []byte) error { var tmp struct { - Origin json.RawMessage `json:"origin"` - Date int32 `json:"date"` - FromChatId int64 `json:"from_chat_id"` - FromMessageId int64 `json:"from_message_id"` + Origin json.RawMessage `json:"origin"` + Date int32 `json:"date"` + PublicServiceAnnouncementType string `json:"public_service_announcement_type"` + FromChatId int64 `json:"from_chat_id"` + FromMessageId int64 `json:"from_message_id"` } err := json.Unmarshal(data, &tmp) @@ -4745,6 +5448,7 @@ func (messageForwardInfo *MessageForwardInfo) UnmarshalJSON(data []byte) error { } messageForwardInfo.Date = tmp.Date + messageForwardInfo.PublicServiceAnnouncementType = tmp.PublicServiceAnnouncementType messageForwardInfo.FromChatId = tmp.FromChatId messageForwardInfo.FromMessageId = tmp.FromMessageId @@ -4754,6 +5458,64 @@ func (messageForwardInfo *MessageForwardInfo) UnmarshalJSON(data []byte) error { return nil } +// Contains information about replies to a message +type MessageReplyInfo struct { + meta + // Number of times the message was directly or indirectly replied + ReplyCount int32 `json:"reply_count"` + // Recent repliers to the message; available in channels with a discussion supergroup + RecentRepliers []MessageSender `json:"recent_repliers"` + // Identifier of the last read incoming reply to the message + LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` + // Identifier of the last read outgoing reply to the message + LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` + // Identifier of the last reply to the message + LastMessageId int64 `json:"last_message_id"` +} + +func (entity *MessageReplyInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReplyInfo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReplyInfo) GetClass() string { + return ClassMessageReplyInfo +} + +func (*MessageReplyInfo) GetType() string { + return TypeMessageReplyInfo +} + +// Contains information about interactions with a message +type MessageInteractionInfo struct { + meta + // Number of times the message was viewed + ViewCount int32 `json:"view_count"` + // Number of times the message was forwarded + ForwardCount int32 `json:"forward_count"` + // Contains 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"` +} + +func (entity *MessageInteractionInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageInteractionInfo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageInteractionInfo) GetClass() string { + return ClassMessageInteractionInfo +} + +func (*MessageInteractionInfo) GetType() string { + return TypeMessageInteractionInfo +} + // The message is being sent now, but has not yet been delivered to the server type MessageSendingStatePending struct { meta @@ -4815,10 +5577,10 @@ func (*MessageSendingStateFailed) MessageSendingStateType() string { // Describes a message type Message struct { meta - // Message identifier, unique for the chat to which the message belongs + // Message identifier; unique for the chat to which the message belongs Id int64 `json:"id"` - // Identifier of the user who sent the message; 0 if unknown. Currently, it is unknown for channel posts and for channel posts automatically forwarded to discussion group - SenderUserId int32 `json:"sender_user_id"` + // The sender of the message + Sender MessageSender `json:"sender"` // Chat identifier ChatId int64 `json:"chat_id"` // Information about the sending state of the message; may be null @@ -4827,7 +5589,9 @@ type Message struct { SchedulingState MessageSchedulingState `json:"scheduling_state"` // True, if the message is outgoing IsOutgoing bool `json:"is_outgoing"` - // True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the client + // True, if the message is pinned + IsPinned bool `json:"is_pinned"` + // True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application CanBeEdited bool `json:"can_be_edited"` // True, if the message can be forwarded CanBeForwarded bool `json:"can_be_forwarded"` @@ -4835,6 +5599,10 @@ 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 + CanGetStatistics bool `json:"can_get_statistics"` + // True, if the message thread info is available + CanGetMessageThread bool `json:"can_get_message_thread"` // 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 contains an unread mention for the current user @@ -4845,18 +5613,22 @@ type Message struct { EditDate int32 `json:"edit_date"` // Information about the initial message sender; may be null ForwardInfo *MessageForwardInfo `json:"forward_info"` + // Information about interactions with the message; may be null + InteractionInfo *MessageInteractionInfo `json:"interaction_info"` + // 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 TtlExpiresIn float64 `json:"ttl_expires_in"` // If non-zero, the user identifier of the bot through which this message was sent ViaBotUserId int32 `json:"via_bot_user_id"` - // For channel posts, optional author signature + // For channel posts and anonymous group messages, optional author signature AuthorSignature string `json:"author_signature"` - // Number of times this message was viewed - Views int32 `json:"views"` // Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums MediaAlbumId JsonInt64 `json:"media_album_id"` // If non-empty, contains a human-readable description of the reason why access to this message must be restricted @@ -4885,31 +5657,36 @@ func (*Message) GetType() string { func (message *Message) UnmarshalJSON(data []byte) error { var tmp struct { - Id int64 `json:"id"` - SenderUserId int32 `json:"sender_user_id"` - ChatId int64 `json:"chat_id"` - SendingState json.RawMessage `json:"sending_state"` - SchedulingState json.RawMessage `json:"scheduling_state"` - IsOutgoing bool `json:"is_outgoing"` - CanBeEdited bool `json:"can_be_edited"` - CanBeForwarded bool `json:"can_be_forwarded"` - CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` - CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - IsChannelPost bool `json:"is_channel_post"` - ContainsUnreadMention bool `json:"contains_unread_mention"` - Date int32 `json:"date"` - EditDate int32 `json:"edit_date"` - ForwardInfo *MessageForwardInfo `json:"forward_info"` - ReplyToMessageId int64 `json:"reply_to_message_id"` - Ttl int32 `json:"ttl"` - TtlExpiresIn float64 `json:"ttl_expires_in"` - ViaBotUserId int32 `json:"via_bot_user_id"` - AuthorSignature string `json:"author_signature"` - Views int32 `json:"views"` - MediaAlbumId JsonInt64 `json:"media_album_id"` - RestrictionReason string `json:"restriction_reason"` - Content json.RawMessage `json:"content"` - ReplyMarkup json.RawMessage `json:"reply_markup"` + Id int64 `json:"id"` + Sender json.RawMessage `json:"sender"` + ChatId int64 `json:"chat_id"` + SendingState json.RawMessage `json:"sending_state"` + SchedulingState json.RawMessage `json:"scheduling_state"` + IsOutgoing bool `json:"is_outgoing"` + IsPinned bool `json:"is_pinned"` + CanBeEdited bool `json:"can_be_edited"` + CanBeForwarded bool `json:"can_be_forwarded"` + CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` + CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` + CanGetStatistics bool `json:"can_get_statistics"` + CanGetMessageThread bool `json:"can_get_message_thread"` + IsChannelPost bool `json:"is_channel_post"` + 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"` + 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"` + ViaBotUserId int32 `json:"via_bot_user_id"` + AuthorSignature string `json:"author_signature"` + MediaAlbumId JsonInt64 `json:"media_album_id"` + RestrictionReason string `json:"restriction_reason"` + Content json.RawMessage `json:"content"` + ReplyMarkup json.RawMessage `json:"reply_markup"` } err := json.Unmarshal(data, &tmp) @@ -4918,27 +5695,34 @@ func (message *Message) UnmarshalJSON(data []byte) error { } message.Id = tmp.Id - message.SenderUserId = tmp.SenderUserId message.ChatId = tmp.ChatId message.IsOutgoing = tmp.IsOutgoing + message.IsPinned = tmp.IsPinned message.CanBeEdited = tmp.CanBeEdited message.CanBeForwarded = tmp.CanBeForwarded message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers + message.CanGetStatistics = tmp.CanGetStatistics + message.CanGetMessageThread = tmp.CanGetMessageThread message.IsChannelPost = tmp.IsChannelPost message.ContainsUnreadMention = tmp.ContainsUnreadMention message.Date = tmp.Date message.EditDate = tmp.EditDate message.ForwardInfo = tmp.ForwardInfo + message.InteractionInfo = tmp.InteractionInfo + message.ReplyInChatId = tmp.ReplyInChatId message.ReplyToMessageId = tmp.ReplyToMessageId + message.MessageThreadId = tmp.MessageThreadId message.Ttl = tmp.Ttl message.TtlExpiresIn = tmp.TtlExpiresIn message.ViaBotUserId = tmp.ViaBotUserId message.AuthorSignature = tmp.AuthorSignature - message.Views = tmp.Views message.MediaAlbumId = tmp.MediaAlbumId message.RestrictionReason = tmp.RestrictionReason + fieldSender, _ := UnmarshalMessageSender(tmp.Sender) + message.Sender = fieldSender + fieldSendingState, _ := UnmarshalMessageSendingState(tmp.SendingState) message.SendingState = fieldSendingState @@ -4982,10 +5766,12 @@ 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 + TotalCount int32 `json:"total_count"` // List of messages Messages []*Message `json:"messages"` - // Value to pass as from_search_id to get more results - NextFromSearchId JsonInt64 `json:"next_from_search_id"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` } func (entity *FoundMessages) MarshalJSON() ([]byte, error) { @@ -5156,6 +5942,8 @@ type DraftMessage struct { meta // 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"` // Content of the message draft; this should always be of type inputMessageText InputMessageText InputMessageContent `json:"input_message_text"` } @@ -5179,6 +5967,7 @@ func (*DraftMessage) GetType() string { func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { var tmp struct { ReplyToMessageId int64 `json:"reply_to_message_id"` + Date int32 `json:"date"` InputMessageText json.RawMessage `json:"input_message_text"` } @@ -5188,6 +5977,7 @@ func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { } draftMessage.ReplyToMessageId = tmp.ReplyToMessageId + draftMessage.Date = tmp.Date fieldInputMessageText, _ := UnmarshalInputMessageContent(tmp.InputMessageText) draftMessage.InputMessageText = fieldInputMessageText @@ -5307,6 +6097,128 @@ func (*ChatTypeSecret) ChatTypeType() string { return TypeChatTypeSecret } +// Represents a filter of user chats +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 + IconName string `json:"icon_name"` + // The chat identifiers of pinned chats in the filtered chat list + PinnedChatIds []int64 `json:"pinned_chat_ids"` + // The chat identifiers of always included chats in the filtered chat list + IncludedChatIds []int64 `json:"included_chat_ids"` + // The chat identifiers of always excluded chats in the filtered chat list + ExcludedChatIds []int64 `json:"excluded_chat_ids"` + // True, if muted chats need to be excluded + ExcludeMuted bool `json:"exclude_muted"` + // True, if read chats need to be excluded + ExcludeRead bool `json:"exclude_read"` + // True, if archived chats need to be excluded + ExcludeArchived bool `json:"exclude_archived"` + // True, if contacts need to be included + IncludeContacts bool `json:"include_contacts"` + // True, if non-contact users need to be included + IncludeNonContacts bool `json:"include_non_contacts"` + // True, if bots need to be included + IncludeBots bool `json:"include_bots"` + // True, if basic groups and supergroups need to be included + IncludeGroups bool `json:"include_groups"` + // True, if channels need to be included + IncludeChannels bool `json:"include_channels"` +} + +func (entity *ChatFilter) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFilter + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFilter) GetClass() string { + return ClassChatFilter +} + +func (*ChatFilter) GetType() string { + return TypeChatFilter +} + +// Contains basic information about a chat filter +type ChatFilterInfo struct { + meta + // Unique chat filter identifier + 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" + IconName string `json:"icon_name"` +} + +func (entity *ChatFilterInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFilterInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFilterInfo) GetClass() string { + return ClassChatFilterInfo +} + +func (*ChatFilterInfo) GetType() string { + return TypeChatFilterInfo +} + +// Describes a recommended chat filter +type RecommendedChatFilter struct { + meta + // The chat filter + Filter *ChatFilter `json:"filter"` + // Chat filter description + Description string `json:"description"` +} + +func (entity *RecommendedChatFilter) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RecommendedChatFilter + + return json.Marshal((*stub)(entity)) +} + +func (*RecommendedChatFilter) GetClass() string { + return ClassRecommendedChatFilter +} + +func (*RecommendedChatFilter) GetType() string { + return TypeRecommendedChatFilter +} + +// Contains a list of recommended chat filters +type RecommendedChatFilters struct { + meta + // List of recommended chat filters + ChatFilters []*RecommendedChatFilter `json:"chat_filters"` +} + +func (entity *RecommendedChatFilters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RecommendedChatFilters + + return json.Marshal((*stub)(entity)) +} + +func (*RecommendedChatFilters) GetClass() string { + return ClassRecommendedChatFilters +} + +func (*RecommendedChatFilters) GetType() string { + return TypeRecommendedChatFilters +} + // A main list of chats type ChatListMain struct { meta @@ -5357,6 +6269,164 @@ func (*ChatListArchive) ChatListType() string { return TypeChatListArchive } +// A list of chats belonging to a chat filter +type ChatListFilter struct { + meta + // Chat filter identifier + ChatFilterId int32 `json:"chat_filter_id"` +} + +func (entity *ChatListFilter) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatListFilter + + return json.Marshal((*stub)(entity)) +} + +func (*ChatListFilter) GetClass() string { + return ClassChatList +} + +func (*ChatListFilter) GetType() string { + return TypeChatListFilter +} + +func (*ChatListFilter) ChatListType() string { + return TypeChatListFilter +} + +// Contains a list of chat lists +type ChatLists struct { + meta + // List of chat lists + ChatLists []ChatList `json:"chat_lists"` +} + +func (entity *ChatLists) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatLists + + return json.Marshal((*stub)(entity)) +} + +func (*ChatLists) GetClass() string { + return ClassChatLists +} + +func (*ChatLists) GetType() string { + return TypeChatLists +} + +// The chat is sponsored by the user's MTProxy server +type ChatSourceMtprotoProxy struct { + meta +} + +func (entity *ChatSourceMtprotoProxy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatSourceMtprotoProxy + + return json.Marshal((*stub)(entity)) +} + +func (*ChatSourceMtprotoProxy) GetClass() string { + return ClassChatSource +} + +func (*ChatSourceMtprotoProxy) GetType() string { + return TypeChatSourceMtprotoProxy +} + +func (*ChatSourceMtprotoProxy) ChatSourceType() string { + return TypeChatSourceMtprotoProxy +} + +// The chat contains a public service announcement +type ChatSourcePublicServiceAnnouncement struct { + meta + // The type of the announcement + Type string `json:"type"` + // The text of the announcement + Text string `json:"text"` +} + +func (entity *ChatSourcePublicServiceAnnouncement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatSourcePublicServiceAnnouncement + + return json.Marshal((*stub)(entity)) +} + +func (*ChatSourcePublicServiceAnnouncement) GetClass() string { + return ClassChatSource +} + +func (*ChatSourcePublicServiceAnnouncement) GetType() string { + return TypeChatSourcePublicServiceAnnouncement +} + +func (*ChatSourcePublicServiceAnnouncement) ChatSourceType() string { + return TypeChatSourcePublicServiceAnnouncement +} + +// Describes a position of a chat in a chat list +type ChatPosition struct { + meta + // The chat list + List ChatList `json:"list"` + // A parameter used to determine order of the chat in the chat list. Chats must be sorted by the pair (order, chat.id) in descending order + Order JsonInt64 `json:"order"` + // True, if the chat is pinned in the chat list + IsPinned bool `json:"is_pinned"` + // Source of the chat in the chat list; may be null + Source ChatSource `json:"source"` +} + +func (entity *ChatPosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPosition + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPosition) GetClass() string { + return ClassChatPosition +} + +func (*ChatPosition) GetType() string { + return TypeChatPosition +} + +func (chatPosition *ChatPosition) UnmarshalJSON(data []byte) error { + var tmp struct { + List json.RawMessage `json:"list"` + Order JsonInt64 `json:"order"` + IsPinned bool `json:"is_pinned"` + Source json.RawMessage `json:"source"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatPosition.Order = tmp.Order + chatPosition.IsPinned = tmp.IsPinned + + fieldList, _ := UnmarshalChatList(tmp.List) + chatPosition.List = fieldList + + fieldSource, _ := UnmarshalChatSource(tmp.Source) + chatPosition.Source = fieldSource + + return nil +} + // A chat. (Can be a private chat, basic group, supergroup, or secret chat) type Chat struct { meta @@ -5364,24 +6434,20 @@ type Chat struct { Id int64 `json:"id"` // Type of the chat Type ChatType `json:"type"` - // A chat list to which the chat belongs; may be null - ChatList ChatList `json:"chat_list"` // Chat title Title string `json:"title"` // Chat photo; may be null - Photo *ChatPhoto `json:"photo"` + Photo *ChatPhotoInfo `json:"photo"` // Actions that non-administrator chat members are allowed to take in the chat Permissions *ChatPermissions `json:"permissions"` // Last message in the chat; may be null LastMessage *Message `json:"last_message"` - // Descending parameter by which chats are sorted in the main chat list. If the order number of two chats is the same, they must be sorted in descending order by ID. If 0, the position of the chat in the list is undetermined - Order JsonInt64 `json:"order"` - // True, if the chat is pinned - IsPinned bool `json:"is_pinned"` + // Positions of the chat in chat lists + Positions []*ChatPosition `json:"positions"` // True, if the chat is marked as unread IsMarkedAsUnread bool `json:"is_marked_as_unread"` - // True, if the chat is sponsored by the user's MTProxy server - IsSponsored bool `json:"is_sponsored"` + // True, if the chat is blocked by the current user and private messages from the chat can't be received + IsBlocked bool `json:"is_blocked"` // True, if the chat has scheduled messages HasScheduledMessages bool `json:"has_scheduled_messages"` // True, if the chat messages can be deleted only for the current user while other users will continue to see the messages @@ -5404,13 +6470,11 @@ type Chat struct { NotificationSettings *ChatNotificationSettings `json:"notification_settings"` // Describes actions which should be possible to do through a chat action bar; may be null ActionBar ChatActionBar `json:"action_bar"` - // Identifier of the pinned message in the chat; 0 if none - PinnedMessageId int64 `json:"pinned_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 ReplyMarkupMessageId int64 `json:"reply_markup_message_id"` // A draft of a message in the chat; may be null DraftMessage *DraftMessage `json:"draft_message"` - // Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if the message database is used + // Contains 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 ClientData string `json:"client_data"` } @@ -5434,15 +6498,13 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { var tmp struct { Id int64 `json:"id"` Type json.RawMessage `json:"type"` - ChatList json.RawMessage `json:"chat_list"` Title string `json:"title"` - Photo *ChatPhoto `json:"photo"` + Photo *ChatPhotoInfo `json:"photo"` Permissions *ChatPermissions `json:"permissions"` LastMessage *Message `json:"last_message"` - Order JsonInt64 `json:"order"` - IsPinned bool `json:"is_pinned"` + Positions []*ChatPosition `json:"positions"` IsMarkedAsUnread bool `json:"is_marked_as_unread"` - IsSponsored bool `json:"is_sponsored"` + IsBlocked bool `json:"is_blocked"` HasScheduledMessages bool `json:"has_scheduled_messages"` CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` @@ -5454,7 +6516,6 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { UnreadMentionCount int32 `json:"unread_mention_count"` NotificationSettings *ChatNotificationSettings `json:"notification_settings"` ActionBar json.RawMessage `json:"action_bar"` - PinnedMessageId int64 `json:"pinned_message_id"` ReplyMarkupMessageId int64 `json:"reply_markup_message_id"` DraftMessage *DraftMessage `json:"draft_message"` ClientData string `json:"client_data"` @@ -5470,10 +6531,9 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.Photo = tmp.Photo chat.Permissions = tmp.Permissions chat.LastMessage = tmp.LastMessage - chat.Order = tmp.Order - chat.IsPinned = tmp.IsPinned + chat.Positions = tmp.Positions chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread - chat.IsSponsored = tmp.IsSponsored + chat.IsBlocked = tmp.IsBlocked chat.HasScheduledMessages = tmp.HasScheduledMessages chat.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf chat.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers @@ -5484,7 +6544,6 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId chat.UnreadMentionCount = tmp.UnreadMentionCount chat.NotificationSettings = tmp.NotificationSettings - chat.PinnedMessageId = tmp.PinnedMessageId chat.ReplyMarkupMessageId = tmp.ReplyMarkupMessageId chat.DraftMessage = tmp.DraftMessage chat.ClientData = tmp.ClientData @@ -5492,9 +6551,6 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { fieldType, _ := UnmarshalChatType(tmp.Type) chat.Type = fieldType - fieldChatList, _ := UnmarshalChatList(tmp.ChatList) - chat.ChatList = fieldChatList - fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) chat.ActionBar = fieldActionBar @@ -5504,6 +6560,8 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { // Represents a list of chats type Chats struct { meta + // Approximate total count of chats found + TotalCount int32 `json:"total_count"` // List of chat identifiers ChatIds []int64 `json:"chat_ids"` } @@ -5529,7 +6587,7 @@ type ChatNearby struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // Distance to the chat location in meters + // Distance to the chat location, in meters Distance int32 `json:"distance"` } @@ -5600,15 +6658,17 @@ func (*ChatInviteLink) GetType() string { // Contains information about a chat invite link type ChatInviteLinkInfo struct { meta - // Chat identifier of the invite link; 0 if the user is not a member of this chat + // Chat identifier of the invite link; 0 if the user has no access to the chat before joining ChatId int64 `json:"chat_id"` + // If non-zero, the amount of time for which read access to the chat will remain available, in seconds + AccessibleFor int32 `json:"accessible_for"` // Contains information about the type of the chat Type ChatType `json:"type"` // Title of the chat Title string `json:"title"` // Chat photo; may be null - Photo *ChatPhoto `json:"photo"` - // Number of members + Photo *ChatPhotoInfo `json:"photo"` + // Number of members in the chat MemberCount int32 `json:"member_count"` // User identifiers of some chat members that may be known to the current user MemberUserIds []int32 `json:"member_user_ids"` @@ -5635,9 +6695,10 @@ func (*ChatInviteLinkInfo) GetType() string { func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { var tmp struct { ChatId int64 `json:"chat_id"` + AccessibleFor int32 `json:"accessible_for"` Type json.RawMessage `json:"type"` Title string `json:"title"` - Photo *ChatPhoto `json:"photo"` + Photo *ChatPhotoInfo `json:"photo"` MemberCount int32 `json:"member_count"` MemberUserIds []int32 `json:"member_user_ids"` IsPublic bool `json:"is_public"` @@ -5649,6 +6710,7 @@ func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { } chatInviteLinkInfo.ChatId = tmp.ChatId + chatInviteLinkInfo.AccessibleFor = tmp.AccessibleFor chatInviteLinkInfo.Title = tmp.Title chatInviteLinkInfo.Photo = tmp.Photo chatInviteLinkInfo.MemberCount = tmp.MemberCount @@ -5714,6 +6776,8 @@ func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string { // The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam 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 + CanUnarchive bool `json:"can_unarchive"` } func (entity *ChatActionBarReportSpam) MarshalJSON() ([]byte, error) { @@ -5761,9 +6825,13 @@ func (*ChatActionBarReportUnrelatedLocation) ChatActionBarType() string { return TypeChatActionBarReportUnrelatedLocation } -// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be added to the contact list using the method addContact, or the other user can be blocked using the method blockUser +// 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 blockUser, or the other user can be added to the contact list using the method addContact 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 + CanUnarchive bool `json:"can_unarchive"` + // If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users + Distance int32 `json:"distance"` } func (entity *ChatActionBarReportAddBlock) MarshalJSON() ([]byte, error) { @@ -6042,7 +7110,7 @@ func (*InlineKeyboardButtonTypeLoginUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeLoginUrl } -// A button that sends a special callback query to a bot +// A button that sends a callback query to a bot type InlineKeyboardButtonTypeCallback struct { meta // Data to be sent to the bot via a callback query @@ -6069,7 +7137,34 @@ func (*InlineKeyboardButtonTypeCallback) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeCallback } -// A button with a game that sends a special callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame +// A button that asks for 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 + Data []byte `json:"data"` +} + +func (entity *InlineKeyboardButtonTypeCallbackWithPassword) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeCallbackWithPassword + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeCallbackWithPassword) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeCallbackWithPassword) GetType() string { + return TypeInlineKeyboardButtonTypeCallbackWithPassword +} + +func (*InlineKeyboardButtonTypeCallbackWithPassword) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeCallbackWithPassword +} + +// A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame type InlineKeyboardButtonTypeCallbackGame struct { meta } @@ -6192,7 +7287,7 @@ func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) err return nil } -// Instructs clients 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 @@ -6219,7 +7314,7 @@ func (*ReplyMarkupRemoveKeyboard) ReplyMarkupType() string { return TypeReplyMarkupRemoveKeyboard } -// Instructs clients to force a reply to this message +// Instructs application to force a reply to this message type ReplyMarkupForceReply struct { meta // True, if a forced reply must automatically be shown to the current user. For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user of a reply @@ -6251,9 +7346,9 @@ type ReplyMarkupShowKeyboard struct { meta // A list of rows of bot keyboard buttons Rows [][]*KeyboardButton `json:"rows"` - // True, if the client needs to resize the keyboard vertically + // True, if the application needs to resize the keyboard vertically ResizeKeyboard bool `json:"resize_keyboard"` - // True, if the client needs to hide the keyboard after use + // True, if the application needs to hide the keyboard after use OneTime bool `json:"one_time"` // True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply IsPersonal bool `json:"is_personal"` @@ -6368,6 +7463,37 @@ func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string { return TypeLoginUrlInfoRequestConfirmation } +// Contains information about a message thread +type MessageThreadInfo struct { + meta + // Identifier of the chat to which the message thread belongs + ChatId int64 `json:"chat_id"` + // Message thread identifier, unique within the chat + MessageThreadId int64 `json:"message_thread_id"` + // Contains information about the message thread + ReplyInfo *MessageReplyInfo `json:"reply_info"` + // The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) + Messages []*Message `json:"messages"` + // A draft of a message in the message thread; may be null + DraftMessage *DraftMessage `json:"draft_message"` +} + +func (entity *MessageThreadInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageThreadInfo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageThreadInfo) GetClass() string { + return ClassMessageThreadInfo +} + +func (*MessageThreadInfo) GetType() string { + return TypeMessageThreadInfo +} + // A plain text type RichTextPlain struct { meta @@ -6918,11 +8044,61 @@ func (*RichTextIcon) RichTextType() string { return TypeRichTextIcon } -// A rich text anchor +// A reference to a richTexts object on the same web page +type RichTextReference struct { + meta + // The text + Text RichText `json:"text"` + // The name of a richTextAnchor object, which is the first element of the target richTexts object + AnchorName string `json:"anchor_name"` + // An HTTP URL, opening the reference + Url string `json:"url"` +} + +func (entity *RichTextReference) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextReference + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextReference) GetClass() string { + return ClassRichText +} + +func (*RichTextReference) GetType() string { + return TypeRichTextReference +} + +func (*RichTextReference) RichTextType() string { + return TypeRichTextReference +} + +func (richTextReference *RichTextReference) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + AnchorName string `json:"anchor_name"` + Url string `json:"url"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextReference.AnchorName = tmp.AnchorName + richTextReference.Url = tmp.Url + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextReference.Text = fieldText + + return nil +} + +// An anchor type RichTextAnchor struct { meta - // Text - Text RichText `json:"text"` // Anchor name Name string `json:"name"` } @@ -6947,10 +8123,42 @@ func (*RichTextAnchor) RichTextType() string { return TypeRichTextAnchor } -func (richTextAnchor *RichTextAnchor) UnmarshalJSON(data []byte) error { +// A link to an anchor on the same web page +type RichTextAnchorLink struct { + meta + // The link text + Text RichText `json:"text"` + // The anchor name. If the name is empty, the link should bring back to top + AnchorName string `json:"anchor_name"` + // An HTTP URL, opening the anchor + Url string `json:"url"` +} + +func (entity *RichTextAnchorLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextAnchorLink + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextAnchorLink) GetClass() string { + return ClassRichText +} + +func (*RichTextAnchorLink) GetType() string { + return TypeRichTextAnchorLink +} + +func (*RichTextAnchorLink) RichTextType() string { + return TypeRichTextAnchorLink +} + +func (richTextAnchorLink *RichTextAnchorLink) UnmarshalJSON(data []byte) error { var tmp struct { - Text json.RawMessage `json:"text"` - Name string `json:"name"` + Text json.RawMessage `json:"text"` + AnchorName string `json:"anchor_name"` + Url string `json:"url"` } err := json.Unmarshal(data, &tmp) @@ -6958,10 +8166,11 @@ func (richTextAnchor *RichTextAnchor) UnmarshalJSON(data []byte) error { return err } - richTextAnchor.Name = tmp.Name + richTextAnchorLink.AnchorName = tmp.AnchorName + richTextAnchorLink.Url = tmp.Url fieldText, _ := UnmarshalRichText(tmp.Text) - richTextAnchor.Text = fieldText + richTextAnchorLink.Text = fieldText return nil } @@ -8222,7 +9431,7 @@ type PageBlockChatLink struct { // Chat title Title string `json:"title"` // Chat photo; may be null - Photo *ChatPhoto `json:"photo"` + Photo *ChatPhotoInfo `json:"photo"` // Chat username, by which all other information about the chat should be resolved Username string `json:"username"` } @@ -8443,10 +9652,10 @@ type WebPageInstantView struct { meta // Content of the web page 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 int32 `json:"version"` - // Instant view URL; may be different from WebPage.url and must be used for the correct anchors handling - Url string `json:"url"` // True, if the instant view must be shown from right to left IsRtl bool `json:"is_rtl"` // True, if the instant view contains the full page. A network request might be needed to get the full web page instant view @@ -8483,7 +9692,7 @@ type WebPage struct { // Title of the content Title string `json:"title"` // Description of the content - Description string `json:"description"` + Description *FormattedText `json:"description"` // Image representing the content; may be null Photo *Photo `json:"photo"` // URL to show in the embedded preview @@ -8532,6 +9741,137 @@ func (*WebPage) GetType() string { return TypeWebPage } +// Contains information about a country +type CountryInfo struct { + meta + // A two-letter ISO 3166-1 alpha-2 country code + CountryCode string `json:"country_code"` + // Native name of the country + Name string `json:"name"` + // English name of the country + EnglishName string `json:"english_name"` + // True, if the country should be hidden from the list of all countries + IsHidden bool `json:"is_hidden"` + // List of country calling codes + CallingCodes []string `json:"calling_codes"` +} + +func (entity *CountryInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CountryInfo + + return json.Marshal((*stub)(entity)) +} + +func (*CountryInfo) GetClass() string { + return ClassCountryInfo +} + +func (*CountryInfo) GetType() string { + return TypeCountryInfo +} + +// Contains information about countries +type Countries struct { + meta + // The list of countries + Countries []*CountryInfo `json:"countries"` +} + +func (entity *Countries) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Countries + + return json.Marshal((*stub)(entity)) +} + +func (*Countries) GetClass() string { + return ClassCountries +} + +func (*Countries) GetType() string { + return TypeCountries +} + +// Contains information about a phone number +type PhoneNumberInfo struct { + meta + // Information about the country to which the phone number belongs; may be null + Country *CountryInfo `json:"country"` + // The part of the phone number denoting country calling code or its part + CountryCallingCode string `json:"country_calling_code"` + // The phone number without country calling code formatted accordingly to local rules + FormattedPhoneNumber string `json:"formatted_phone_number"` +} + +func (entity *PhoneNumberInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PhoneNumberInfo + + return json.Marshal((*stub)(entity)) +} + +func (*PhoneNumberInfo) GetClass() string { + return ClassPhoneNumberInfo +} + +func (*PhoneNumberInfo) GetType() string { + return TypePhoneNumberInfo +} + +// Describes an action associated with a bank card number +type BankCardActionOpenUrl struct { + meta + // Action text + Text string `json:"text"` + // The URL to be opened + Url string `json:"url"` +} + +func (entity *BankCardActionOpenUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BankCardActionOpenUrl + + return json.Marshal((*stub)(entity)) +} + +func (*BankCardActionOpenUrl) GetClass() string { + return ClassBankCardActionOpenUrl +} + +func (*BankCardActionOpenUrl) GetType() string { + return TypeBankCardActionOpenUrl +} + +// Information about a bank card +type BankCardInfo struct { + meta + // Title of the bank card description + Title string `json:"title"` + // Actions that can be done with the bank card number + Actions []*BankCardActionOpenUrl `json:"actions"` +} + +func (entity *BankCardInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BankCardInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BankCardInfo) GetClass() string { + return ClassBankCardInfo +} + +func (*BankCardInfo) GetType() string { + return TypeBankCardInfo +} + // Describes an address type Address struct { meta @@ -10620,7 +11960,7 @@ type PassportAuthorizationForm struct { meta // Unique identifier of the authorization form Id int32 `json:"id"` - // Information about the Telegram Passport elements that need to be provided to complete the form + // Information about the Telegram Passport elements that must be provided to complete the form RequiredElements []*PassportRequiredElement `json:"required_elements"` // URL for the privacy policy of the service; may be empty PrivacyPolicyUrl string `json:"privacy_policy_url"` @@ -11385,10 +12725,14 @@ type MessageLocation struct { meta // The location description Location *Location `json:"location"` - // Time relative to the message sent date until which the location can be updated, in seconds + // Time relative to the message send date, for which the location can be updated, in seconds LivePeriod int32 `json:"live_period"` // Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes ExpiresIn int32 `json:"expires_in"` + // For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown + Heading int32 `json:"heading"` + // For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only for the message sender + ProximityAlertRadius int32 `json:"proximity_alert_radius"` } func (entity *MessageLocation) MarshalJSON() ([]byte, error) { @@ -11465,6 +12809,68 @@ func (*MessageContact) MessageContentType() string { return TypeMessageContact } +// A dice message. The dice value is randomly generated by the server +type MessageDice struct { + meta + // The animated stickers with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known + InitialState DiceStickers `json:"initial_state"` + // The animated stickers with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known + FinalState DiceStickers `json:"final_state"` + // Emoji on which the dice throw animation is based + Emoji string `json:"emoji"` + // The dice value. If the value is 0, the dice don't have final state yet + Value int32 `json:"value"` + // Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded + SuccessAnimationFrameNumber int32 `json:"success_animation_frame_number"` +} + +func (entity *MessageDice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageDice + + return json.Marshal((*stub)(entity)) +} + +func (*MessageDice) GetClass() string { + return ClassMessageContent +} + +func (*MessageDice) GetType() string { + return TypeMessageDice +} + +func (*MessageDice) MessageContentType() string { + return TypeMessageDice +} + +func (messageDice *MessageDice) UnmarshalJSON(data []byte) error { + var tmp struct { + InitialState json.RawMessage `json:"initial_state"` + FinalState json.RawMessage `json:"final_state"` + Emoji string `json:"emoji"` + Value int32 `json:"value"` + SuccessAnimationFrameNumber int32 `json:"success_animation_frame_number"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageDice.Emoji = tmp.Emoji + messageDice.Value = tmp.Value + messageDice.SuccessAnimationFrameNumber = tmp.SuccessAnimationFrameNumber + + fieldInitialState, _ := UnmarshalDiceStickers(tmp.InitialState) + messageDice.InitialState = fieldInitialState + + fieldFinalState, _ := UnmarshalDiceStickers(tmp.FinalState) + messageDice.FinalState = fieldFinalState + + return nil +} + // A message with a game type MessageGame struct { meta @@ -11565,6 +12971,8 @@ func (*MessageInvoice) MessageContentType() string { // A message with information about an ended call type MessageCall struct { meta + // True, if the call was a video call + IsVideo bool `json:"is_video"` // Reason why the call was discarded DiscardReason CallDiscardReason `json:"discard_reason"` // Call duration, in seconds @@ -11593,6 +13001,7 @@ func (*MessageCall) MessageContentType() string { func (messageCall *MessageCall) UnmarshalJSON(data []byte) error { var tmp struct { + IsVideo bool `json:"is_video"` DiscardReason json.RawMessage `json:"discard_reason"` Duration int32 `json:"duration"` } @@ -11602,6 +13011,7 @@ func (messageCall *MessageCall) UnmarshalJSON(data []byte) error { return err } + messageCall.IsVideo = tmp.IsVideo messageCall.Duration = tmp.Duration fieldDiscardReason, _ := UnmarshalCallDiscardReason(tmp.DiscardReason) @@ -11697,7 +13107,7 @@ func (*MessageChatChangeTitle) MessageContentType() string { type MessageChatChangePhoto struct { meta // New chat photo - Photo *Photo `json:"photo"` + Photo *ChatPhoto `json:"photo"` } func (entity *MessageChatChangePhoto) MarshalJSON() ([]byte, error) { @@ -12197,7 +13607,61 @@ func (*MessagePassportDataReceived) MessageContentType() string { return TypeMessagePassportDataReceived } -// Message content that is not supported by the client +// A user in the chat came within proximity alert range +type MessageProximityAlertTriggered struct { + meta + // The user or chat, which triggered the proximity alert + Traveler MessageSender `json:"traveler"` + // The user or chat, which subscribed for the proximity alert + Watcher MessageSender `json:"watcher"` + // The distance between the users + Distance int32 `json:"distance"` +} + +func (entity *MessageProximityAlertTriggered) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageProximityAlertTriggered + + return json.Marshal((*stub)(entity)) +} + +func (*MessageProximityAlertTriggered) GetClass() string { + return ClassMessageContent +} + +func (*MessageProximityAlertTriggered) GetType() string { + return TypeMessageProximityAlertTriggered +} + +func (*MessageProximityAlertTriggered) MessageContentType() string { + return TypeMessageProximityAlertTriggered +} + +func (messageProximityAlertTriggered *MessageProximityAlertTriggered) UnmarshalJSON(data []byte) error { + var tmp struct { + Traveler json.RawMessage `json:"traveler"` + Watcher json.RawMessage `json:"watcher"` + Distance int32 `json:"distance"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageProximityAlertTriggered.Distance = tmp.Distance + + fieldTraveler, _ := UnmarshalMessageSender(tmp.Traveler) + messageProximityAlertTriggered.Traveler = fieldTraveler + + fieldWatcher, _ := UnmarshalMessageSender(tmp.Watcher) + messageProximityAlertTriggered.Watcher = fieldWatcher + + return nil +} + +// Message content that is not supported in the current TDLib version type MessageUnsupported struct { meta } @@ -12397,6 +13861,31 @@ func (*TextEntityTypePhoneNumber) TextEntityTypeType() string { return TypeTextEntityTypePhoneNumber } +// A bank card number. The getBankCardInfo method can be used to get information about the bank card +type TextEntityTypeBankCardNumber struct { + meta +} + +func (entity *TextEntityTypeBankCardNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeBankCardNumber + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeBankCardNumber) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeBankCardNumber) GetType() string { + return TypeTextEntityTypeBankCardNumber +} + +func (*TextEntityTypeBankCardNumber) TextEntityTypeType() string { + return TypeTextEntityTypeBankCardNumber +} + // A bold text type TextEntityTypeBold struct { meta @@ -12628,7 +14117,7 @@ func (*TextEntityTypeMentionName) TextEntityTypeType() string { return TypeTextEntityTypeMentionName } -// A thumbnail to be sent along with a file; should be in JPEG or WEBP format for stickers, and less than 200 kB in size +// A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size type InputThumbnail struct { meta // Thumbnail file to send. Sending thumbnails by file_id is currently not supported @@ -12728,10 +14217,10 @@ func (*MessageSchedulingStateSendWhenOnline) MessageSchedulingStateType() string return TypeMessageSchedulingStateSendWhenOnline } -// Options to be used when a message is send -type SendMessageOptions struct { +// Options to be used when a message is sent +type MessageSendOptions struct { meta - // Pass true to disable notification for the message. Must be false if the message is sent to a secret chat + // Pass true to disable notification for the message DisableNotification bool `json:"disable_notification"` // Pass true if the message is sent from the background FromBackground bool `json:"from_background"` @@ -12739,23 +14228,23 @@ type SendMessageOptions struct { SchedulingState MessageSchedulingState `json:"scheduling_state"` } -func (entity *SendMessageOptions) MarshalJSON() ([]byte, error) { +func (entity *MessageSendOptions) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SendMessageOptions + type stub MessageSendOptions return json.Marshal((*stub)(entity)) } -func (*SendMessageOptions) GetClass() string { - return ClassSendMessageOptions +func (*MessageSendOptions) GetClass() string { + return ClassMessageSendOptions } -func (*SendMessageOptions) GetType() string { - return TypeSendMessageOptions +func (*MessageSendOptions) GetType() string { + return TypeMessageSendOptions } -func (sendMessageOptions *SendMessageOptions) UnmarshalJSON(data []byte) error { +func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { var tmp struct { DisableNotification bool `json:"disable_notification"` FromBackground bool `json:"from_background"` @@ -12767,15 +14256,42 @@ func (sendMessageOptions *SendMessageOptions) UnmarshalJSON(data []byte) error { return err } - sendMessageOptions.DisableNotification = tmp.DisableNotification - sendMessageOptions.FromBackground = tmp.FromBackground + messageSendOptions.DisableNotification = tmp.DisableNotification + messageSendOptions.FromBackground = tmp.FromBackground fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) - sendMessageOptions.SchedulingState = fieldSchedulingState + messageSendOptions.SchedulingState = fieldSchedulingState return nil } +// Options to be used when a message content is copied without a link to the original message +type MessageCopyOptions struct { + meta + // True, if content of the message needs to be copied without a link to the original message. Always true if the message is forwarded to a secret chat + SendCopy bool `json:"send_copy"` + // True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false + ReplaceCaption bool `json:"replace_caption"` + // New message caption. Ignored if replace_caption is false + NewCaption *FormattedText `json:"new_caption"` +} + +func (entity *MessageCopyOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageCopyOptions + + return json.Marshal((*stub)(entity)) +} + +func (*MessageCopyOptions) GetClass() string { + return ClassMessageCopyOptions +} + +func (*MessageCopyOptions) GetType() string { + return TypeMessageCopyOptions +} + // A text message type InputMessageText struct { meta @@ -12814,6 +14330,8 @@ type InputMessageAnimation struct { Animation InputFile `json:"animation"` // Animation thumbnail, if available Thumbnail *InputThumbnail `json:"thumbnail"` + // File identifiers of the stickers added to the animation, if applicable + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` // Duration of the animation, in seconds Duration int32 `json:"duration"` // Width of the animation; may be replaced by the server @@ -12846,12 +14364,13 @@ func (*InputMessageAnimation) InputMessageContentType() string { func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) error { var tmp struct { - Animation json.RawMessage `json:"animation"` - Thumbnail *InputThumbnail `json:"thumbnail"` - Duration int32 `json:"duration"` - Width int32 `json:"width"` - Height int32 `json:"height"` - Caption *FormattedText `json:"caption"` + Animation json.RawMessage `json:"animation"` + Thumbnail *InputThumbnail `json:"thumbnail"` + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + Duration int32 `json:"duration"` + Width int32 `json:"width"` + Height int32 `json:"height"` + Caption *FormattedText `json:"caption"` } err := json.Unmarshal(data, &tmp) @@ -12860,6 +14379,7 @@ func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) e } inputMessageAnimation.Thumbnail = tmp.Thumbnail + inputMessageAnimation.AddedStickerFileIds = tmp.AddedStickerFileIds inputMessageAnimation.Duration = tmp.Duration inputMessageAnimation.Width = tmp.Width inputMessageAnimation.Height = tmp.Height @@ -12942,6 +14462,8 @@ type InputMessageDocument struct { Document InputFile `json:"document"` // Document thumbnail, if available 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 + DisableContentTypeDetection bool `json:"disable_content_type_detection"` // Document caption; 0-GetOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -12968,9 +14490,10 @@ func (*InputMessageDocument) InputMessageContentType() string { func (inputMessageDocument *InputMessageDocument) UnmarshalJSON(data []byte) error { var tmp struct { - Document json.RawMessage `json:"document"` - Thumbnail *InputThumbnail `json:"thumbnail"` - Caption *FormattedText `json:"caption"` + Document json.RawMessage `json:"document"` + Thumbnail *InputThumbnail `json:"thumbnail"` + DisableContentTypeDetection bool `json:"disable_content_type_detection"` + Caption *FormattedText `json:"caption"` } err := json.Unmarshal(data, &tmp) @@ -12979,6 +14502,7 @@ func (inputMessageDocument *InputMessageDocument) UnmarshalJSON(data []byte) err } inputMessageDocument.Thumbnail = tmp.Thumbnail + inputMessageDocument.DisableContentTypeDetection = tmp.DisableContentTypeDetection inputMessageDocument.Caption = tmp.Caption fieldDocument, _ := UnmarshalInputFile(tmp.Document) @@ -13306,6 +14830,10 @@ type InputMessageLocation struct { Location *Location `json:"location"` // Period for which the location can be updated, in seconds; should be between 60 and 86400 for a live location and 0 otherwise LivePeriod int32 `json:"live_period"` + // For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown + Heading int32 `json:"heading"` + // For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can't be enabled in channels and Saved Messages + ProximityAlertRadius int32 `json:"proximity_alert_radius"` } func (entity *InputMessageLocation) MarshalJSON() ([]byte, error) { @@ -13382,6 +14910,35 @@ func (*InputMessageContact) InputMessageContentType() string { return TypeInputMessageContact } +// A dice message +type InputMessageDice struct { + meta + // Emoji on which the dice throw animation is based + Emoji string `json:"emoji"` + // True, if a chat message draft should be deleted + ClearDraft bool `json:"clear_draft"` +} + +func (entity *InputMessageDice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageDice + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageDice) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageDice) GetType() string { + return TypeInputMessageDice +} + +func (*InputMessageDice) InputMessageContentType() string { + return TypeInputMessageDice +} + // A message with a game; not supported for channels or secret chats type InputMessageGame struct { meta @@ -13461,7 +15018,7 @@ func (*InputMessageInvoice) InputMessageContentType() string { // 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 - // Poll question, 1-255 characters + // Poll question, 1-255 characters (up to 300 characters for bots) Question string `json:"question"` // List of poll answer options, 2-10 strings 1-100 characters each Options []string `json:"options"` @@ -13469,6 +15026,10 @@ type InputMessagePoll struct { IsAnonymous bool `json:"is_anonymous"` // Type of the poll Type PollType `json:"type"` + // Amount of time the poll will be active after creation, in seconds; for bots only + OpenPeriod int32 `json:"open_period"` + // Point in time (Unix timestamp) when the poll will be automatically closed; for bots only + CloseDate int32 `json:"close_date"` // True, if the poll needs to be sent already closed; for bots only IsClosed bool `json:"is_closed"` } @@ -13499,6 +15060,8 @@ func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { Options []string `json:"options"` IsAnonymous bool `json:"is_anonymous"` Type json.RawMessage `json:"type"` + OpenPeriod int32 `json:"open_period"` + CloseDate int32 `json:"close_date"` IsClosed bool `json:"is_closed"` } @@ -13510,6 +15073,8 @@ func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { inputMessagePoll.Question = tmp.Question inputMessagePoll.Options = tmp.Options inputMessagePoll.IsAnonymous = tmp.IsAnonymous + inputMessagePoll.OpenPeriod = tmp.OpenPeriod + inputMessagePoll.CloseDate = tmp.CloseDate inputMessagePoll.IsClosed = tmp.IsClosed fieldType, _ := UnmarshalPollType(tmp.Type) @@ -13527,10 +15092,8 @@ type InputMessageForwarded struct { MessageId int64 `json:"message_id"` // True, if a game message should be shared within a launched game; applies only to game messages InGameShare bool `json:"in_game_share"` - // True, if content of the message needs to be copied without a link to the original message. Always true if the message is forwarded to a secret chat - SendCopy bool `json:"send_copy"` - // True, if media caption of the message copy needs to be removed. Ignored if send_copy is false - RemoveCaption bool `json:"remove_caption"` + // Options to be used to copy content of the message without a link to the original message + CopyOptions *MessageCopyOptions `json:"copy_options"` } func (entity *InputMessageForwarded) MarshalJSON() ([]byte, error) { @@ -13928,7 +15491,7 @@ func (*SearchMessagesFilterMention) SearchMessagesFilterType() string { return TypeSearchMessagesFilterMention } -// 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 or by the sending user +// 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 type SearchMessagesFilterUnreadMention struct { meta } @@ -13953,6 +15516,56 @@ func (*SearchMessagesFilterUnreadMention) SearchMessagesFilterType() string { return TypeSearchMessagesFilterUnreadMention } +// Returns only failed to send messages. This filter can be used only if the message database is used +type SearchMessagesFilterFailedToSend struct { + meta +} + +func (entity *SearchMessagesFilterFailedToSend) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterFailedToSend + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterFailedToSend) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterFailedToSend) GetType() string { + return TypeSearchMessagesFilterFailedToSend +} + +func (*SearchMessagesFilterFailedToSend) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterFailedToSend +} + +// Returns only pinned messages +type SearchMessagesFilterPinned struct { + meta +} + +func (entity *SearchMessagesFilterPinned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterPinned + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterPinned) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterPinned) GetType() string { + return TypeSearchMessagesFilterPinned +} + +func (*SearchMessagesFilterPinned) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterPinned +} + // The user is typing a message type ChatActionTyping struct { meta @@ -14497,8 +16110,8 @@ type StickerSet struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed - Thumbnail *PhotoSize `json:"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 *Thumbnail `json:"thumbnail"` // True, if the sticker set has been installed by the current user IsInstalled bool `json:"is_installed"` // True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously @@ -14542,8 +16155,8 @@ type StickerSetInfo struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP format with width and height 100; may be null - Thumbnail *PhotoSize `json:"thumbnail"` + // Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null + Thumbnail *Thumbnail `json:"thumbnail"` // True, if the sticker set has been installed by current user IsInstalled bool `json:"is_installed"` // True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously @@ -14558,7 +16171,7 @@ type StickerSetInfo struct { IsViewed bool `json:"is_viewed"` // Total number of stickers in the set Size int32 `json:"size"` - // Contains up to the first 5 stickers from the set, depending on the context. If the client needs more stickers the full set should be requested + // Contains up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full set should be requested Covers []*Sticker `json:"covers"` } @@ -14739,6 +16352,8 @@ type CallProtocol struct { MinLayer int32 `json:"min_layer"` // The maximum supported API layer; use 65 MaxLayer int32 `json:"max_layer"` + // List of supported libtgvoip versions + LibraryVersions []string `json:"library_versions"` } func (entity *CallProtocol) MarshalJSON() ([]byte, error) { @@ -14757,35 +16372,120 @@ func (*CallProtocol) GetType() string { return TypeCallProtocol } -// Describes the address of UDP reflectors -type CallConnection struct { +// A Telegram call reflector +type CallServerTypeTelegramReflector struct { meta - // Reflector identifier - Id JsonInt64 `json:"id"` - // IPv4 reflector address - Ip string `json:"ip"` - // IPv6 reflector address - Ipv6 string `json:"ipv6"` - // Reflector port number - Port int32 `json:"port"` - // Connection peer tag + // A peer tag to be used with the reflector PeerTag []byte `json:"peer_tag"` } -func (entity *CallConnection) MarshalJSON() ([]byte, error) { +func (entity *CallServerTypeTelegramReflector) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub CallConnection + type stub CallServerTypeTelegramReflector return json.Marshal((*stub)(entity)) } -func (*CallConnection) GetClass() string { - return ClassCallConnection +func (*CallServerTypeTelegramReflector) GetClass() string { + return ClassCallServerType } -func (*CallConnection) GetType() string { - return TypeCallConnection +func (*CallServerTypeTelegramReflector) GetType() string { + return TypeCallServerTypeTelegramReflector +} + +func (*CallServerTypeTelegramReflector) CallServerTypeType() string { + return TypeCallServerTypeTelegramReflector +} + +// A WebRTC server +type CallServerTypeWebrtc struct { + meta + // Username to be used for authentication + Username string `json:"username"` + // Authentication password + Password string `json:"password"` + // True, if the server supports TURN + SupportsTurn bool `json:"supports_turn"` + // True, if the server supports STUN + SupportsStun bool `json:"supports_stun"` +} + +func (entity *CallServerTypeWebrtc) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallServerTypeWebrtc + + return json.Marshal((*stub)(entity)) +} + +func (*CallServerTypeWebrtc) GetClass() string { + return ClassCallServerType +} + +func (*CallServerTypeWebrtc) GetType() string { + return TypeCallServerTypeWebrtc +} + +func (*CallServerTypeWebrtc) CallServerTypeType() string { + return TypeCallServerTypeWebrtc +} + +// Describes a server for relaying call data +type CallServer struct { + meta + // Server identifier + Id JsonInt64 `json:"id"` + // Server IPv4 address + IpAddress string `json:"ip_address"` + // Server IPv6 address + Ipv6Address string `json:"ipv6_address"` + // Server port number + Port int32 `json:"port"` + // Server type + Type CallServerType `json:"type"` +} + +func (entity *CallServer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallServer + + return json.Marshal((*stub)(entity)) +} + +func (*CallServer) GetClass() string { + return ClassCallServer +} + +func (*CallServer) GetType() string { + return TypeCallServer +} + +func (callServer *CallServer) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + IpAddress string `json:"ip_address"` + Ipv6Address string `json:"ipv6_address"` + Port int32 `json:"port"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + callServer.Id = tmp.Id + callServer.IpAddress = tmp.IpAddress + callServer.Ipv6Address = tmp.Ipv6Address + callServer.Port = tmp.Port + + fieldType, _ := UnmarshalCallServerType(tmp.Type) + callServer.Type = fieldType + + return nil } // Contains the call identifier @@ -14870,8 +16570,8 @@ type CallStateReady struct { meta // Call protocols supported by the peer Protocol *CallProtocol `json:"protocol"` - // Available UDP reflectors - Connections []*CallConnection `json:"connections"` + // List of available call servers + Servers []*CallServer `json:"servers"` // A JSON-encoded call config Config string `json:"config"` // Call encryption key @@ -15181,6 +16881,56 @@ func (*CallProblemDropped) CallProblemType() string { return TypeCallProblemDropped } +// The video was distorted +type CallProblemDistortedVideo struct { + meta +} + +func (entity *CallProblemDistortedVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemDistortedVideo + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemDistortedVideo) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemDistortedVideo) GetType() string { + return TypeCallProblemDistortedVideo +} + +func (*CallProblemDistortedVideo) CallProblemType() string { + return TypeCallProblemDistortedVideo +} + +// The video was pixelated +type CallProblemPixelatedVideo struct { + meta +} + +func (entity *CallProblemPixelatedVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemPixelatedVideo + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemPixelatedVideo) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemPixelatedVideo) GetType() string { + return TypeCallProblemPixelatedVideo +} + +func (*CallProblemPixelatedVideo) CallProblemType() string { + return TypeCallProblemPixelatedVideo +} + // Describes a call type Call struct { meta @@ -15190,6 +16940,8 @@ type Call struct { UserId int32 `json:"user_id"` // True, if the call is outgoing IsOutgoing bool `json:"is_outgoing"` + // True, if the call is a video call + IsVideo bool `json:"is_video"` // Call state State CallState `json:"state"` } @@ -15215,6 +16967,7 @@ func (call *Call) UnmarshalJSON(data []byte) error { Id int32 `json:"id"` UserId int32 `json:"user_id"` IsOutgoing bool `json:"is_outgoing"` + IsVideo bool `json:"is_video"` State json.RawMessage `json:"state"` } @@ -15226,6 +16979,7 @@ func (call *Call) UnmarshalJSON(data []byte) error { call.Id = tmp.Id call.UserId = tmp.UserId call.IsOutgoing = tmp.IsOutgoing + call.IsVideo = tmp.IsVideo fieldState, _ := UnmarshalCallState(tmp.State) call.State = fieldState @@ -15240,7 +16994,7 @@ type PhoneNumberAuthenticationSettings struct { AllowFlashCall bool `json:"allow_flash_call"` // Pass true if the authenticated phone number is used on the current device IsCurrentPhoneNumber bool `json:"is_current_phone_number"` - // For official applications only. True, if the app 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 + // 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"` } @@ -15283,6 +17037,68 @@ func (*Animations) GetType() string { return TypeAnimations } +// A regular animated sticker +type DiceStickersRegular struct { + meta + // The animated sticker with the dice animation + Sticker *Sticker `json:"sticker"` +} + +func (entity *DiceStickersRegular) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DiceStickersRegular + + return json.Marshal((*stub)(entity)) +} + +func (*DiceStickersRegular) GetClass() string { + return ClassDiceStickers +} + +func (*DiceStickersRegular) GetType() string { + return TypeDiceStickersRegular +} + +func (*DiceStickersRegular) DiceStickersType() string { + return TypeDiceStickersRegular +} + +// Animated stickers to be combined into a slot machine +type DiceStickersSlotMachine struct { + meta + // The animated sticker with the slot machine background. The background animation must start playing after all reel animations finish + Background *Sticker `json:"background"` + // The animated sticker with the lever animation. The lever animation must play once in the initial dice state + Lever *Sticker `json:"lever"` + // The animated sticker with the left reel + LeftReel *Sticker `json:"left_reel"` + // The animated sticker with the center reel + CenterReel *Sticker `json:"center_reel"` + // The animated sticker with the right reel + RightReel *Sticker `json:"right_reel"` +} + +func (entity *DiceStickersSlotMachine) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DiceStickersSlotMachine + + return json.Marshal((*stub)(entity)) +} + +func (*DiceStickersSlotMachine) GetClass() string { + return ClassDiceStickers +} + +func (*DiceStickersSlotMachine) GetType() string { + return TypeDiceStickersSlotMachine +} + +func (*DiceStickersSlotMachine) DiceStickersType() string { + return TypeDiceStickersSlotMachine +} + // Represents the result of an ImportContacts request type ImportedContacts struct { meta @@ -15331,136 +17147,64 @@ func (*HttpUrl) GetType() string { return TypeHttpUrl } -// Represents a link to an animated GIF -type InputInlineQueryResultAnimatedGif struct { +// Represents a link to an animated GIF or an animated (i.e. without sound) H.264/MPEG-4 AVC video +type InputInlineQueryResultAnimation struct { meta // Unique identifier of the query result Id string `json:"id"` // Title of the query result Title string `json:"title"` - // URL of the static result thumbnail (JPEG or GIF), if it exists + // URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists ThumbnailUrl string `json:"thumbnail_url"` - // The URL of the GIF-file (file size must not exceed 1MB) - GifUrl string `json:"gif_url"` - // Duration of the GIF, in seconds - GifDuration int32 `json:"gif_duration"` - // Width of the GIF - GifWidth int32 `json:"gif_width"` - // Height of the GIF - GifHeight int32 `json:"gif_height"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null - ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageAnimation, InputMessageLocation, InputMessageVenue or InputMessageContact - InputMessageContent InputMessageContent `json:"input_message_content"` -} - -func (entity *InputInlineQueryResultAnimatedGif) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultAnimatedGif - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultAnimatedGif) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultAnimatedGif) GetType() string { - return TypeInputInlineQueryResultAnimatedGif -} - -func (*InputInlineQueryResultAnimatedGif) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultAnimatedGif -} - -func (inputInlineQueryResultAnimatedGif *InputInlineQueryResultAnimatedGif) UnmarshalJSON(data []byte) error { - var tmp struct { - Id string `json:"id"` - Title string `json:"title"` - ThumbnailUrl string `json:"thumbnail_url"` - GifUrl string `json:"gif_url"` - GifDuration int32 `json:"gif_duration"` - GifWidth int32 `json:"gif_width"` - GifHeight int32 `json:"gif_height"` - ReplyMarkup json.RawMessage `json:"reply_markup"` - InputMessageContent json.RawMessage `json:"input_message_content"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputInlineQueryResultAnimatedGif.Id = tmp.Id - inputInlineQueryResultAnimatedGif.Title = tmp.Title - inputInlineQueryResultAnimatedGif.ThumbnailUrl = tmp.ThumbnailUrl - inputInlineQueryResultAnimatedGif.GifUrl = tmp.GifUrl - inputInlineQueryResultAnimatedGif.GifDuration = tmp.GifDuration - inputInlineQueryResultAnimatedGif.GifWidth = tmp.GifWidth - inputInlineQueryResultAnimatedGif.GifHeight = tmp.GifHeight - - fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) - inputInlineQueryResultAnimatedGif.ReplyMarkup = fieldReplyMarkup - - fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) - inputInlineQueryResultAnimatedGif.InputMessageContent = fieldInputMessageContent - - return nil -} - -// Represents a link to an animated (i.e. without sound) H.264/MPEG-4 AVC video -type InputInlineQueryResultAnimatedMpeg4 struct { - meta - // Unique identifier of the query result - Id string `json:"id"` - // Title of the result - Title string `json:"title"` - // URL of the static result thumbnail (JPEG or GIF), if it exists - ThumbnailUrl string `json:"thumbnail_url"` - // The URL of the MPEG4-file (file size must not exceed 1MB) - Mpeg4Url string `json:"mpeg4_url"` + // MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4" + ThumbnailMimeType string `json:"thumbnail_mime_type"` + // The URL of the video file (file size must not exceed 1MB) + VideoUrl string `json:"video_url"` + // MIME type of the video file. Must be one of "image/gif" and "video/mp4" + VideoMimeType string `json:"video_mime_type"` // Duration of the video, in seconds - Mpeg4Duration int32 `json:"mpeg4_duration"` + VideoDuration int32 `json:"video_duration"` // Width of the video - Mpeg4Width int32 `json:"mpeg4_width"` + VideoWidth int32 `json:"video_width"` // Height of the video - Mpeg4Height int32 `json:"mpeg4_height"` + VideoHeight int32 `json:"video_height"` // The message reply markup. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageAnimation, InputMessageLocation, InputMessageVenue or InputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } -func (entity *InputInlineQueryResultAnimatedMpeg4) MarshalJSON() ([]byte, error) { +func (entity *InputInlineQueryResultAnimation) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InputInlineQueryResultAnimatedMpeg4 + type stub InputInlineQueryResultAnimation return json.Marshal((*stub)(entity)) } -func (*InputInlineQueryResultAnimatedMpeg4) GetClass() string { +func (*InputInlineQueryResultAnimation) GetClass() string { return ClassInputInlineQueryResult } -func (*InputInlineQueryResultAnimatedMpeg4) GetType() string { - return TypeInputInlineQueryResultAnimatedMpeg4 +func (*InputInlineQueryResultAnimation) GetType() string { + return TypeInputInlineQueryResultAnimation } -func (*InputInlineQueryResultAnimatedMpeg4) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultAnimatedMpeg4 +func (*InputInlineQueryResultAnimation) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultAnimation } -func (inputInlineQueryResultAnimatedMpeg4 *InputInlineQueryResultAnimatedMpeg4) UnmarshalJSON(data []byte) error { +func (inputInlineQueryResultAnimation *InputInlineQueryResultAnimation) UnmarshalJSON(data []byte) error { var tmp struct { Id string `json:"id"` Title string `json:"title"` ThumbnailUrl string `json:"thumbnail_url"` - Mpeg4Url string `json:"mpeg4_url"` - Mpeg4Duration int32 `json:"mpeg4_duration"` - Mpeg4Width int32 `json:"mpeg4_width"` - Mpeg4Height int32 `json:"mpeg4_height"` + ThumbnailMimeType string `json:"thumbnail_mime_type"` + VideoUrl string `json:"video_url"` + VideoMimeType string `json:"video_mime_type"` + VideoDuration int32 `json:"video_duration"` + VideoWidth int32 `json:"video_width"` + VideoHeight int32 `json:"video_height"` ReplyMarkup json.RawMessage `json:"reply_markup"` InputMessageContent json.RawMessage `json:"input_message_content"` } @@ -15470,19 +17214,21 @@ func (inputInlineQueryResultAnimatedMpeg4 *InputInlineQueryResultAnimatedMpeg4) return err } - inputInlineQueryResultAnimatedMpeg4.Id = tmp.Id - inputInlineQueryResultAnimatedMpeg4.Title = tmp.Title - inputInlineQueryResultAnimatedMpeg4.ThumbnailUrl = tmp.ThumbnailUrl - inputInlineQueryResultAnimatedMpeg4.Mpeg4Url = tmp.Mpeg4Url - inputInlineQueryResultAnimatedMpeg4.Mpeg4Duration = tmp.Mpeg4Duration - inputInlineQueryResultAnimatedMpeg4.Mpeg4Width = tmp.Mpeg4Width - inputInlineQueryResultAnimatedMpeg4.Mpeg4Height = tmp.Mpeg4Height + inputInlineQueryResultAnimation.Id = tmp.Id + inputInlineQueryResultAnimation.Title = tmp.Title + inputInlineQueryResultAnimation.ThumbnailUrl = tmp.ThumbnailUrl + inputInlineQueryResultAnimation.ThumbnailMimeType = tmp.ThumbnailMimeType + inputInlineQueryResultAnimation.VideoUrl = tmp.VideoUrl + inputInlineQueryResultAnimation.VideoMimeType = tmp.VideoMimeType + inputInlineQueryResultAnimation.VideoDuration = tmp.VideoDuration + inputInlineQueryResultAnimation.VideoWidth = tmp.VideoWidth + inputInlineQueryResultAnimation.VideoHeight = tmp.VideoHeight fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) - inputInlineQueryResultAnimatedMpeg4.ReplyMarkup = fieldReplyMarkup + inputInlineQueryResultAnimation.ReplyMarkup = fieldReplyMarkup fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) - inputInlineQueryResultAnimatedMpeg4.InputMessageContent = fieldInputMessageContent + inputInlineQueryResultAnimation.InputMessageContent = fieldInputMessageContent return nil } @@ -16304,8 +18050,8 @@ type InlineQueryResultArticle struct { Title string `json:"title"` // A short description of the result Description string `json:"description"` - // Result thumbnail; may be null - Thumbnail *PhotoSize `json:"thumbnail"` + // Result thumbnail in JPEG format; may be null + Thumbnail *Thumbnail `json:"thumbnail"` } func (entity *InlineQueryResultArticle) MarshalJSON() ([]byte, error) { @@ -16335,8 +18081,8 @@ type InlineQueryResultContact struct { Id string `json:"id"` // A user contact Contact *Contact `json:"contact"` - // Result thumbnail; may be null - Thumbnail *PhotoSize `json:"thumbnail"` + // Result thumbnail in JPEG format; may be null + Thumbnail *Thumbnail `json:"thumbnail"` } func (entity *InlineQueryResultContact) MarshalJSON() ([]byte, error) { @@ -16368,8 +18114,8 @@ type InlineQueryResultLocation struct { Location *Location `json:"location"` // Title of the result Title string `json:"title"` - // Result thumbnail; may be null - Thumbnail *PhotoSize `json:"thumbnail"` + // Result thumbnail in JPEG format; may be null + Thumbnail *Thumbnail `json:"thumbnail"` } func (entity *InlineQueryResultLocation) MarshalJSON() ([]byte, error) { @@ -16399,8 +18145,8 @@ type InlineQueryResultVenue struct { Id string `json:"id"` // Venue result Venue *Venue `json:"venue"` - // Result thumbnail; may be null - Thumbnail *PhotoSize `json:"thumbnail"` + // Result thumbnail in JPEG format; may be null + Thumbnail *Thumbnail `json:"thumbnail"` } func (entity *InlineQueryResultVenue) MarshalJSON() ([]byte, error) { @@ -16702,7 +18448,7 @@ func (*InlineQueryResults) GetType() string { return TypeInlineQueryResults } -// The payload from a general callback button +// The payload for a general callback button type CallbackQueryPayloadData struct { meta // Data that was attached to the callback button @@ -16729,7 +18475,36 @@ func (*CallbackQueryPayloadData) CallbackQueryPayloadType() string { return TypeCallbackQueryPayloadData } -// The payload from a game callback button +// The payload for a callback button requiring password +type CallbackQueryPayloadDataWithPassword struct { + meta + // The password for the current user + Password string `json:"password"` + // Data that was attached to the callback button + Data []byte `json:"data"` +} + +func (entity *CallbackQueryPayloadDataWithPassword) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallbackQueryPayloadDataWithPassword + + return json.Marshal((*stub)(entity)) +} + +func (*CallbackQueryPayloadDataWithPassword) GetClass() string { + return ClassCallbackQueryPayload +} + +func (*CallbackQueryPayloadDataWithPassword) GetType() string { + return TypeCallbackQueryPayloadDataWithPassword +} + +func (*CallbackQueryPayloadDataWithPassword) CallbackQueryPayloadType() string { + return TypeCallbackQueryPayloadDataWithPassword +} + +// The payload for a game callback button type CallbackQueryPayloadGame struct { meta // A short name of the game that was attached to the callback button @@ -16969,6 +18744,8 @@ func (*ChatEventMessagePinned) ChatEventActionType() string { // A message was unpinned type ChatEventMessageUnpinned struct { meta + // Unpinned message + Message *Message `json:"message"` } func (entity *ChatEventMessageUnpinned) MarshalJSON() ([]byte, error) { @@ -17317,9 +19094,9 @@ func (*ChatEventUsernameChanged) ChatEventActionType() string { type ChatEventPhotoChanged struct { meta // Previous chat photo value; may be null - OldPhoto *Photo `json:"old_photo"` + OldPhoto *ChatPhoto `json:"old_photo"` // New chat photo value; may be null - NewPhoto *Photo `json:"new_photo"` + NewPhoto *ChatPhoto `json:"new_photo"` } func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { @@ -19528,6 +21305,10 @@ type PushMessageContentMediaAlbum struct { HasPhotos bool `json:"has_photos"` // True, if the album has at least one video HasVideos bool `json:"has_videos"` + // True, if the album has at least one audio file + HasAudios bool `json:"has_audios"` + // True, if the album has at least one document + HasDocuments bool `json:"has_documents"` } func (entity *PushMessageContentMediaAlbum) MarshalJSON() ([]byte, error) { @@ -19632,10 +21413,14 @@ func (*NotificationTypeNewCall) NotificationTypeType() string { // New message was received through a push notification type NotificationTypeNewPushMessage struct { meta - // The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages and as reply_to_message_id + // The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id MessageId int64 `json:"message_id"` - // Sender of the message. Corresponding user may be inaccessible - SenderUserId int32 `json:"sender_user_id"` + // The sender of the message. Corresponding user or chat may be inaccessible + Sender MessageSender `json:"sender"` + // Name of the sender + SenderName string `json:"sender_name"` + // True, if the message is outgoing + IsOutgoing bool `json:"is_outgoing"` // Push message content Content PushMessageContent `json:"content"` } @@ -19662,9 +21447,11 @@ func (*NotificationTypeNewPushMessage) NotificationTypeType() string { func (notificationTypeNewPushMessage *NotificationTypeNewPushMessage) UnmarshalJSON(data []byte) error { var tmp struct { - MessageId int64 `json:"message_id"` - SenderUserId int32 `json:"sender_user_id"` - Content json.RawMessage `json:"content"` + MessageId int64 `json:"message_id"` + Sender json.RawMessage `json:"sender"` + SenderName string `json:"sender_name"` + IsOutgoing bool `json:"is_outgoing"` + Content json.RawMessage `json:"content"` } err := json.Unmarshal(data, &tmp) @@ -19673,7 +21460,11 @@ func (notificationTypeNewPushMessage *NotificationTypeNewPushMessage) UnmarshalJ } notificationTypeNewPushMessage.MessageId = tmp.MessageId - notificationTypeNewPushMessage.SenderUserId = tmp.SenderUserId + notificationTypeNewPushMessage.SenderName = tmp.SenderName + notificationTypeNewPushMessage.IsOutgoing = tmp.IsOutgoing + + fieldSender, _ := UnmarshalMessageSender(tmp.Sender) + notificationTypeNewPushMessage.Sender = fieldSender fieldContent, _ := UnmarshalPushMessageContent(tmp.Content) notificationTypeNewPushMessage.Content = fieldContent @@ -19945,7 +21736,7 @@ func (*OptionValueEmpty) OptionValueType() string { type OptionValueInteger struct { meta // The value of the option - Value int32 `json:"value"` + Value JsonInt64 `json:"value"` } func (entity *OptionValueInteger) MarshalJSON() ([]byte, error) { @@ -20966,29 +22757,29 @@ func (*ChatReportReasonCustom) ChatReportReasonType() string { return TypeChatReportReasonCustom } -// Contains a public HTTPS link to a message in a supergroup or channel with a username -type PublicMessageLink struct { +// Contains an HTTPS link to a message in a supergroup or channel +type MessageLink struct { meta // Message link Link string `json:"link"` - // HTML-code for embedding the message - Html string `json:"html"` + // True, if the link will work for non-members of the chat + IsPublic bool `json:"is_public"` } -func (entity *PublicMessageLink) MarshalJSON() ([]byte, error) { +func (entity *MessageLink) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub PublicMessageLink + type stub MessageLink return json.Marshal((*stub)(entity)) } -func (*PublicMessageLink) GetClass() string { - return ClassPublicMessageLink +func (*MessageLink) GetClass() string { + return ClassMessageLink } -func (*PublicMessageLink) GetType() string { - return TypePublicMessageLink +func (*MessageLink) GetType() string { + return TypeMessageLink } // Contains information about a link to a message in a chat @@ -21002,6 +22793,8 @@ type MessageLinkInfo struct { Message *Message `json:"message"` // 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) { @@ -21843,7 +23636,7 @@ func (networkStatisticsEntryCall *NetworkStatisticsEntryCall) UnmarshalJSON(data // A full list of available network statistic entries type NetworkStatistics struct { meta - // Point in time (Unix timestamp) when the app began collecting statistics + // Point in time (Unix timestamp) from which the statistics are collected SinceDate int32 `json:"since_date"` // Network statistics entries Entries []NetworkStatisticsEntry `json:"entries"` @@ -21878,7 +23671,7 @@ type AutoDownloadSettings struct { MaxOtherFileSize int32 `json:"max_other_file_size"` // The maximum suggested bitrate for uploaded videos VideoUploadBitrate int32 `json:"video_upload_bitrate"` - // True, if the beginning of videos needs to be preloaded for instant playback + // True, if the beginning of video files needs to be preloaded for instant playback PreloadLargeVideos bool `json:"preload_large_videos"` // True, if the next audio track needs to be preloaded while the user is listening to an audio file PreloadNextAudio bool `json:"preload_next_audio"` @@ -22004,7 +23797,7 @@ func (*ConnectionStateConnecting) ConnectionStateType() string { return TypeConnectionStateConnecting } -// Downloading data received while the client was offline +// Downloading data received while the application was offline type ConnectionStateUpdating struct { meta } @@ -22404,6 +24197,56 @@ func (*TMeUrls) GetType() string { return TypeTMeUrls } +// Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option +type SuggestedActionEnableArchiveAndMuteNewChats struct { + meta +} + +func (entity *SuggestedActionEnableArchiveAndMuteNewChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionEnableArchiveAndMuteNewChats + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionEnableArchiveAndMuteNewChats) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionEnableArchiveAndMuteNewChats) GetType() string { + return TypeSuggestedActionEnableArchiveAndMuteNewChats +} + +func (*SuggestedActionEnableArchiveAndMuteNewChats) SuggestedActionType() string { + return TypeSuggestedActionEnableArchiveAndMuteNewChats +} + +// Suggests the user to check authorization phone number and change the phone number if it is inaccessible +type SuggestedActionCheckPhoneNumber struct { + meta +} + +func (entity *SuggestedActionCheckPhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionCheckPhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionCheckPhoneNumber) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionCheckPhoneNumber) GetType() string { + return TypeSuggestedActionCheckPhoneNumber +} + +func (*SuggestedActionCheckPhoneNumber) SuggestedActionType() string { + return TypeSuggestedActionCheckPhoneNumber +} + // Contains a counter type Count struct { meta @@ -22498,10 +24341,10 @@ func (*DeepLinkInfo) GetType() string { return TypeDeepLinkInfo } -// The text should be parsed in markdown-style +// The text uses Markdown-style formatting type TextParseModeMarkdown struct { meta - // Version of the parser: 0 or 1 - Bot API Markdown parse mode, 2 - Bot API MarkdownV2 parse mode + // Version of the parser: 0 or 1 - Telegram Bot API "Markdown" parse mode, 2 - Telegram Bot API "MarkdownV2" parse mode Version int32 `json:"version"` } @@ -22525,7 +24368,7 @@ func (*TextParseModeMarkdown) TextParseModeType() string { return TypeTextParseModeMarkdown } -// The text should be parsed in HTML-style +// The text uses HTML-style formatting. The same as Telegram Bot API "HTML" parse mode type TextParseModeHTML struct { meta } @@ -22586,7 +24429,7 @@ type ProxyTypeHttp struct { Username string `json:"username"` // Password for logging in; may be empty Password string `json:"password"` - // Pass true, if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method + // Pass true if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method HttpOnly bool `json:"http_only"` } @@ -22720,36 +24563,40 @@ func (*Proxies) GetType() string { return TypeProxies } -// Describes a sticker that should 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 - // PNG image with the sticker; must be up to 512 kB in size and fit in a 512x512 square - PngSticker InputFile `json:"png_sticker"` - // Emoji corresponding to the sticker + // 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"` // For masks, position where the mask should be placed; may be null 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 { - PngSticker json.RawMessage `json:"png_sticker"` + Sticker json.RawMessage `json:"sticker"` Emojis string `json:"emojis"` MaskPosition *MaskPosition `json:"mask_position"` } @@ -22759,11 +24606,575 @@ func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { return err } - inputSticker.Emojis = tmp.Emojis - inputSticker.MaskPosition = tmp.MaskPosition + inputStickerStatic.Emojis = tmp.Emojis + inputStickerStatic.MaskPosition = tmp.MaskPosition - fieldPngSticker, _ := UnmarshalInputFile(tmp.PngSticker) - inputSticker.PngSticker = fieldPngSticker + 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 { + 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 +} + +// Represents a date range +type DateRange struct { + meta + // Point in time (Unix timestamp) at which the date range begins + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) at which the date range ends + EndDate int32 `json:"end_date"` +} + +func (entity *DateRange) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DateRange + + return json.Marshal((*stub)(entity)) +} + +func (*DateRange) GetClass() string { + return ClassDateRange +} + +func (*DateRange) GetType() string { + return TypeDateRange +} + +// A value with information about its recent changes +type StatisticalValue struct { + meta + // The current value + Value float64 `json:"value"` + // The value for the previous day + PreviousValue float64 `json:"previous_value"` + // The growth rate of the value, as a percentage + GrowthRatePercentage float64 `json:"growth_rate_percentage"` +} + +func (entity *StatisticalValue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StatisticalValue + + return json.Marshal((*stub)(entity)) +} + +func (*StatisticalValue) GetClass() string { + return ClassStatisticalValue +} + +func (*StatisticalValue) GetType() string { + return TypeStatisticalValue +} + +// A graph data +type StatisticalGraphData struct { + meta + // Graph data in JSON format + JsonData string `json:"json_data"` + // If non-empty, a token which can be used to receive a zoomed in graph + ZoomToken string `json:"zoom_token"` +} + +func (entity *StatisticalGraphData) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StatisticalGraphData + + return json.Marshal((*stub)(entity)) +} + +func (*StatisticalGraphData) GetClass() string { + return ClassStatisticalGraph +} + +func (*StatisticalGraphData) GetType() string { + return TypeStatisticalGraphData +} + +func (*StatisticalGraphData) StatisticalGraphType() string { + return TypeStatisticalGraphData +} + +// The graph data to be asynchronously loaded through getStatisticalGraph +type StatisticalGraphAsync struct { + meta + // The token to use for data loading + Token string `json:"token"` +} + +func (entity *StatisticalGraphAsync) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StatisticalGraphAsync + + return json.Marshal((*stub)(entity)) +} + +func (*StatisticalGraphAsync) GetClass() string { + return ClassStatisticalGraph +} + +func (*StatisticalGraphAsync) GetType() string { + return TypeStatisticalGraphAsync +} + +func (*StatisticalGraphAsync) StatisticalGraphType() string { + return TypeStatisticalGraphAsync +} + +// An error message to be shown to the user instead of the graph +type StatisticalGraphError struct { + meta + // The error message + ErrorMessage string `json:"error_message"` +} + +func (entity *StatisticalGraphError) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StatisticalGraphError + + return json.Marshal((*stub)(entity)) +} + +func (*StatisticalGraphError) GetClass() string { + return ClassStatisticalGraph +} + +func (*StatisticalGraphError) GetType() string { + return TypeStatisticalGraphError +} + +func (*StatisticalGraphError) StatisticalGraphType() string { + return TypeStatisticalGraphError +} + +// Contains statistics about interactions with a message +type ChatStatisticsMessageInteractionInfo struct { + meta + // Message identifier + MessageId int64 `json:"message_id"` + // Number of times the message was viewed + ViewCount int32 `json:"view_count"` + // Number of times the message was forwarded + ForwardCount int32 `json:"forward_count"` +} + +func (entity *ChatStatisticsMessageInteractionInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatStatisticsMessageInteractionInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatStatisticsMessageInteractionInfo) GetClass() string { + return ClassChatStatisticsMessageInteractionInfo +} + +func (*ChatStatisticsMessageInteractionInfo) GetType() string { + return TypeChatStatisticsMessageInteractionInfo +} + +// Contains statistics about messages sent by a user +type ChatStatisticsMessageSenderInfo struct { + meta + // User identifier + UserId int32 `json:"user_id"` + // Number of sent messages + SentMessageCount int32 `json:"sent_message_count"` + // Average number of characters in sent messages + AverageCharacterCount int32 `json:"average_character_count"` +} + +func (entity *ChatStatisticsMessageSenderInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatStatisticsMessageSenderInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatStatisticsMessageSenderInfo) GetClass() string { + return ClassChatStatisticsMessageSenderInfo +} + +func (*ChatStatisticsMessageSenderInfo) GetType() string { + return TypeChatStatisticsMessageSenderInfo +} + +// Contains statistics about administrator actions done by a user +type ChatStatisticsAdministratorActionsInfo struct { + meta + // Administrator user identifier + UserId int32 `json:"user_id"` + // Number of messages deleted by the administrator + DeletedMessageCount int32 `json:"deleted_message_count"` + // Number of users banned by the administrator + BannedUserCount int32 `json:"banned_user_count"` + // Number of users restricted by the administrator + RestrictedUserCount int32 `json:"restricted_user_count"` +} + +func (entity *ChatStatisticsAdministratorActionsInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatStatisticsAdministratorActionsInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatStatisticsAdministratorActionsInfo) GetClass() string { + return ClassChatStatisticsAdministratorActionsInfo +} + +func (*ChatStatisticsAdministratorActionsInfo) GetType() string { + return TypeChatStatisticsAdministratorActionsInfo +} + +// Contains statistics about number of new members invited by a user +type ChatStatisticsInviterInfo struct { + meta + // User identifier + UserId int32 `json:"user_id"` + // Number of new members invited by the user + AddedMemberCount int32 `json:"added_member_count"` +} + +func (entity *ChatStatisticsInviterInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatStatisticsInviterInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatStatisticsInviterInfo) GetClass() string { + return ClassChatStatisticsInviterInfo +} + +func (*ChatStatisticsInviterInfo) GetType() string { + return TypeChatStatisticsInviterInfo +} + +// A detailed statistics about a supergroup chat +type ChatStatisticsSupergroup struct { + meta + // A period to which the statistics applies + Period *DateRange `json:"period"` + // Number of members in the chat + MemberCount *StatisticalValue `json:"member_count"` + // Number of messages sent to the chat + MessageCount *StatisticalValue `json:"message_count"` + // Number of users who viewed messages in the chat + ViewerCount *StatisticalValue `json:"viewer_count"` + // Number of users who sent messages to the chat + SenderCount *StatisticalValue `json:"sender_count"` + // A graph containing number of members in the chat + MemberCountGraph StatisticalGraph `json:"member_count_graph"` + // A graph containing number of members joined and left the chat + JoinGraph StatisticalGraph `json:"join_graph"` + // A graph containing number of new member joins per source + JoinBySourceGraph StatisticalGraph `json:"join_by_source_graph"` + // A graph containing distribution of active users per language + LanguageGraph StatisticalGraph `json:"language_graph"` + // A graph containing distribution of sent messages by content type + MessageContentGraph StatisticalGraph `json:"message_content_graph"` + // A graph containing number of different actions in the chat + ActionGraph StatisticalGraph `json:"action_graph"` + // A graph containing distribution of message views per hour + DayGraph StatisticalGraph `json:"day_graph"` + // A graph containing distribution of message views per day of week + WeekGraph StatisticalGraph `json:"week_graph"` + // List of users sent most messages in the last week + TopSenders []*ChatStatisticsMessageSenderInfo `json:"top_senders"` + // List of most active administrators in the last week + TopAdministrators []*ChatStatisticsAdministratorActionsInfo `json:"top_administrators"` + // List of most active inviters of new members in the last week + TopInviters []*ChatStatisticsInviterInfo `json:"top_inviters"` +} + +func (entity *ChatStatisticsSupergroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatStatisticsSupergroup + + return json.Marshal((*stub)(entity)) +} + +func (*ChatStatisticsSupergroup) GetClass() string { + return ClassChatStatistics +} + +func (*ChatStatisticsSupergroup) GetType() string { + return TypeChatStatisticsSupergroup +} + +func (*ChatStatisticsSupergroup) ChatStatisticsType() string { + return TypeChatStatisticsSupergroup +} + +func (chatStatisticsSupergroup *ChatStatisticsSupergroup) UnmarshalJSON(data []byte) error { + var tmp struct { + Period *DateRange `json:"period"` + MemberCount *StatisticalValue `json:"member_count"` + MessageCount *StatisticalValue `json:"message_count"` + ViewerCount *StatisticalValue `json:"viewer_count"` + SenderCount *StatisticalValue `json:"sender_count"` + MemberCountGraph json.RawMessage `json:"member_count_graph"` + JoinGraph json.RawMessage `json:"join_graph"` + JoinBySourceGraph json.RawMessage `json:"join_by_source_graph"` + LanguageGraph json.RawMessage `json:"language_graph"` + MessageContentGraph json.RawMessage `json:"message_content_graph"` + ActionGraph json.RawMessage `json:"action_graph"` + DayGraph json.RawMessage `json:"day_graph"` + WeekGraph json.RawMessage `json:"week_graph"` + TopSenders []*ChatStatisticsMessageSenderInfo `json:"top_senders"` + TopAdministrators []*ChatStatisticsAdministratorActionsInfo `json:"top_administrators"` + TopInviters []*ChatStatisticsInviterInfo `json:"top_inviters"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatStatisticsSupergroup.Period = tmp.Period + chatStatisticsSupergroup.MemberCount = tmp.MemberCount + chatStatisticsSupergroup.MessageCount = tmp.MessageCount + chatStatisticsSupergroup.ViewerCount = tmp.ViewerCount + chatStatisticsSupergroup.SenderCount = tmp.SenderCount + chatStatisticsSupergroup.TopSenders = tmp.TopSenders + chatStatisticsSupergroup.TopAdministrators = tmp.TopAdministrators + chatStatisticsSupergroup.TopInviters = tmp.TopInviters + + fieldMemberCountGraph, _ := UnmarshalStatisticalGraph(tmp.MemberCountGraph) + chatStatisticsSupergroup.MemberCountGraph = fieldMemberCountGraph + + fieldJoinGraph, _ := UnmarshalStatisticalGraph(tmp.JoinGraph) + chatStatisticsSupergroup.JoinGraph = fieldJoinGraph + + fieldJoinBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.JoinBySourceGraph) + chatStatisticsSupergroup.JoinBySourceGraph = fieldJoinBySourceGraph + + fieldLanguageGraph, _ := UnmarshalStatisticalGraph(tmp.LanguageGraph) + chatStatisticsSupergroup.LanguageGraph = fieldLanguageGraph + + fieldMessageContentGraph, _ := UnmarshalStatisticalGraph(tmp.MessageContentGraph) + chatStatisticsSupergroup.MessageContentGraph = fieldMessageContentGraph + + fieldActionGraph, _ := UnmarshalStatisticalGraph(tmp.ActionGraph) + chatStatisticsSupergroup.ActionGraph = fieldActionGraph + + fieldDayGraph, _ := UnmarshalStatisticalGraph(tmp.DayGraph) + chatStatisticsSupergroup.DayGraph = fieldDayGraph + + fieldWeekGraph, _ := UnmarshalStatisticalGraph(tmp.WeekGraph) + chatStatisticsSupergroup.WeekGraph = fieldWeekGraph + + return nil +} + +// A detailed statistics about a channel chat +type ChatStatisticsChannel struct { + meta + // A period to which the statistics applies + Period *DateRange `json:"period"` + // Number of members in the chat + MemberCount *StatisticalValue `json:"member_count"` + // Mean number of times the recently sent messages was viewed + MeanViewCount *StatisticalValue `json:"mean_view_count"` + // Mean number of times the recently sent messages was shared + MeanShareCount *StatisticalValue `json:"mean_share_count"` + // A percentage of users with enabled notifications for the chat + EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"` + // A graph containing number of members in the chat + MemberCountGraph StatisticalGraph `json:"member_count_graph"` + // A graph containing number of members joined and left the chat + JoinGraph StatisticalGraph `json:"join_graph"` + // A graph containing number of members muted and unmuted the chat + MuteGraph StatisticalGraph `json:"mute_graph"` + // A graph containing number of message views in a given hour in the last two weeks + ViewCountByHourGraph StatisticalGraph `json:"view_count_by_hour_graph"` + // A graph containing number of message views per source + ViewCountBySourceGraph StatisticalGraph `json:"view_count_by_source_graph"` + // A graph containing number of new member joins per source + JoinBySourceGraph StatisticalGraph `json:"join_by_source_graph"` + // A graph containing number of users viewed chat messages per language + LanguageGraph StatisticalGraph `json:"language_graph"` + // A graph containing number of chat message views and shares + MessageInteractionGraph StatisticalGraph `json:"message_interaction_graph"` + // A graph containing number of views of associated with the chat instant views + InstantViewInteractionGraph StatisticalGraph `json:"instant_view_interaction_graph"` + // Detailed statistics about number of views and shares of recently sent messages + RecentMessageInteractions []*ChatStatisticsMessageInteractionInfo `json:"recent_message_interactions"` +} + +func (entity *ChatStatisticsChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatStatisticsChannel + + return json.Marshal((*stub)(entity)) +} + +func (*ChatStatisticsChannel) GetClass() string { + return ClassChatStatistics +} + +func (*ChatStatisticsChannel) GetType() string { + return TypeChatStatisticsChannel +} + +func (*ChatStatisticsChannel) ChatStatisticsType() string { + return TypeChatStatisticsChannel +} + +func (chatStatisticsChannel *ChatStatisticsChannel) UnmarshalJSON(data []byte) error { + var tmp struct { + Period *DateRange `json:"period"` + MemberCount *StatisticalValue `json:"member_count"` + MeanViewCount *StatisticalValue `json:"mean_view_count"` + MeanShareCount *StatisticalValue `json:"mean_share_count"` + EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"` + MemberCountGraph json.RawMessage `json:"member_count_graph"` + JoinGraph json.RawMessage `json:"join_graph"` + MuteGraph json.RawMessage `json:"mute_graph"` + ViewCountByHourGraph json.RawMessage `json:"view_count_by_hour_graph"` + ViewCountBySourceGraph json.RawMessage `json:"view_count_by_source_graph"` + JoinBySourceGraph json.RawMessage `json:"join_by_source_graph"` + LanguageGraph json.RawMessage `json:"language_graph"` + MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"` + InstantViewInteractionGraph json.RawMessage `json:"instant_view_interaction_graph"` + RecentMessageInteractions []*ChatStatisticsMessageInteractionInfo `json:"recent_message_interactions"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatStatisticsChannel.Period = tmp.Period + chatStatisticsChannel.MemberCount = tmp.MemberCount + chatStatisticsChannel.MeanViewCount = tmp.MeanViewCount + chatStatisticsChannel.MeanShareCount = tmp.MeanShareCount + chatStatisticsChannel.EnabledNotificationsPercentage = tmp.EnabledNotificationsPercentage + chatStatisticsChannel.RecentMessageInteractions = tmp.RecentMessageInteractions + + fieldMemberCountGraph, _ := UnmarshalStatisticalGraph(tmp.MemberCountGraph) + chatStatisticsChannel.MemberCountGraph = fieldMemberCountGraph + + fieldJoinGraph, _ := UnmarshalStatisticalGraph(tmp.JoinGraph) + chatStatisticsChannel.JoinGraph = fieldJoinGraph + + fieldMuteGraph, _ := UnmarshalStatisticalGraph(tmp.MuteGraph) + chatStatisticsChannel.MuteGraph = fieldMuteGraph + + fieldViewCountByHourGraph, _ := UnmarshalStatisticalGraph(tmp.ViewCountByHourGraph) + chatStatisticsChannel.ViewCountByHourGraph = fieldViewCountByHourGraph + + fieldViewCountBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.ViewCountBySourceGraph) + chatStatisticsChannel.ViewCountBySourceGraph = fieldViewCountBySourceGraph + + fieldJoinBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.JoinBySourceGraph) + chatStatisticsChannel.JoinBySourceGraph = fieldJoinBySourceGraph + + fieldLanguageGraph, _ := UnmarshalStatisticalGraph(tmp.LanguageGraph) + chatStatisticsChannel.LanguageGraph = fieldLanguageGraph + + fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph) + chatStatisticsChannel.MessageInteractionGraph = fieldMessageInteractionGraph + + fieldInstantViewInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.InstantViewInteractionGraph) + chatStatisticsChannel.InstantViewInteractionGraph = fieldInstantViewInteractionGraph + + return nil +} + +// A detailed statistics about a message +type MessageStatistics struct { + meta + // A graph containing number of message views and shares + MessageInteractionGraph StatisticalGraph `json:"message_interaction_graph"` +} + +func (entity *MessageStatistics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageStatistics + + return json.Marshal((*stub)(entity)) +} + +func (*MessageStatistics) GetClass() string { + return ClassMessageStatistics +} + +func (*MessageStatistics) GetType() string { + return TypeMessageStatistics +} + +func (messageStatistics *MessageStatistics) UnmarshalJSON(data []byte) error { + var tmp struct { + MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph) + messageStatistics.MessageInteractionGraph = fieldMessageInteractionGraph return nil } @@ -23037,35 +25448,66 @@ func (updateMessageEdited *UpdateMessageEdited) UnmarshalJSON(data []byte) error return nil } -// The view count of the message has changed -type UpdateMessageViews struct { +// The message pinned state was changed +type UpdateMessageIsPinned struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The message identifier + MessageId int64 `json:"message_id"` + // True, if the message is pinned + IsPinned bool `json:"is_pinned"` +} + +func (entity *UpdateMessageIsPinned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateMessageIsPinned + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateMessageIsPinned) GetClass() string { + return ClassUpdate +} + +func (*UpdateMessageIsPinned) GetType() string { + return TypeUpdateMessageIsPinned +} + +func (*UpdateMessageIsPinned) UpdateType() string { + return TypeUpdateMessageIsPinned +} + +// The information about interactions with a message has changed +type UpdateMessageInteractionInfo struct { meta // Chat identifier ChatId int64 `json:"chat_id"` // Message identifier MessageId int64 `json:"message_id"` - // New value of the view count - Views int32 `json:"views"` + // New information about interactions with the message; may be null + InteractionInfo *MessageInteractionInfo `json:"interaction_info"` } -func (entity *UpdateMessageViews) MarshalJSON() ([]byte, error) { +func (entity *UpdateMessageInteractionInfo) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateMessageViews + type stub UpdateMessageInteractionInfo return json.Marshal((*stub)(entity)) } -func (*UpdateMessageViews) GetClass() string { +func (*UpdateMessageInteractionInfo) GetClass() string { return ClassUpdate } -func (*UpdateMessageViews) GetType() string { - return TypeUpdateMessageViews +func (*UpdateMessageInteractionInfo) GetType() string { + return TypeUpdateMessageInteractionInfo } -func (*UpdateMessageViews) UpdateType() string { - return TypeUpdateMessageViews +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 @@ -23128,7 +25570,7 @@ func (*UpdateMessageMentionRead) UpdateType() string { return TypeUpdateMessageMentionRead } -// A message with a live location was viewed. When the update is received, the client is supposed to update the live location +// 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 // Identifier of the chat with the live location message @@ -23157,7 +25599,7 @@ func (*UpdateMessageLiveLocationViewed) UpdateType() string { return TypeUpdateMessageLiveLocationViewed } -// A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the client. The chat field changes will be reported through separate updates +// A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates type UpdateNewChat struct { meta // The chat @@ -23184,54 +25626,6 @@ func (*UpdateNewChat) UpdateType() string { return TypeUpdateNewChat } -// The list to which the chat belongs was changed. This update is guaranteed to be sent only when chat.order == 0 and the current or the new chat list is null -type UpdateChatChatList struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new chat's chat list; may be null - ChatList ChatList `json:"chat_list"` -} - -func (entity *UpdateChatChatList) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatChatList - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatChatList) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatChatList) GetType() string { - return TypeUpdateChatChatList -} - -func (*UpdateChatChatList) UpdateType() string { - return TypeUpdateChatChatList -} - -func (updateChatChatList *UpdateChatChatList) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatId int64 `json:"chat_id"` - ChatList json.RawMessage `json:"chat_list"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - updateChatChatList.ChatId = tmp.ChatId - - fieldChatList, _ := UnmarshalChatList(tmp.ChatList) - updateChatChatList.ChatList = fieldChatList - - return nil -} - // The title of a chat was changed type UpdateChatTitle struct { meta @@ -23267,7 +25661,7 @@ type UpdateChatPhoto struct { // Chat identifier ChatId int64 `json:"chat_id"` // The new chat photo; may be null - Photo *ChatPhoto `json:"photo"` + Photo *ChatPhotoInfo `json:"photo"` } func (entity *UpdateChatPhoto) MarshalJSON() ([]byte, error) { @@ -23326,8 +25720,8 @@ type UpdateChatLastMessage struct { ChatId int64 `json:"chat_id"` // The new last message in the chat; may be null LastMessage *Message `json:"last_message"` - // New value of the chat order - Order JsonInt64 `json:"order"` + // The new chat positions in the chat lists + Positions []*ChatPosition `json:"positions"` } func (entity *UpdateChatLastMessage) MarshalJSON() ([]byte, error) { @@ -23350,64 +25744,33 @@ func (*UpdateChatLastMessage) UpdateType() string { return TypeUpdateChatLastMessage } -// The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned, updateChatDraftMessage, or updateChatIsSponsored might be sent -type UpdateChatOrder struct { +// The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent +type UpdateChatPosition struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // New value of the order - Order JsonInt64 `json:"order"` + // New chat position. If new order is 0, then the chat needs to be removed from the list + Position *ChatPosition `json:"position"` } -func (entity *UpdateChatOrder) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatPosition) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatOrder + type stub UpdateChatPosition return json.Marshal((*stub)(entity)) } -func (*UpdateChatOrder) GetClass() string { +func (*UpdateChatPosition) GetClass() string { return ClassUpdate } -func (*UpdateChatOrder) GetType() string { - return TypeUpdateChatOrder +func (*UpdateChatPosition) GetType() string { + return TypeUpdateChatPosition } -func (*UpdateChatOrder) UpdateType() string { - return TypeUpdateChatOrder -} - -// A chat was pinned or unpinned -type UpdateChatIsPinned struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of is_pinned - IsPinned bool `json:"is_pinned"` - // New value of the chat order - Order JsonInt64 `json:"order"` -} - -func (entity *UpdateChatIsPinned) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatIsPinned - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatIsPinned) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatIsPinned) GetType() string { - return TypeUpdateChatIsPinned -} - -func (*UpdateChatIsPinned) UpdateType() string { - return TypeUpdateChatIsPinned +func (*UpdateChatPosition) UpdateType() string { + return TypeUpdateChatPosition } // A chat was marked as unread or was read @@ -23439,35 +25802,33 @@ func (*UpdateChatIsMarkedAsUnread) UpdateType() string { return TypeUpdateChatIsMarkedAsUnread } -// A chat's is_sponsored field has changed -type UpdateChatIsSponsored struct { +// A chat was blocked or unblocked +type UpdateChatIsBlocked struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // New value of is_sponsored - IsSponsored bool `json:"is_sponsored"` - // New value of chat order - Order JsonInt64 `json:"order"` + // New value of is_blocked + IsBlocked bool `json:"is_blocked"` } -func (entity *UpdateChatIsSponsored) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatIsBlocked) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatIsSponsored + type stub UpdateChatIsBlocked return json.Marshal((*stub)(entity)) } -func (*UpdateChatIsSponsored) GetClass() string { +func (*UpdateChatIsBlocked) GetClass() string { return ClassUpdate } -func (*UpdateChatIsSponsored) GetType() string { - return TypeUpdateChatIsSponsored +func (*UpdateChatIsBlocked) GetType() string { + return TypeUpdateChatIsBlocked } -func (*UpdateChatIsSponsored) UpdateType() string { - return TypeUpdateChatIsSponsored +func (*UpdateChatIsBlocked) UpdateType() string { + return TypeUpdateChatIsBlocked } // A chat's has_scheduled_messages field has changed @@ -23742,35 +26103,6 @@ func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error return nil } -// The chat pinned message was changed -type UpdateChatPinnedMessage struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new identifier of the pinned message; 0 if there is no pinned message in the chat - PinnedMessageId int64 `json:"pinned_message_id"` -} - -func (entity *UpdateChatPinnedMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatPinnedMessage - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatPinnedMessage) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatPinnedMessage) GetType() string { - return TypeUpdateChatPinnedMessage -} - -func (*UpdateChatPinnedMessage) UpdateType() string { - return TypeUpdateChatPinnedMessage -} - // The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user type UpdateChatReplyMarkup struct { meta @@ -23807,8 +26139,8 @@ type UpdateChatDraftMessage struct { ChatId int64 `json:"chat_id"` // The new draft message; may be null DraftMessage *DraftMessage `json:"draft_message"` - // New value of the chat order - Order JsonInt64 `json:"order"` + // The new chat positions in the chat lists + Positions []*ChatPosition `json:"positions"` } func (entity *UpdateChatDraftMessage) MarshalJSON() ([]byte, error) { @@ -23831,6 +26163,33 @@ func (*UpdateChatDraftMessage) UpdateType() string { return TypeUpdateChatDraftMessage } +// The list of chat filters or a chat filter has changed +type UpdateChatFilters struct { + meta + // The new list of chat filters + ChatFilters []*ChatFilterInfo `json:"chat_filters"` +} + +func (entity *UpdateChatFilters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatFilters + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatFilters) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatFilters) GetType() string { + return TypeUpdateChatFilters +} + +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 type UpdateChatOnlineMemberCount struct { meta @@ -24055,6 +26414,8 @@ type UpdateUserChatAction struct { meta // Chat identifier ChatId int64 `json:"chat_id"` + // If not 0, a message thread identifier in which the action was performed + MessageThreadId int64 `json:"message_thread_id"` // Identifier of a user performing an action UserId int32 `json:"user_id"` // The action description @@ -24083,9 +26444,10 @@ func (*UpdateUserChatAction) UpdateType() string { func (updateUserChatAction *UpdateUserChatAction) UnmarshalJSON(data []byte) error { var tmp struct { - ChatId int64 `json:"chat_id"` - UserId int32 `json:"user_id"` - Action json.RawMessage `json:"action"` + ChatId int64 `json:"chat_id"` + MessageThreadId int64 `json:"message_thread_id"` + UserId int32 `json:"user_id"` + Action json.RawMessage `json:"action"` } err := json.Unmarshal(data, &tmp) @@ -24094,6 +26456,7 @@ func (updateUserChatAction *UpdateUserChatAction) UnmarshalJSON(data []byte) err } updateUserChatAction.ChatId = tmp.ChatId + updateUserChatAction.MessageThreadId = tmp.MessageThreadId updateUserChatAction.UserId = tmp.UserId fieldAction, _ := UnmarshalChatAction(tmp.Action) @@ -24150,7 +26513,7 @@ func (updateUserStatus *UpdateUserStatus) UnmarshalJSON(data []byte) error { return nil } -// Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the client +// Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application type UpdateUser struct { meta // New data about the user @@ -24177,7 +26540,7 @@ func (*UpdateUser) UpdateType() string { return TypeUpdateUser } -// Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the client +// Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application type UpdateBasicGroup struct { meta // New data about the group @@ -24204,7 +26567,7 @@ func (*UpdateBasicGroup) UpdateType() string { return TypeUpdateBasicGroup } -// Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the client +// Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application type UpdateSupergroup struct { meta // New data about the supergroup @@ -24231,7 +26594,7 @@ func (*UpdateSupergroup) UpdateType() string { return TypeUpdateSupergroup } -// Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the client +// Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application type UpdateSecretChat struct { meta // New data about the secret chat @@ -24345,7 +26708,7 @@ func (*UpdateSupergroupFullInfo) UpdateType() string { return TypeUpdateSupergroupFullInfo } -// Service notification from the server. Upon receiving this the client must show a popup with the content of the notification +// Service notification from the server. Upon receiving this the application must show a popup with the content of the notification type UpdateServiceNotification struct { meta // Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" should be shown under notification; if user presses the second, all local data should be destroyed using Destroy method @@ -24420,7 +26783,7 @@ func (*UpdateFile) UpdateType() string { return TypeUpdateFile } -// The file generation process needs to be started by the client +// The file generation process needs to be started by the application type UpdateFileGenerationStart struct { meta // Unique identifier for the generation process @@ -24429,7 +26792,7 @@ type UpdateFileGenerationStart struct { OriginalPath string `json:"original_path"` // The path to a file that should be created and where the new file should be generated DestinationPath string `json:"destination_path"` - // String specifying the conversion applied to the original file. If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by the client + // String specifying the conversion applied to the original file. If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by the application Conversion string `json:"conversion"` } @@ -24507,6 +26870,35 @@ func (*UpdateCall) UpdateType() string { return TypeUpdateCall } +// New call signaling data arrived +type UpdateNewCallSignalingData struct { + meta + // The call identifier + CallId int32 `json:"call_id"` + // The data + Data []byte `json:"data"` +} + +func (entity *UpdateNewCallSignalingData) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewCallSignalingData + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewCallSignalingData) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewCallSignalingData) GetType() string { + return TypeUpdateNewCallSignalingData +} + +func (*UpdateNewCallSignalingData) UpdateType() string { + return TypeUpdateNewCallSignalingData +} + // Some privacy setting rules have been changed type UpdateUserPrivacySettingRules struct { meta @@ -24719,6 +27111,33 @@ func (updateOption *UpdateOption) UnmarshalJSON(data []byte) error { return nil } +// A sticker set has changed +type UpdateStickerSet struct { + meta + // The sticker set + StickerSet *StickerSet `json:"sticker_set"` +} + +func (entity *UpdateStickerSet) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStickerSet + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStickerSet) GetClass() string { + return ClassUpdate +} + +func (*UpdateStickerSet) GetType() string { + return TypeUpdateStickerSet +} + +func (*UpdateStickerSet) UpdateType() string { + return TypeUpdateStickerSet +} + // The list of installed sticker sets was updated type UpdateInstalledStickerSets struct { meta @@ -24751,7 +27170,7 @@ func (*UpdateInstalledStickerSets) UpdateType() string { // The list of trending sticker sets was updated or some of them were viewed type UpdateTrendingStickerSets struct { meta - // The new list of trending sticker sets + // The prefix of the list of trending sticker sets with the newest trending sticker sets StickerSets *StickerSets `json:"sticker_sets"` } @@ -24918,7 +27337,7 @@ func (*UpdateLanguagePackStrings) UpdateType() string { return TypeUpdateLanguagePackStrings } -// The connection state has changed +// The connection state has changed. This update must be used only to show a human-readable description of the connection state type UpdateConnectionState struct { meta // The new connection state @@ -24990,7 +27409,7 @@ func (*UpdateTermsOfService) UpdateType() string { return TypeUpdateTermsOfService } -// List of users nearby has changed. The update is sent only 60 seconds after a successful searchChatsNearby request +// The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request type UpdateUsersNearby struct { meta // The new list of users nearby @@ -25017,6 +27436,91 @@ func (*UpdateUsersNearby) UpdateType() string { return TypeUpdateUsersNearby } +// The list of supported dice emojis has changed +type UpdateDiceEmojis struct { + meta + // The new list of supported dice emojis + Emojis []string `json:"emojis"` +} + +func (entity *UpdateDiceEmojis) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateDiceEmojis + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateDiceEmojis) GetClass() string { + return ClassUpdate +} + +func (*UpdateDiceEmojis) GetType() string { + return TypeUpdateDiceEmojis +} + +func (*UpdateDiceEmojis) UpdateType() string { + return TypeUpdateDiceEmojis +} + +// The parameters of animation search through GetOption("animation_search_bot_username") bot has changed +type UpdateAnimationSearchParameters struct { + meta + // Name of the animation search provider + Provider string `json:"provider"` + // The new list of emojis suggested for searching + Emojis []string `json:"emojis"` +} + +func (entity *UpdateAnimationSearchParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAnimationSearchParameters + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAnimationSearchParameters) GetClass() string { + return ClassUpdate +} + +func (*UpdateAnimationSearchParameters) GetType() string { + return TypeUpdateAnimationSearchParameters +} + +func (*UpdateAnimationSearchParameters) UpdateType() string { + return TypeUpdateAnimationSearchParameters +} + +// The list of suggested to the user actions has changed +type UpdateSuggestedActions struct { + meta + // Added suggested actions + AddedActions []SuggestedAction `json:"added_actions"` + // Removed suggested actions + RemovedActions []SuggestedAction `json:"removed_actions"` +} + +func (entity *UpdateSuggestedActions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSuggestedActions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSuggestedActions) GetClass() string { + return ClassUpdate +} + +func (*UpdateSuggestedActions) GetType() string { + return TypeUpdateSuggestedActions +} + +func (*UpdateSuggestedActions) UpdateType() string { + return TypeUpdateSuggestedActions +} + // A new incoming inline query; for bots only type UpdateNewInlineQuery struct { meta @@ -25024,7 +27528,7 @@ type UpdateNewInlineQuery struct { Id JsonInt64 `json:"id"` // Identifier of the user who sent the query SenderUserId int32 `json:"sender_user_id"` - // User location, provided by the client; may be null + // User location; may be null UserLocation *Location `json:"user_location"` // Text of the query Query string `json:"query"` @@ -25057,7 +27561,7 @@ type UpdateNewChosenInlineResult struct { meta // Identifier of the user who sent the query SenderUserId int32 `json:"sender_user_id"` - // User location, provided by the client; may be null + // User location; may be null UserLocation *Location `json:"user_location"` // Text of the query Query string `json:"query"` @@ -25454,6 +27958,8 @@ type LogStreamFile struct { Path string `json:"path"` // The maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated MaxFileSize int64 `json:"max_file_size"` + // Pass true to additionally redirect stderr to the log file. Ignored on Windows + RedirectStderr bool `json:"redirect_stderr"` } func (entity *LogStreamFile) MarshalJSON() ([]byte, error) { diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 8488255..2db3546 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -106,6 +106,38 @@ func UnmarshalInputFile(data json.RawMessage) (InputFile, error) { } } +func UnmarshalThumbnailFormat(data json.RawMessage) (ThumbnailFormat, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeThumbnailFormatJpeg: + return UnmarshalThumbnailFormatJpeg(data) + + case TypeThumbnailFormatPng: + return UnmarshalThumbnailFormatPng(data) + + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) + + case TypeThumbnailFormatGif: + return UnmarshalThumbnailFormatGif(data) + + case TypeThumbnailFormatTgs: + return UnmarshalThumbnailFormatTgs(data) + + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + func UnmarshalMaskPoint(data json.RawMessage) (MaskPoint, error) { var meta meta @@ -178,6 +210,29 @@ func UnmarshalUserType(data json.RawMessage) (UserType, error) { } } +func UnmarshalInputChatPhoto(data json.RawMessage) (InputChatPhoto, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputChatPhotoPrevious: + return UnmarshalInputChatPhotoPrevious(data) + + case TypeInputChatPhotoStatic: + return UnmarshalInputChatPhotoStatic(data) + + case TypeInputChatPhotoAnimation: + return UnmarshalInputChatPhotoAnimation(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + func UnmarshalChatMemberStatus(data json.RawMessage) (ChatMemberStatus, error) { var meta meta @@ -228,6 +283,9 @@ func UnmarshalChatMembersFilter(data json.RawMessage) (ChatMembersFilter, error) case TypeChatMembersFilterMembers: return UnmarshalChatMembersFilterMembers(data) + case TypeChatMembersFilterMention: + return UnmarshalChatMembersFilterMention(data) + case TypeChatMembersFilterRestricted: return UnmarshalChatMembersFilterRestricted(data) @@ -269,6 +327,9 @@ func UnmarshalSupergroupMembersFilter(data json.RawMessage) (SupergroupMembersFi case TypeSupergroupMembersFilterBanned: return UnmarshalSupergroupMembersFilterBanned(data) + case TypeSupergroupMembersFilterMention: + return UnmarshalSupergroupMembersFilterMention(data) + case TypeSupergroupMembersFilterBots: return UnmarshalSupergroupMembersFilterBots(data) @@ -300,6 +361,26 @@ func UnmarshalSecretChatState(data json.RawMessage) (SecretChatState, error) { } } +func UnmarshalMessageSender(data json.RawMessage) (MessageSender, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageSenderUser: + return UnmarshalMessageSenderUser(data) + + case TypeMessageSenderChat: + return UnmarshalMessageSenderChat(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + func UnmarshalMessageForwardOrigin(data json.RawMessage) (MessageForwardOrigin, error) { var meta meta @@ -312,6 +393,9 @@ func UnmarshalMessageForwardOrigin(data json.RawMessage) (MessageForwardOrigin, case TypeMessageForwardOriginUser: return UnmarshalMessageForwardOriginUser(data) + case TypeMessageForwardOriginChat: + return UnmarshalMessageForwardOriginChat(data) + case TypeMessageForwardOriginHiddenUser: return UnmarshalMessageForwardOriginHiddenUser(data) @@ -407,6 +491,29 @@ func UnmarshalChatList(data json.RawMessage) (ChatList, error) { case TypeChatListArchive: return UnmarshalChatListArchive(data) + case TypeChatListFilter: + return UnmarshalChatListFilter(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalChatSource(data json.RawMessage) (ChatSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatSourceMtprotoProxy: + return UnmarshalChatSourceMtprotoProxy(data) + + case TypeChatSourcePublicServiceAnnouncement: + return UnmarshalChatSourcePublicServiceAnnouncement(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -505,6 +612,9 @@ func UnmarshalInlineKeyboardButtonType(data json.RawMessage) (InlineKeyboardButt case TypeInlineKeyboardButtonTypeCallback: return UnmarshalInlineKeyboardButtonTypeCallback(data) + case TypeInlineKeyboardButtonTypeCallbackWithPassword: + return UnmarshalInlineKeyboardButtonTypeCallbackWithPassword(data) + case TypeInlineKeyboardButtonTypeCallbackGame: return UnmarshalInlineKeyboardButtonTypeCallbackGame(data) @@ -613,9 +723,15 @@ func UnmarshalRichText(data json.RawMessage) (RichText, error) { case TypeRichTextIcon: return UnmarshalRichTextIcon(data) + case TypeRichTextReference: + return UnmarshalRichTextReference(data) + case TypeRichTextAnchor: return UnmarshalRichTextAnchor(data) + case TypeRichTextAnchorLink: + return UnmarshalRichTextAnchorLink(data) + case TypeRichTexts: return UnmarshalRichTexts(data) @@ -1089,6 +1205,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageContact: return UnmarshalMessageContact(data) + case TypeMessageDice: + return UnmarshalMessageDice(data) + case TypeMessageGame: return UnmarshalMessageGame(data) @@ -1164,6 +1283,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePassportDataReceived: return UnmarshalMessagePassportDataReceived(data) + case TypeMessageProximityAlertTriggered: + return UnmarshalMessageProximityAlertTriggered(data) + case TypeMessageUnsupported: return UnmarshalMessageUnsupported(data) @@ -1202,6 +1324,9 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypePhoneNumber: return UnmarshalTextEntityTypePhoneNumber(data) + case TypeTextEntityTypeBankCardNumber: + return UnmarshalTextEntityTypeBankCardNumber(data) + case TypeTextEntityTypeBold: return UnmarshalTextEntityTypeBold(data) @@ -1299,6 +1424,9 @@ func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, er case TypeInputMessageContact: return UnmarshalInputMessageContact(data) + case TypeInputMessageDice: + return UnmarshalInputMessageDice(data) + case TypeInputMessageGame: return UnmarshalInputMessageGame(data) @@ -1373,6 +1501,12 @@ func UnmarshalSearchMessagesFilter(data json.RawMessage) (SearchMessagesFilter, case TypeSearchMessagesFilterUnreadMention: return UnmarshalSearchMessagesFilterUnreadMention(data) + case TypeSearchMessagesFilterFailedToSend: + return UnmarshalSearchMessagesFilterFailedToSend(data) + + case TypeSearchMessagesFilterPinned: + return UnmarshalSearchMessagesFilterPinned(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -1492,6 +1626,26 @@ func UnmarshalCallDiscardReason(data json.RawMessage) (CallDiscardReason, error) } } +func UnmarshalCallServerType(data json.RawMessage) (CallServerType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCallServerTypeTelegramReflector: + return UnmarshalCallServerTypeTelegramReflector(data) + + case TypeCallServerTypeWebrtc: + return UnmarshalCallServerTypeWebrtc(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + func UnmarshalCallState(data json.RawMessage) (CallState, error) { var meta meta @@ -1554,6 +1708,32 @@ func UnmarshalCallProblem(data json.RawMessage) (CallProblem, error) { case TypeCallProblemDropped: return UnmarshalCallProblemDropped(data) + case TypeCallProblemDistortedVideo: + return UnmarshalCallProblemDistortedVideo(data) + + case TypeCallProblemPixelatedVideo: + return UnmarshalCallProblemPixelatedVideo(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalDiceStickers(data json.RawMessage) (DiceStickers, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeDiceStickersRegular: + return UnmarshalDiceStickersRegular(data) + + case TypeDiceStickersSlotMachine: + return UnmarshalDiceStickersSlotMachine(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -1568,11 +1748,8 @@ func UnmarshalInputInlineQueryResult(data json.RawMessage) (InputInlineQueryResu } switch meta.Type { - case TypeInputInlineQueryResultAnimatedGif: - return UnmarshalInputInlineQueryResultAnimatedGif(data) - - case TypeInputInlineQueryResultAnimatedMpeg4: - return UnmarshalInputInlineQueryResultAnimatedMpeg4(data) + case TypeInputInlineQueryResultAnimation: + return UnmarshalInputInlineQueryResultAnimation(data) case TypeInputInlineQueryResultArticle: return UnmarshalInputInlineQueryResultArticle(data) @@ -1674,6 +1851,9 @@ func UnmarshalCallbackQueryPayload(data json.RawMessage) (CallbackQueryPayload, case TypeCallbackQueryPayloadData: return UnmarshalCallbackQueryPayloadData(data) + case TypeCallbackQueryPayloadDataWithPassword: + return UnmarshalCallbackQueryPayloadDataWithPassword(data) + case TypeCallbackQueryPayloadGame: return UnmarshalCallbackQueryPayloadGame(data) @@ -2464,6 +2644,26 @@ func UnmarshalTMeUrlType(data json.RawMessage) (TMeUrlType, error) { } } +func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeSuggestedActionEnableArchiveAndMuteNewChats: + return UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data) + + case TypeSuggestedActionCheckPhoneNumber: + return UnmarshalSuggestedActionCheckPhoneNumber(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + func UnmarshalTextParseMode(data json.RawMessage) (TextParseMode, error) { var meta meta @@ -2507,6 +2707,69 @@ func UnmarshalProxyType(data json.RawMessage) (ProxyType, error) { } } +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 UnmarshalStatisticalGraph(data json.RawMessage) (StatisticalGraph, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStatisticalGraphData: + return UnmarshalStatisticalGraphData(data) + + case TypeStatisticalGraphAsync: + return UnmarshalStatisticalGraphAsync(data) + + case TypeStatisticalGraphError: + return UnmarshalStatisticalGraphError(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalChatStatistics(data json.RawMessage) (ChatStatistics, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatStatisticsSupergroup: + return UnmarshalChatStatisticsSupergroup(data) + + case TypeChatStatisticsChannel: + return UnmarshalChatStatisticsChannel(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + func UnmarshalUpdate(data json.RawMessage) (Update, error) { var meta meta @@ -2537,8 +2800,11 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateMessageEdited: return UnmarshalUpdateMessageEdited(data) - case TypeUpdateMessageViews: - return UnmarshalUpdateMessageViews(data) + case TypeUpdateMessageIsPinned: + return UnmarshalUpdateMessageIsPinned(data) + + case TypeUpdateMessageInteractionInfo: + return UnmarshalUpdateMessageInteractionInfo(data) case TypeUpdateMessageContentOpened: return UnmarshalUpdateMessageContentOpened(data) @@ -2552,9 +2818,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateNewChat: return UnmarshalUpdateNewChat(data) - case TypeUpdateChatChatList: - return UnmarshalUpdateChatChatList(data) - case TypeUpdateChatTitle: return UnmarshalUpdateChatTitle(data) @@ -2567,17 +2830,14 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatLastMessage: return UnmarshalUpdateChatLastMessage(data) - case TypeUpdateChatOrder: - return UnmarshalUpdateChatOrder(data) - - case TypeUpdateChatIsPinned: - return UnmarshalUpdateChatIsPinned(data) + case TypeUpdateChatPosition: + return UnmarshalUpdateChatPosition(data) case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(data) - case TypeUpdateChatIsSponsored: - return UnmarshalUpdateChatIsSponsored(data) + case TypeUpdateChatIsBlocked: + return UnmarshalUpdateChatIsBlocked(data) case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(data) @@ -2603,15 +2863,15 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) - case TypeUpdateChatPinnedMessage: - return UnmarshalUpdateChatPinnedMessage(data) - case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(data) case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(data) + case TypeUpdateChatFilters: + return UnmarshalUpdateChatFilters(data) + case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) @@ -2672,6 +2932,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateCall: return UnmarshalUpdateCall(data) + case TypeUpdateNewCallSignalingData: + return UnmarshalUpdateNewCallSignalingData(data) + case TypeUpdateUserPrivacySettingRules: return UnmarshalUpdateUserPrivacySettingRules(data) @@ -2684,6 +2947,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateOption: return UnmarshalUpdateOption(data) + case TypeUpdateStickerSet: + return UnmarshalUpdateStickerSet(data) + case TypeUpdateInstalledStickerSets: return UnmarshalUpdateInstalledStickerSets(data) @@ -2714,6 +2980,15 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(data) + case TypeUpdateDiceEmojis: + return UnmarshalUpdateDiceEmojis(data) + + case TypeUpdateAnimationSearchParameters: + return UnmarshalUpdateAnimationSearchParameters(data) + + case TypeUpdateSuggestedActions: + return UnmarshalUpdateSuggestedActions(data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(data) @@ -3060,6 +3335,62 @@ func UnmarshalMinithumbnail(data json.RawMessage) (*Minithumbnail, error) { return &resp, err } +func UnmarshalThumbnailFormatJpeg(data json.RawMessage) (*ThumbnailFormatJpeg, error) { + var resp ThumbnailFormatJpeg + + 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 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 + + 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 UnmarshalThumbnail(data json.RawMessage) (*Thumbnail, error) { + var resp Thumbnail + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMaskPointForehead(data json.RawMessage) (*MaskPointForehead, error) { var resp MaskPointForehead @@ -3236,8 +3567,8 @@ func UnmarshalProfilePhoto(data json.RawMessage) (*ProfilePhoto, error) { return &resp, err } -func UnmarshalChatPhoto(data json.RawMessage) (*ChatPhoto, error) { - var resp ChatPhoto +func UnmarshalChatPhotoInfo(data json.RawMessage) (*ChatPhotoInfo, error) { + var resp ChatPhotoInfo err := json.Unmarshal(data, &resp) @@ -3300,6 +3631,54 @@ func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { return &resp, err } +func UnmarshalAnimatedChatPhoto(data json.RawMessage) (*AnimatedChatPhoto, error) { + var resp AnimatedChatPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPhoto(data json.RawMessage) (*ChatPhoto, error) { + var resp ChatPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPhotos(data json.RawMessage) (*ChatPhotos, error) { + var resp ChatPhotos + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputChatPhotoPrevious(data json.RawMessage) (*InputChatPhotoPrevious, error) { + var resp InputChatPhotoPrevious + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputChatPhotoStatic(data json.RawMessage) (*InputChatPhotoStatic, error) { + var resp InputChatPhotoStatic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputChatPhotoAnimation(data json.RawMessage) (*InputChatPhotoAnimation, error) { + var resp InputChatPhotoAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUser(data json.RawMessage) (*User, error) { var resp User @@ -3316,22 +3695,6 @@ func UnmarshalUserFullInfo(data json.RawMessage) (*UserFullInfo, error) { return &resp, err } -func UnmarshalUserProfilePhoto(data json.RawMessage) (*UserProfilePhoto, error) { - var resp UserProfilePhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserProfilePhotos(data json.RawMessage) (*UserProfilePhotos, error) { - var resp UserProfilePhotos - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUsers(data json.RawMessage) (*Users, error) { var resp Users @@ -3452,6 +3815,14 @@ func UnmarshalChatMembersFilterMembers(data json.RawMessage) (*ChatMembersFilter return &resp, err } +func UnmarshalChatMembersFilterMention(data json.RawMessage) (*ChatMembersFilterMention, error) { + var resp ChatMembersFilterMention + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatMembersFilterRestricted(data json.RawMessage) (*ChatMembersFilterRestricted, error) { var resp ChatMembersFilterRestricted @@ -3524,6 +3895,14 @@ func UnmarshalSupergroupMembersFilterBanned(data json.RawMessage) (*SupergroupMe return &resp, err } +func UnmarshalSupergroupMembersFilterMention(data json.RawMessage) (*SupergroupMembersFilterMention, error) { + var resp SupergroupMembersFilterMention + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSupergroupMembersFilterBots(data json.RawMessage) (*SupergroupMembersFilterBots, error) { var resp SupergroupMembersFilterBots @@ -3596,6 +3975,30 @@ func UnmarshalSecretChat(data json.RawMessage) (*SecretChat, error) { return &resp, err } +func UnmarshalMessageSenderUser(data json.RawMessage) (*MessageSenderUser, error) { + var resp MessageSenderUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSenderChat(data json.RawMessage) (*MessageSenderChat, error) { + var resp MessageSenderChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSenders(data json.RawMessage) (*MessageSenders, error) { + var resp MessageSenders + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageForwardOriginUser(data json.RawMessage) (*MessageForwardOriginUser, error) { var resp MessageForwardOriginUser @@ -3604,6 +4007,14 @@ func UnmarshalMessageForwardOriginUser(data json.RawMessage) (*MessageForwardOri return &resp, err } +func UnmarshalMessageForwardOriginChat(data json.RawMessage) (*MessageForwardOriginChat, error) { + var resp MessageForwardOriginChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageForwardOriginHiddenUser(data json.RawMessage) (*MessageForwardOriginHiddenUser, error) { var resp MessageForwardOriginHiddenUser @@ -3628,6 +4039,22 @@ func UnmarshalMessageForwardInfo(data json.RawMessage) (*MessageForwardInfo, err return &resp, err } +func UnmarshalMessageReplyInfo(data json.RawMessage) (*MessageReplyInfo, error) { + var resp MessageReplyInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionInfo, error) { + var resp MessageInteractionInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageSendingStatePending(data json.RawMessage) (*MessageSendingStatePending, error) { var resp MessageSendingStatePending @@ -3748,6 +4175,38 @@ func UnmarshalChatTypeSecret(data json.RawMessage) (*ChatTypeSecret, error) { return &resp, err } +func UnmarshalChatFilter(data json.RawMessage) (*ChatFilter, error) { + var resp ChatFilter + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFilterInfo(data json.RawMessage) (*ChatFilterInfo, error) { + var resp ChatFilterInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRecommendedChatFilter(data json.RawMessage) (*RecommendedChatFilter, error) { + var resp RecommendedChatFilter + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRecommendedChatFilters(data json.RawMessage) (*RecommendedChatFilters, error) { + var resp RecommendedChatFilters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatListMain(data json.RawMessage) (*ChatListMain, error) { var resp ChatListMain @@ -3764,6 +4223,46 @@ func UnmarshalChatListArchive(data json.RawMessage) (*ChatListArchive, error) { return &resp, err } +func UnmarshalChatListFilter(data json.RawMessage) (*ChatListFilter, error) { + var resp ChatListFilter + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatLists(data json.RawMessage) (*ChatLists, error) { + var resp ChatLists + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatSourceMtprotoProxy(data json.RawMessage) (*ChatSourceMtprotoProxy, error) { + var resp ChatSourceMtprotoProxy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatSourcePublicServiceAnnouncement(data json.RawMessage) (*ChatSourcePublicServiceAnnouncement, error) { + var resp ChatSourcePublicServiceAnnouncement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPosition(data json.RawMessage) (*ChatPosition, error) { + var resp ChatPosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChat(data json.RawMessage) (*Chat, error) { var resp Chat @@ -3932,6 +4431,14 @@ func UnmarshalInlineKeyboardButtonTypeCallback(data json.RawMessage) (*InlineKey return &resp, err } +func UnmarshalInlineKeyboardButtonTypeCallbackWithPassword(data json.RawMessage) (*InlineKeyboardButtonTypeCallbackWithPassword, error) { + var resp InlineKeyboardButtonTypeCallbackWithPassword + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInlineKeyboardButtonTypeCallbackGame(data json.RawMessage) (*InlineKeyboardButtonTypeCallbackGame, error) { var resp InlineKeyboardButtonTypeCallbackGame @@ -4012,6 +4519,14 @@ func UnmarshalLoginUrlInfoRequestConfirmation(data json.RawMessage) (*LoginUrlIn return &resp, err } +func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error) { + var resp MessageThreadInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { var resp RichTextPlain @@ -4116,6 +4631,14 @@ func UnmarshalRichTextIcon(data json.RawMessage) (*RichTextIcon, error) { return &resp, err } +func UnmarshalRichTextReference(data json.RawMessage) (*RichTextReference, error) { + var resp RichTextReference + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextAnchor(data json.RawMessage) (*RichTextAnchor, error) { var resp RichTextAnchor @@ -4124,6 +4647,14 @@ func UnmarshalRichTextAnchor(data json.RawMessage) (*RichTextAnchor, error) { return &resp, err } +func UnmarshalRichTextAnchorLink(data json.RawMessage) (*RichTextAnchorLink, error) { + var resp RichTextAnchorLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTexts(data json.RawMessage) (*RichTexts, error) { var resp RichTexts @@ -4460,6 +4991,46 @@ func UnmarshalWebPage(data json.RawMessage) (*WebPage, error) { return &resp, err } +func UnmarshalCountryInfo(data json.RawMessage) (*CountryInfo, error) { + var resp CountryInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCountries(data json.RawMessage) (*Countries, error) { + var resp Countries + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPhoneNumberInfo(data json.RawMessage) (*PhoneNumberInfo, error) { + var resp PhoneNumberInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBankCardActionOpenUrl(data json.RawMessage) (*BankCardActionOpenUrl, error) { + var resp BankCardActionOpenUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBankCardInfo(data json.RawMessage) (*BankCardInfo, error) { + var resp BankCardInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAddress(data json.RawMessage) (*Address, error) { var resp Address @@ -5276,6 +5847,14 @@ func UnmarshalMessageContact(data json.RawMessage) (*MessageContact, error) { return &resp, err } +func UnmarshalMessageDice(data json.RawMessage) (*MessageDice, error) { + var resp MessageDice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageGame(data json.RawMessage) (*MessageGame, error) { var resp MessageGame @@ -5476,6 +6055,14 @@ func UnmarshalMessagePassportDataReceived(data json.RawMessage) (*MessagePasspor return &resp, err } +func UnmarshalMessageProximityAlertTriggered(data json.RawMessage) (*MessageProximityAlertTriggered, error) { + var resp MessageProximityAlertTriggered + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageUnsupported(data json.RawMessage) (*MessageUnsupported, error) { var resp MessageUnsupported @@ -5540,6 +6127,14 @@ func UnmarshalTextEntityTypePhoneNumber(data json.RawMessage) (*TextEntityTypePh return &resp, err } +func UnmarshalTextEntityTypeBankCardNumber(data json.RawMessage) (*TextEntityTypeBankCardNumber, error) { + var resp TextEntityTypeBankCardNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeBold(data json.RawMessage) (*TextEntityTypeBold, error) { var resp TextEntityTypeBold @@ -5636,8 +6231,16 @@ func UnmarshalMessageSchedulingStateSendWhenOnline(data json.RawMessage) (*Messa return &resp, err } -func UnmarshalSendMessageOptions(data json.RawMessage) (*SendMessageOptions, error) { - var resp SendMessageOptions +func UnmarshalMessageSendOptions(data json.RawMessage) (*MessageSendOptions, error) { + var resp MessageSendOptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageCopyOptions(data json.RawMessage) (*MessageCopyOptions, error) { + var resp MessageCopyOptions err := json.Unmarshal(data, &resp) @@ -5740,6 +6343,14 @@ func UnmarshalInputMessageContact(data json.RawMessage) (*InputMessageContact, e return &resp, err } +func UnmarshalInputMessageDice(data json.RawMessage) (*InputMessageDice, error) { + var resp InputMessageDice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageGame(data json.RawMessage) (*InputMessageGame, error) { var resp InputMessageGame @@ -5900,6 +6511,22 @@ func UnmarshalSearchMessagesFilterUnreadMention(data json.RawMessage) (*SearchMe return &resp, err } +func UnmarshalSearchMessagesFilterFailedToSend(data json.RawMessage) (*SearchMessagesFilterFailedToSend, error) { + var resp SearchMessagesFilterFailedToSend + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterPinned(data json.RawMessage) (*SearchMessagesFilterPinned, error) { + var resp SearchMessagesFilterPinned + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatActionTyping(data json.RawMessage) (*ChatActionTyping, error) { var resp ChatActionTyping @@ -6140,8 +6767,24 @@ func UnmarshalCallProtocol(data json.RawMessage) (*CallProtocol, error) { return &resp, err } -func UnmarshalCallConnection(data json.RawMessage) (*CallConnection, error) { - var resp CallConnection +func UnmarshalCallServerTypeTelegramReflector(data json.RawMessage) (*CallServerTypeTelegramReflector, error) { + var resp CallServerTypeTelegramReflector + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallServerTypeWebrtc(data json.RawMessage) (*CallServerTypeWebrtc, error) { + var resp CallServerTypeWebrtc + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallServer(data json.RawMessage) (*CallServer, error) { + var resp CallServer err := json.Unmarshal(data, &resp) @@ -6260,6 +6903,22 @@ func UnmarshalCallProblemDropped(data json.RawMessage) (*CallProblemDropped, err return &resp, err } +func UnmarshalCallProblemDistortedVideo(data json.RawMessage) (*CallProblemDistortedVideo, error) { + var resp CallProblemDistortedVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProblemPixelatedVideo(data json.RawMessage) (*CallProblemPixelatedVideo, error) { + var resp CallProblemPixelatedVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCall(data json.RawMessage) (*Call, error) { var resp Call @@ -6284,6 +6943,22 @@ func UnmarshalAnimations(data json.RawMessage) (*Animations, error) { return &resp, err } +func UnmarshalDiceStickersRegular(data json.RawMessage) (*DiceStickersRegular, error) { + var resp DiceStickersRegular + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDiceStickersSlotMachine(data json.RawMessage) (*DiceStickersSlotMachine, error) { + var resp DiceStickersSlotMachine + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error) { var resp ImportedContacts @@ -6300,16 +6975,8 @@ func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) { return &resp, err } -func UnmarshalInputInlineQueryResultAnimatedGif(data json.RawMessage) (*InputInlineQueryResultAnimatedGif, error) { - var resp InputInlineQueryResultAnimatedGif - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultAnimatedMpeg4(data json.RawMessage) (*InputInlineQueryResultAnimatedMpeg4, error) { - var resp InputInlineQueryResultAnimatedMpeg4 +func UnmarshalInputInlineQueryResultAnimation(data json.RawMessage) (*InputInlineQueryResultAnimation, error) { + var resp InputInlineQueryResultAnimation err := json.Unmarshal(data, &resp) @@ -6516,6 +7183,14 @@ func UnmarshalCallbackQueryPayloadData(data json.RawMessage) (*CallbackQueryPayl return &resp, err } +func UnmarshalCallbackQueryPayloadDataWithPassword(data json.RawMessage) (*CallbackQueryPayloadDataWithPassword, error) { + var resp CallbackQueryPayloadDataWithPassword + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCallbackQueryPayloadGame(data json.RawMessage) (*CallbackQueryPayloadGame, error) { var resp CallbackQueryPayloadGame @@ -7668,8 +8343,8 @@ func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCus return &resp, err } -func UnmarshalPublicMessageLink(data json.RawMessage) (*PublicMessageLink, error) { - var resp PublicMessageLink +func UnmarshalMessageLink(data json.RawMessage) (*MessageLink, error) { + var resp MessageLink err := json.Unmarshal(data, &resp) @@ -8084,6 +8759,22 @@ func UnmarshalTMeUrls(data json.RawMessage) (*TMeUrls, error) { return &resp, err } +func UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data json.RawMessage) (*SuggestedActionEnableArchiveAndMuteNewChats, error) { + var resp SuggestedActionEnableArchiveAndMuteNewChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionCheckPhoneNumber(data json.RawMessage) (*SuggestedActionCheckPhoneNumber, error) { + var resp SuggestedActionCheckPhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCount(data json.RawMessage) (*Count, error) { var resp Count @@ -8172,8 +8863,112 @@ 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) + + return &resp, err +} + +func UnmarshalDateRange(data json.RawMessage) (*DateRange, error) { + var resp DateRange + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStatisticalValue(data json.RawMessage) (*StatisticalValue, error) { + var resp StatisticalValue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStatisticalGraphData(data json.RawMessage) (*StatisticalGraphData, error) { + var resp StatisticalGraphData + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStatisticalGraphAsync(data json.RawMessage) (*StatisticalGraphAsync, error) { + var resp StatisticalGraphAsync + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStatisticalGraphError(data json.RawMessage) (*StatisticalGraphError, error) { + var resp StatisticalGraphError + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatStatisticsMessageInteractionInfo(data json.RawMessage) (*ChatStatisticsMessageInteractionInfo, error) { + var resp ChatStatisticsMessageInteractionInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatStatisticsMessageSenderInfo(data json.RawMessage) (*ChatStatisticsMessageSenderInfo, error) { + var resp ChatStatisticsMessageSenderInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatStatisticsAdministratorActionsInfo(data json.RawMessage) (*ChatStatisticsAdministratorActionsInfo, error) { + var resp ChatStatisticsAdministratorActionsInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatStatisticsInviterInfo(data json.RawMessage) (*ChatStatisticsInviterInfo, error) { + var resp ChatStatisticsInviterInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatStatisticsSupergroup(data json.RawMessage) (*ChatStatisticsSupergroup, error) { + var resp ChatStatisticsSupergroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatStatisticsChannel(data json.RawMessage) (*ChatStatisticsChannel, error) { + var resp ChatStatisticsChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageStatistics(data json.RawMessage) (*MessageStatistics, error) { + var resp MessageStatistics err := json.Unmarshal(data, &resp) @@ -8236,8 +9031,16 @@ func UnmarshalUpdateMessageEdited(data json.RawMessage) (*UpdateMessageEdited, e return &resp, err } -func UnmarshalUpdateMessageViews(data json.RawMessage) (*UpdateMessageViews, error) { - var resp UpdateMessageViews +func UnmarshalUpdateMessageIsPinned(data json.RawMessage) (*UpdateMessageIsPinned, error) { + var resp UpdateMessageIsPinned + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateMessageInteractionInfo(data json.RawMessage) (*UpdateMessageInteractionInfo, error) { + var resp UpdateMessageInteractionInfo err := json.Unmarshal(data, &resp) @@ -8276,14 +9079,6 @@ func UnmarshalUpdateNewChat(data json.RawMessage) (*UpdateNewChat, error) { return &resp, err } -func UnmarshalUpdateChatChatList(data json.RawMessage) (*UpdateChatChatList, error) { - var resp UpdateChatChatList - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateChatTitle(data json.RawMessage) (*UpdateChatTitle, error) { var resp UpdateChatTitle @@ -8316,16 +9111,8 @@ func UnmarshalUpdateChatLastMessage(data json.RawMessage) (*UpdateChatLastMessag return &resp, err } -func UnmarshalUpdateChatOrder(data json.RawMessage) (*UpdateChatOrder, error) { - var resp UpdateChatOrder - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatIsPinned(data json.RawMessage) (*UpdateChatIsPinned, error) { - var resp UpdateChatIsPinned +func UnmarshalUpdateChatPosition(data json.RawMessage) (*UpdateChatPosition, error) { + var resp UpdateChatPosition err := json.Unmarshal(data, &resp) @@ -8340,8 +9127,8 @@ func UnmarshalUpdateChatIsMarkedAsUnread(data json.RawMessage) (*UpdateChatIsMar return &resp, err } -func UnmarshalUpdateChatIsSponsored(data json.RawMessage) (*UpdateChatIsSponsored, error) { - var resp UpdateChatIsSponsored +func UnmarshalUpdateChatIsBlocked(data json.RawMessage) (*UpdateChatIsBlocked, error) { + var resp UpdateChatIsBlocked err := json.Unmarshal(data, &resp) @@ -8412,14 +9199,6 @@ func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, e return &resp, err } -func UnmarshalUpdateChatPinnedMessage(data json.RawMessage) (*UpdateChatPinnedMessage, error) { - var resp UpdateChatPinnedMessage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateChatReplyMarkup(data json.RawMessage) (*UpdateChatReplyMarkup, error) { var resp UpdateChatReplyMarkup @@ -8436,6 +9215,14 @@ func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMess return &resp, err } +func UnmarshalUpdateChatFilters(data json.RawMessage) (*UpdateChatFilters, error) { + var resp UpdateChatFilters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatOnlineMemberCount(data json.RawMessage) (*UpdateChatOnlineMemberCount, error) { var resp UpdateChatOnlineMemberCount @@ -8596,6 +9383,14 @@ func UnmarshalUpdateCall(data json.RawMessage) (*UpdateCall, error) { return &resp, err } +func UnmarshalUpdateNewCallSignalingData(data json.RawMessage) (*UpdateNewCallSignalingData, error) { + var resp UpdateNewCallSignalingData + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateUserPrivacySettingRules(data json.RawMessage) (*UpdateUserPrivacySettingRules, error) { var resp UpdateUserPrivacySettingRules @@ -8628,6 +9423,14 @@ func UnmarshalUpdateOption(data json.RawMessage) (*UpdateOption, error) { return &resp, err } +func UnmarshalUpdateStickerSet(data json.RawMessage) (*UpdateStickerSet, error) { + var resp UpdateStickerSet + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateInstalledStickerSets(data json.RawMessage) (*UpdateInstalledStickerSets, error) { var resp UpdateInstalledStickerSets @@ -8708,6 +9511,30 @@ func UnmarshalUpdateUsersNearby(data json.RawMessage) (*UpdateUsersNearby, error return &resp, err } +func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) { + var resp UpdateDiceEmojis + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateAnimationSearchParameters(data json.RawMessage) (*UpdateAnimationSearchParameters, error) { + var resp UpdateAnimationSearchParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateSuggestedActions(data json.RawMessage) (*UpdateSuggestedActions, error) { + var resp UpdateSuggestedActions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNewInlineQuery(data json.RawMessage) (*UpdateNewInlineQuery, error) { var resp UpdateNewInlineQuery @@ -9009,6 +9836,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMinithumbnail: return UnmarshalMinithumbnail(data) + case TypeThumbnailFormatJpeg: + return UnmarshalThumbnailFormatJpeg(data) + + case TypeThumbnailFormatPng: + return UnmarshalThumbnailFormatPng(data) + + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) + + case TypeThumbnailFormatGif: + return UnmarshalThumbnailFormatGif(data) + + case TypeThumbnailFormatTgs: + return UnmarshalThumbnailFormatTgs(data) + + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) + + case TypeThumbnail: + return UnmarshalThumbnail(data) + case TypeMaskPointForehead: return UnmarshalMaskPointForehead(data) @@ -9075,8 +9923,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProfilePhoto: return UnmarshalProfilePhoto(data) - case TypeChatPhoto: - return UnmarshalChatPhoto(data) + case TypeChatPhotoInfo: + return UnmarshalChatPhotoInfo(data) case TypeUserTypeRegular: return UnmarshalUserTypeRegular(data) @@ -9099,18 +9947,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatLocation: return UnmarshalChatLocation(data) + case TypeAnimatedChatPhoto: + return UnmarshalAnimatedChatPhoto(data) + + case TypeChatPhoto: + return UnmarshalChatPhoto(data) + + case TypeChatPhotos: + return UnmarshalChatPhotos(data) + + case TypeInputChatPhotoPrevious: + return UnmarshalInputChatPhotoPrevious(data) + + case TypeInputChatPhotoStatic: + return UnmarshalInputChatPhotoStatic(data) + + case TypeInputChatPhotoAnimation: + return UnmarshalInputChatPhotoAnimation(data) + case TypeUser: return UnmarshalUser(data) case TypeUserFullInfo: return UnmarshalUserFullInfo(data) - case TypeUserProfilePhoto: - return UnmarshalUserProfilePhoto(data) - - case TypeUserProfilePhotos: - return UnmarshalUserProfilePhotos(data) - case TypeUsers: return UnmarshalUsers(data) @@ -9156,6 +10016,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatMembersFilterMembers: return UnmarshalChatMembersFilterMembers(data) + case TypeChatMembersFilterMention: + return UnmarshalChatMembersFilterMention(data) + case TypeChatMembersFilterRestricted: return UnmarshalChatMembersFilterRestricted(data) @@ -9183,6 +10046,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSupergroupMembersFilterBanned: return UnmarshalSupergroupMembersFilterBanned(data) + case TypeSupergroupMembersFilterMention: + return UnmarshalSupergroupMembersFilterMention(data) + case TypeSupergroupMembersFilterBots: return UnmarshalSupergroupMembersFilterBots(data) @@ -9210,9 +10076,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSecretChat: return UnmarshalSecretChat(data) + case TypeMessageSenderUser: + return UnmarshalMessageSenderUser(data) + + case TypeMessageSenderChat: + return UnmarshalMessageSenderChat(data) + + case TypeMessageSenders: + return UnmarshalMessageSenders(data) + case TypeMessageForwardOriginUser: return UnmarshalMessageForwardOriginUser(data) + case TypeMessageForwardOriginChat: + return UnmarshalMessageForwardOriginChat(data) + case TypeMessageForwardOriginHiddenUser: return UnmarshalMessageForwardOriginHiddenUser(data) @@ -9222,6 +10100,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageForwardInfo: return UnmarshalMessageForwardInfo(data) + case TypeMessageReplyInfo: + return UnmarshalMessageReplyInfo(data) + + case TypeMessageInteractionInfo: + return UnmarshalMessageInteractionInfo(data) + case TypeMessageSendingStatePending: return UnmarshalMessageSendingStatePending(data) @@ -9267,12 +10151,39 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatTypeSecret: return UnmarshalChatTypeSecret(data) + case TypeChatFilter: + return UnmarshalChatFilter(data) + + case TypeChatFilterInfo: + return UnmarshalChatFilterInfo(data) + + case TypeRecommendedChatFilter: + return UnmarshalRecommendedChatFilter(data) + + case TypeRecommendedChatFilters: + return UnmarshalRecommendedChatFilters(data) + case TypeChatListMain: return UnmarshalChatListMain(data) case TypeChatListArchive: return UnmarshalChatListArchive(data) + case TypeChatListFilter: + return UnmarshalChatListFilter(data) + + case TypeChatLists: + return UnmarshalChatLists(data) + + case TypeChatSourceMtprotoProxy: + return UnmarshalChatSourceMtprotoProxy(data) + + case TypeChatSourcePublicServiceAnnouncement: + return UnmarshalChatSourcePublicServiceAnnouncement(data) + + case TypeChatPosition: + return UnmarshalChatPosition(data) + case TypeChat: return UnmarshalChat(data) @@ -9336,6 +10247,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInlineKeyboardButtonTypeCallback: return UnmarshalInlineKeyboardButtonTypeCallback(data) + case TypeInlineKeyboardButtonTypeCallbackWithPassword: + return UnmarshalInlineKeyboardButtonTypeCallbackWithPassword(data) + case TypeInlineKeyboardButtonTypeCallbackGame: return UnmarshalInlineKeyboardButtonTypeCallbackGame(data) @@ -9366,6 +10280,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLoginUrlInfoRequestConfirmation: return UnmarshalLoginUrlInfoRequestConfirmation(data) + case TypeMessageThreadInfo: + return UnmarshalMessageThreadInfo(data) + case TypeRichTextPlain: return UnmarshalRichTextPlain(data) @@ -9405,9 +10322,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeRichTextIcon: return UnmarshalRichTextIcon(data) + case TypeRichTextReference: + return UnmarshalRichTextReference(data) + case TypeRichTextAnchor: return UnmarshalRichTextAnchor(data) + case TypeRichTextAnchorLink: + return UnmarshalRichTextAnchorLink(data) + case TypeRichTexts: return UnmarshalRichTexts(data) @@ -9534,6 +10457,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeWebPage: return UnmarshalWebPage(data) + case TypeCountryInfo: + return UnmarshalCountryInfo(data) + + case TypeCountries: + return UnmarshalCountries(data) + + case TypePhoneNumberInfo: + return UnmarshalPhoneNumberInfo(data) + + case TypeBankCardActionOpenUrl: + return UnmarshalBankCardActionOpenUrl(data) + + case TypeBankCardInfo: + return UnmarshalBankCardInfo(data) + case TypeAddress: return UnmarshalAddress(data) @@ -9840,6 +10778,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageContact: return UnmarshalMessageContact(data) + case TypeMessageDice: + return UnmarshalMessageDice(data) + case TypeMessageGame: return UnmarshalMessageGame(data) @@ -9915,6 +10856,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePassportDataReceived: return UnmarshalMessagePassportDataReceived(data) + case TypeMessageProximityAlertTriggered: + return UnmarshalMessageProximityAlertTriggered(data) + case TypeMessageUnsupported: return UnmarshalMessageUnsupported(data) @@ -9939,6 +10883,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypePhoneNumber: return UnmarshalTextEntityTypePhoneNumber(data) + case TypeTextEntityTypeBankCardNumber: + return UnmarshalTextEntityTypeBankCardNumber(data) + case TypeTextEntityTypeBold: return UnmarshalTextEntityTypeBold(data) @@ -9975,8 +10922,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSchedulingStateSendWhenOnline: return UnmarshalMessageSchedulingStateSendWhenOnline(data) - case TypeSendMessageOptions: - return UnmarshalSendMessageOptions(data) + case TypeMessageSendOptions: + return UnmarshalMessageSendOptions(data) + + case TypeMessageCopyOptions: + return UnmarshalMessageCopyOptions(data) case TypeInputMessageText: return UnmarshalInputMessageText(data) @@ -10014,6 +10964,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessageContact: return UnmarshalInputMessageContact(data) + case TypeInputMessageDice: + return UnmarshalInputMessageDice(data) + case TypeInputMessageGame: return UnmarshalInputMessageGame(data) @@ -10074,6 +11027,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesFilterUnreadMention: return UnmarshalSearchMessagesFilterUnreadMention(data) + case TypeSearchMessagesFilterFailedToSend: + return UnmarshalSearchMessagesFilterFailedToSend(data) + + case TypeSearchMessagesFilterPinned: + return UnmarshalSearchMessagesFilterPinned(data) + case TypeChatActionTyping: return UnmarshalChatActionTyping(data) @@ -10164,8 +11123,14 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCallProtocol: return UnmarshalCallProtocol(data) - case TypeCallConnection: - return UnmarshalCallConnection(data) + case TypeCallServerTypeTelegramReflector: + return UnmarshalCallServerTypeTelegramReflector(data) + + case TypeCallServerTypeWebrtc: + return UnmarshalCallServerTypeWebrtc(data) + + case TypeCallServer: + return UnmarshalCallServer(data) case TypeCallId: return UnmarshalCallId(data) @@ -10209,6 +11174,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCallProblemDropped: return UnmarshalCallProblemDropped(data) + case TypeCallProblemDistortedVideo: + return UnmarshalCallProblemDistortedVideo(data) + + case TypeCallProblemPixelatedVideo: + return UnmarshalCallProblemPixelatedVideo(data) + case TypeCall: return UnmarshalCall(data) @@ -10218,17 +11189,20 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAnimations: return UnmarshalAnimations(data) + case TypeDiceStickersRegular: + return UnmarshalDiceStickersRegular(data) + + case TypeDiceStickersSlotMachine: + return UnmarshalDiceStickersSlotMachine(data) + case TypeImportedContacts: return UnmarshalImportedContacts(data) case TypeHttpUrl: return UnmarshalHttpUrl(data) - case TypeInputInlineQueryResultAnimatedGif: - return UnmarshalInputInlineQueryResultAnimatedGif(data) - - case TypeInputInlineQueryResultAnimatedMpeg4: - return UnmarshalInputInlineQueryResultAnimatedMpeg4(data) + case TypeInputInlineQueryResultAnimation: + return UnmarshalInputInlineQueryResultAnimation(data) case TypeInputInlineQueryResultArticle: return UnmarshalInputInlineQueryResultArticle(data) @@ -10305,6 +11279,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCallbackQueryPayloadData: return UnmarshalCallbackQueryPayloadData(data) + case TypeCallbackQueryPayloadDataWithPassword: + return UnmarshalCallbackQueryPayloadDataWithPassword(data) + case TypeCallbackQueryPayloadGame: return UnmarshalCallbackQueryPayloadGame(data) @@ -10737,8 +11714,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) - case TypePublicMessageLink: - return UnmarshalPublicMessageLink(data) + case TypeMessageLink: + return UnmarshalMessageLink(data) case TypeMessageLinkInfo: return UnmarshalMessageLinkInfo(data) @@ -10893,6 +11870,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTMeUrls: return UnmarshalTMeUrls(data) + case TypeSuggestedActionEnableArchiveAndMuteNewChats: + return UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data) + + case TypeSuggestedActionCheckPhoneNumber: + return UnmarshalSuggestedActionCheckPhoneNumber(data) + case TypeCount: return UnmarshalCount(data) @@ -10926,8 +11909,47 @@ 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) + + case TypeStatisticalValue: + return UnmarshalStatisticalValue(data) + + case TypeStatisticalGraphData: + return UnmarshalStatisticalGraphData(data) + + case TypeStatisticalGraphAsync: + return UnmarshalStatisticalGraphAsync(data) + + case TypeStatisticalGraphError: + return UnmarshalStatisticalGraphError(data) + + case TypeChatStatisticsMessageInteractionInfo: + return UnmarshalChatStatisticsMessageInteractionInfo(data) + + case TypeChatStatisticsMessageSenderInfo: + return UnmarshalChatStatisticsMessageSenderInfo(data) + + case TypeChatStatisticsAdministratorActionsInfo: + return UnmarshalChatStatisticsAdministratorActionsInfo(data) + + case TypeChatStatisticsInviterInfo: + return UnmarshalChatStatisticsInviterInfo(data) + + case TypeChatStatisticsSupergroup: + return UnmarshalChatStatisticsSupergroup(data) + + case TypeChatStatisticsChannel: + return UnmarshalChatStatisticsChannel(data) + + case TypeMessageStatistics: + return UnmarshalMessageStatistics(data) case TypeUpdateAuthorizationState: return UnmarshalUpdateAuthorizationState(data) @@ -10950,8 +11972,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateMessageEdited: return UnmarshalUpdateMessageEdited(data) - case TypeUpdateMessageViews: - return UnmarshalUpdateMessageViews(data) + case TypeUpdateMessageIsPinned: + return UnmarshalUpdateMessageIsPinned(data) + + case TypeUpdateMessageInteractionInfo: + return UnmarshalUpdateMessageInteractionInfo(data) case TypeUpdateMessageContentOpened: return UnmarshalUpdateMessageContentOpened(data) @@ -10965,9 +11990,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateNewChat: return UnmarshalUpdateNewChat(data) - case TypeUpdateChatChatList: - return UnmarshalUpdateChatChatList(data) - case TypeUpdateChatTitle: return UnmarshalUpdateChatTitle(data) @@ -10980,17 +12002,14 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatLastMessage: return UnmarshalUpdateChatLastMessage(data) - case TypeUpdateChatOrder: - return UnmarshalUpdateChatOrder(data) - - case TypeUpdateChatIsPinned: - return UnmarshalUpdateChatIsPinned(data) + case TypeUpdateChatPosition: + return UnmarshalUpdateChatPosition(data) case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(data) - case TypeUpdateChatIsSponsored: - return UnmarshalUpdateChatIsSponsored(data) + case TypeUpdateChatIsBlocked: + return UnmarshalUpdateChatIsBlocked(data) case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(data) @@ -11016,15 +12035,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) - case TypeUpdateChatPinnedMessage: - return UnmarshalUpdateChatPinnedMessage(data) - case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(data) case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(data) + case TypeUpdateChatFilters: + return UnmarshalUpdateChatFilters(data) + case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) @@ -11085,6 +12104,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateCall: return UnmarshalUpdateCall(data) + case TypeUpdateNewCallSignalingData: + return UnmarshalUpdateNewCallSignalingData(data) + case TypeUpdateUserPrivacySettingRules: return UnmarshalUpdateUserPrivacySettingRules(data) @@ -11097,6 +12119,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateOption: return UnmarshalUpdateOption(data) + case TypeUpdateStickerSet: + return UnmarshalUpdateStickerSet(data) + case TypeUpdateInstalledStickerSets: return UnmarshalUpdateInstalledStickerSets(data) @@ -11127,6 +12152,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(data) + case TypeUpdateDiceEmojis: + return UnmarshalUpdateDiceEmojis(data) + + case TypeUpdateAnimationSearchParameters: + return UnmarshalUpdateAnimationSearchParameters(data) + + case TypeUpdateSuggestedActions: + return UnmarshalUpdateSuggestedActions(data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(data) diff --git a/data/td_api.json b/data/td_api.json index e5d9cc4..b12d47e 100755 --- a/data/td_api.json +++ b/data/td_api.json @@ -140,7 +140,7 @@ { "name": "system_version", "type": "string", - "description": "Version of the operating system the application is being run on; must be non-empty" + "description": "Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib" }, { "name": "application_version", @@ -161,7 +161,7 @@ }, { "name": "authenticationCodeTypeTelegramMessage", - "description": "An authentication code is delivered via a private Telegram message, which can be viewed in another client", + "description": "An authentication code is delivered via a private Telegram message, which can be viewed from another active session", "class": "AuthenticationCodeType", "properties": [ { @@ -259,7 +259,7 @@ { "name": "offset", "type": "int32", - "description": "Offset of the entity in UTF-16 code units" + "description": "Offset of the entity, in UTF-16 code units" }, { "name": "length", @@ -546,7 +546,7 @@ { "name": "id", "type": "string", - "description": "Remote file identifier; may be empty. Can be used across application restarts or even from other devices for the current user. 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 client with the HTTP URL in the original_path and \"#url#\" as the conversion string. Clients should 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 should generate the file by downloading it to the specified location" }, { "name": "unique_id", @@ -616,7 +616,7 @@ }, { "name": "inputFileRemote", - "description": "A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client", + "description": "A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application", "class": "InputFile", "properties": [ { @@ -640,7 +640,7 @@ }, { "name": "inputFileGenerated", - "description": "A file generated by the client", + "description": "A file generated by the application", "class": "InputFile", "properties": [ { @@ -662,28 +662,33 @@ }, { "name": "photoSize", - "description": "Photo description", + "description": "Describes an image in JPEG format", "class": "PhotoSize", "properties": [ { "name": "type", "type": "string", - "description": "Thumbnail type (see https://core.telegram.org/constructor/photoSize)" + "description": "Image type (see https://core.telegram.org/constructor/photoSize)" }, { "name": "photo", "type": "file", - "description": "Information about the photo file" + "description": "Information about the image file" }, { "name": "width", "type": "int32", - "description": "Photo width" + "description": "Image width" }, { "name": "height", "type": "int32", - "description": "Photo height" + "description": "Image height" + }, + { + "name": "progressive_sizes", + "type": "vector\u003cint32\u003e", + "description": "Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image" } ] }, @@ -709,6 +714,69 @@ } ] }, + { + "name": "thumbnailFormatJpeg", + "description": "The thumbnail is in JPEG format", + "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", + "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", + "class": "Thumbnail", + "properties": [ + { + "name": "format", + "type": "ThumbnailFormat", + "description": "Thumbnail format" + }, + { + "name": "width", + "type": "int32", + "description": "Thumbnail width" + }, + { + "name": "height", + "type": "int32", + "description": "Thumbnail height" + }, + { + "name": "file", + "type": "file", + "description": "The thumbnail" + } + ] + }, { "name": "maskPointForehead", "description": "A mask should be placed relatively to the forehead", @@ -813,6 +881,11 @@ "name": "correct_option_id", "type": "int32", "description": "0-based identifier of the correct answer option; -1 for a yet unanswered poll" + }, + { + "name": "explanation", + "type": "formattedText", + "description": "Text that is shown when the user chooses an incorrect answer or taps on the lamp icon, 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll" } ] }, @@ -846,6 +919,11 @@ "type": "string", "description": "MIME type of the file, usually \"image/gif\" or \"video/mp4\"" }, + { + "name": "has_stickers", + "type": "Bool", + "description": "True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets" + }, { "name": "minithumbnail", "type": "minithumbnail", @@ -853,8 +931,8 @@ }, { "name": "thumbnail", - "type": "photoSize", - "description": "Animation thumbnail; may be null" + "type": "thumbnail", + "description": "Animation thumbnail in JPEG or MPEG4 format; may be null" }, { "name": "animation", @@ -900,8 +978,8 @@ }, { "name": "album_cover_thumbnail", - "type": "photoSize", - "description": "The thumbnail of the album cover; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null" + "type": "thumbnail", + "description": "The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null" }, { "name": "audio", @@ -932,7 +1010,7 @@ }, { "name": "thumbnail", - "type": "photoSize", + "type": "thumbnail", "description": "Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null" }, { @@ -950,7 +1028,7 @@ { "name": "has_stickers", "type": "Bool", - "description": "True, if stickers were added to the photo" + "description": "True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets" }, { "name": "minithumbnail", @@ -1006,7 +1084,7 @@ }, { "name": "thumbnail", - "type": "photoSize", + "type": "thumbnail", "description": "Sticker thumbnail in WEBP or JPEG format; may be null" }, { @@ -1049,7 +1127,7 @@ { "name": "has_stickers", "type": "Bool", - "description": "True, if stickers were added to the video" + "description": "True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets" }, { "name": "supports_streaming", @@ -1063,8 +1141,8 @@ }, { "name": "thumbnail", - "type": "photoSize", - "description": "Video thumbnail; as defined by the sender; may be null" + "type": "thumbnail", + "description": "Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null" }, { "name": "video", @@ -1095,8 +1173,8 @@ }, { "name": "thumbnail", - "type": "photoSize", - "description": "Video thumbnail; as defined by the sender; may be null" + "type": "thumbnail", + "description": "Video thumbnail in JPEG format; as defined by the sender; may be null" }, { "name": "video", @@ -1178,6 +1256,11 @@ "name": "longitude", "type": "double", "description": "Longitude of the location, in degrees; as defined by the sender" + }, + { + "name": "horizontal_accuracy", + "type": "double", + "description": "The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown" } ] }, @@ -1204,7 +1287,7 @@ { "name": "provider", "type": "string", - "description": "Provider of the venue database; as defined by the sender. Currently only \"foursquare\" needs 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", @@ -1273,7 +1356,7 @@ { "name": "question", "type": "string", - "description": "Poll question, 1-255 characters" + "description": "Poll question, 1-300 characters" }, { "name": "options", @@ -1300,6 +1383,16 @@ "type": "PollType", "description": "Type of the poll" }, + { + "name": "open_period", + "type": "int32", + "description": "Amount of time the poll will be active after creation, in seconds" + }, + { + "name": "close_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the poll will be automatically closed" + }, { "name": "is_closed", "type": "Bool", @@ -1315,7 +1408,7 @@ { "name": "id", "type": "int64", - "description": "Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of userProfilePhotos" + "description": "Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos" }, { "name": "small", @@ -1326,23 +1419,33 @@ "name": "big", "type": "file", "description": "A big (640x640) user profile photo. The file can be downloaded only before the photo is changed" + }, + { + "name": "has_animation", + "type": "Bool", + "description": "True, if the photo has animated variant" } ] }, { - "name": "chatPhoto", - "description": "Describes the photo of a chat", - "class": "ChatPhoto", + "name": "chatPhotoInfo", + "description": "Contains basic information about the photo of a chat", + "class": "ChatPhotoInfo", "properties": [ { "name": "small", "type": "file", - "description": "A small (160x160) chat photo. The file can be downloaded only before the photo is changed" + "description": "A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed" }, { "name": "big", "type": "file", - "description": "A big (640x640) chat photo. The file can be downloaded only before the photo is changed" + "description": "A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed" + }, + { + "name": "has_animation", + "type": "Bool", + "description": "True, if the photo has animated variant" } ] }, @@ -1381,7 +1484,7 @@ { "name": "inline_query_placeholder", "type": "string", - "description": "Placeholder for inline queries (displayed on the client input field)" + "description": "Placeholder for inline queries (displayed on the application input field)" }, { "name": "need_location", @@ -1398,7 +1501,7 @@ }, { "name": "botCommand", - "description": "Represents commands supported by a bot", + "description": "Represents a command supported by a bot", "class": "BotCommand", "properties": [ { @@ -1447,6 +1550,118 @@ } ] }, + { + "name": "animatedChatPhoto", + "description": "Animated variant of a chat photo in MPEG4 format", + "class": "AnimatedChatPhoto", + "properties": [ + { + "name": "length", + "type": "int32", + "description": "Animation width and height" + }, + { + "name": "file", + "type": "file", + "description": "Information about the animation file" + }, + { + "name": "main_frame_timestamp", + "type": "double", + "description": "Timestamp of the frame, used as a static chat photo" + } + ] + }, + { + "name": "chatPhoto", + "description": "Describes a chat or user profile photo", + "class": "ChatPhoto", + "properties": [ + { + "name": "id", + "type": "int64", + "description": "Unique photo identifier" + }, + { + "name": "added_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the photo has been added" + }, + { + "name": "minithumbnail", + "type": "minithumbnail", + "description": "Photo minithumbnail; may be null" + }, + { + "name": "sizes", + "type": "vector\u003cphotoSize\u003e", + "description": "Available variants of the photo in JPEG format, in different size" + }, + { + "name": "animation", + "type": "animatedChatPhoto", + "description": "Animated variant of the photo in MPEG4 format; may be null" + } + ] + }, + { + "name": "chatPhotos", + "description": "Contains a list of chat or user profile photos", + "class": "ChatPhotos", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Total number of photos" + }, + { + "name": "photos", + "type": "vector\u003cchatPhoto\u003e", + "description": "List of photos" + } + ] + }, + { + "name": "inputChatPhotoPrevious", + "description": "A previously used profile photo of the current user", + "class": "InputChatPhoto", + "properties": [ + { + "name": "chat_photo_id", + "type": "int64", + "description": "Identifier of the profile photo to reuse" + } + ] + }, + { + "name": "inputChatPhotoStatic", + "description": "A static photo in JPEG format", + "class": "InputChatPhoto", + "properties": [ + { + "name": "photo", + "type": "InputFile", + "description": "Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed" + } + ] + }, + { + "name": "inputChatPhotoAnimation", + "description": "An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 800 and be at most 2MB in size", + "class": "InputChatPhoto", + "properties": [ + { + "name": "animation", + "type": "InputFile", + "description": "Animation to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed" + }, + { + "name": "main_frame_timestamp", + "type": "double", + "description": "Timestamp of the frame, which will be used as static chat photo" + } + ] + }, { "name": "user", "description": "Represents a user", @@ -1536,19 +1751,29 @@ }, { "name": "userFullInfo", - "description": "Contains full information about a user (except the full list of profile photos)", + "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 blacklisted by the current user" + "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", @@ -1581,45 +1806,6 @@ } ] }, - { - "name": "userProfilePhoto", - "description": "Contains full information about a user profile photo", - "class": "UserProfilePhoto", - "properties": [ - { - "name": "id", - "type": "int64", - "description": "Unique user profile photo identifier" - }, - { - "name": "added_date", - "type": "int32", - "description": "Point in time (Unix timestamp) when the photo has been added" - }, - { - "name": "sizes", - "type": "vector\u003cphotoSize\u003e", - "description": "Available variants of the user photo, in different sizes" - } - ] - }, - { - "name": "userProfilePhotos", - "description": "Contains part of the list of user photos", - "class": "UserProfilePhotos", - "properties": [ - { - "name": "total_count", - "type": "int32", - "description": "Total number of user profile photos" - }, - { - "name": "photos", - "type": "vector\u003cuserProfilePhoto\u003e", - "description": "A list of photos" - } - ] - }, { "name": "users", "description": "Represents a list of users", @@ -1694,7 +1880,7 @@ { "name": "can_send_other_messages", "type": "Bool", - "description": "True, if the user can send animations, games, and stickers and use inline bots. Implies can_send_messages permissions" + "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", @@ -1728,6 +1914,11 @@ "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", @@ -1789,6 +1980,11 @@ "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": "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" } ] }, @@ -1856,7 +2052,7 @@ { "name": "joined_chat_date", "type": "int32", - "description": "Point in time (Unix timestamp) when the user joined a chat" + "description": "Point in time (Unix timestamp) when the user joined the chat" }, { "name": "status", @@ -1866,7 +2062,7 @@ { "name": "bot_info", "type": "botInfo", - "description": "If the user is a bot, information about the bot; may be null. Can be null even for a bot if the bot is not a chat member" + "description": "If the user is a bot, information about the bot; may be null. Can be null even for a bot if the bot is not the chat member" } ] }, @@ -1905,6 +2101,18 @@ "class": "ChatMembersFilter", "properties": [] }, + { + "name": "chatMembersFilterMention", + "description": "Returns users which can be mentioned in the chat", + "class": "ChatMembersFilter", + "properties": [ + { + "name": "message_thread_id", + "type": "int53", + "description": "If non-zero, the identifier of the current message thread" + } + ] + }, { "name": "chatMembersFilterRestricted", "description": "Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup", @@ -1983,6 +2191,23 @@ } ] }, + { + "name": "supergroupMembersFilterMention", + "description": "Returns users which can be mentioned in the supergroup", + "class": "SupergroupMembersFilter", + "properties": [ + { + "name": "query", + "type": "string", + "description": "Query to search for" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If non-zero, the identifier of the current message thread" + } + ] + }, { "name": "supergroupMembersFilterBots", "description": "Returns bot members of the supergroup or channel", @@ -2026,6 +2251,11 @@ "description": "Contains full information about a basic group", "class": "BasicGroupFullInfo", "properties": [ + { + "name": "photo", + "type": "chatPhoto", + "description": "Chat photo; may be null" + }, { "name": "description", "type": "string", @@ -2076,7 +2306,7 @@ { "name": "member_count", "type": "int32", - "description": "Member count; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was found through SearchPublicChats" + "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", @@ -2125,6 +2355,11 @@ "description": "Contains full information about a supergroup or channel", "class": "SupergroupFullInfo", "properties": [ + { + "name": "photo", + "type": "chatPhoto", + "description": "Chat photo; may be null" + }, { "name": "description", "type": "string", @@ -2186,9 +2421,9 @@ "description": "True, if the supergroup location can be changed" }, { - "name": "can_view_statistics", + "name": "can_get_statistics", "type": "Bool", - "description": "True, if the channel statistics is available through getChatStatisticsUrl" + "description": "True, if the supergroup or channel statistics are available" }, { "name": "is_all_history_available", @@ -2278,13 +2513,54 @@ { "name": "layer", "type": "int32", - "description": "Secret chat layer; determines features supported by the other client. Video notes are supported if the layer \u003e= 66; 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. Video notes are supported if the layer \u003e= 66; nested text entities and underline and strikethrough entities are supported if the layer \u003e= 101" + } + ] + }, + { + "name": "messageSenderUser", + "description": "The message was sent by a known user", + "class": "MessageSender", + "properties": [ + { + "name": "user_id", + "type": "int32", + "description": "Identifier of the user that sent the message" + } + ] + }, + { + "name": "messageSenderChat", + "description": "The message was sent on behalf of a chat", + "class": "MessageSender", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat that sent the message" + } + ] + }, + { + "name": "messageSenders", + "description": "Represents a list of message senders", + "class": "MessageSenders", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total count of messages senders found" + }, + { + "name": "senders", + "type": "vector\u003cMessageSender\u003e", + "description": "List of message senders" } ] }, { "name": "messageForwardOriginUser", - "description": "The message was originally written by a known user", + "description": "The message was originally sent by a known user", "class": "MessageForwardOrigin", "properties": [ { @@ -2294,9 +2570,26 @@ } ] }, + { + "name": "messageForwardOriginChat", + "description": "The message was originally sent by an anonymous chat administrator on behalf of the chat", + "class": "MessageForwardOrigin", + "properties": [ + { + "name": "sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that originally sent the message" + }, + { + "name": "author_signature", + "type": "string", + "description": "Original message author signature" + } + ] + }, { "name": "messageForwardOriginHiddenUser", - "description": "The message was originally written by a user, which is hidden by their privacy settings", + "description": "The message was originally sent by a user, which is hidden by their privacy settings", "class": "MessageForwardOrigin", "properties": [ { @@ -2319,7 +2612,7 @@ { "name": "message_id", "type": "int53", - "description": "Message identifier of the original message; 0 if unknown" + "description": "Message identifier of the original message" }, { "name": "author_signature", @@ -2343,15 +2636,74 @@ "type": "int32", "description": "Point in time (Unix timestamp) when the message was originally sent" }, + { + "name": "public_service_announcement_type", + "type": "string", + "description": "The type of a public service announcement for the forwarded message" + }, { "name": "from_chat_id", "type": "int53", - "description": "For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown" + "description": "For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown" }, { "name": "from_message_id", "type": "int53", - "description": "For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown" + "description": "For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown" + } + ] + }, + { + "name": "messageReplyInfo", + "description": "Contains information about replies to a message", + "class": "MessageReplyInfo", + "properties": [ + { + "name": "reply_count", + "type": "int32", + "description": "Number of times the message was directly or indirectly replied" + }, + { + "name": "recent_repliers", + "type": "vector\u003cMessageSender\u003e", + "description": "Recent repliers to the message; available in channels with a discussion supergroup" + }, + { + "name": "last_read_inbox_message_id", + "type": "int53", + "description": "Identifier of the last read incoming reply to the message" + }, + { + "name": "last_read_outbox_message_id", + "type": "int53", + "description": "Identifier of the last read outgoing reply to the message" + }, + { + "name": "last_message_id", + "type": "int53", + "description": "Identifier of the last reply to the message" + } + ] + }, + { + "name": "messageInteractionInfo", + "description": "Contains information about interactions with a message", + "class": "MessageInteractionInfo", + "properties": [ + { + "name": "view_count", + "type": "int32", + "description": "Number of times the message was viewed" + }, + { + "name": "forward_count", + "type": "int32", + "description": "Number of times the message was forwarded" + }, + { + "name": "reply_info", + "type": "messageReplyInfo", + "description": "Contains 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" } ] }, @@ -2396,12 +2748,12 @@ { "name": "id", "type": "int53", - "description": "Message identifier, unique for the chat to which the message belongs" + "description": "Message identifier; unique for the chat to which the message belongs" }, { - "name": "sender_user_id", - "type": "int32", - "description": "Identifier of the user who sent the message; 0 if unknown. Currently, it is unknown for channel posts and for channel posts automatically forwarded to discussion group" + "name": "sender", + "type": "MessageSender", + "description": "The sender of the message" }, { "name": "chat_id", @@ -2423,10 +2775,15 @@ "type": "Bool", "description": "True, if the message is outgoing" }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the message is pinned" + }, { "name": "can_be_edited", "type": "Bool", - "description": "True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the client" + "description": "True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application" }, { "name": "can_be_forwarded", @@ -2443,6 +2800,16 @@ "type": "Bool", "description": "True, if the message can be deleted for all users" }, + { + "name": "can_get_statistics", + "type": "Bool", + "description": "True, if the message statistics are available" + }, + { + "name": "can_get_message_thread", + "type": "Bool", + "description": "True, if the message thread info is available" + }, { "name": "is_channel_post", "type": "Bool", @@ -2468,11 +2835,26 @@ "type": "messageForwardInfo", "description": "Information about the initial message sender; may be null" }, + { + "name": "interaction_info", + "type": "messageInteractionInfo", + "description": "Information about interactions with the message; may be null" + }, + { + "name": "reply_in_chat_id", + "type": "int53", + "description": "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" + }, { "name": "reply_to_message_id", "type": "int53", "description": "If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message" }, + { + "name": "message_thread_id", + "type": "int53", + "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", "type": "int32", @@ -2491,12 +2873,7 @@ { "name": "author_signature", "type": "string", - "description": "For channel posts, optional author signature" - }, - { - "name": "views", - "type": "int32", - "description": "Number of times this message was viewed" + "description": "For channel posts and anonymous group messages, optional author signature" }, { "name": "media_album_id", @@ -2542,15 +2919,20 @@ "description": "Contains a list of messages found by a search", "class": "FoundMessages", "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total count of messages found; -1 if unknown" + }, { "name": "messages", "type": "vector\u003cmessage\u003e", "description": "List of messages" }, { - "name": "next_from_search_id", - "type": "int64", - "description": "Value to pass as from_search_id to get more results" + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, there are no more results" } ] }, @@ -2671,6 +3053,11 @@ "type": "int53", "description": "Identifier of the message to reply to; 0 if none" }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the draft was created" + }, { "name": "input_message_text", "type": "InputMessageContent", @@ -2736,6 +3123,129 @@ } ] }, + { + "name": "chatFilter", + "description": "Represents a filter of user chats", + "class": "ChatFilter", + "properties": [ + { + "name": "title", + "type": "string", + "description": "The title of the filter; 1-12 characters without line feeds" + }, + { + "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" + }, + { + "name": "pinned_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "The chat identifiers of pinned chats in the filtered chat list" + }, + { + "name": "included_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "The chat identifiers of always included chats in the filtered chat list" + }, + { + "name": "excluded_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "The chat identifiers of always excluded chats in the filtered chat list" + }, + { + "name": "exclude_muted", + "type": "Bool", + "description": "True, if muted chats need to be excluded" + }, + { + "name": "exclude_read", + "type": "Bool", + "description": "True, if read chats need to be excluded" + }, + { + "name": "exclude_archived", + "type": "Bool", + "description": "True, if archived chats need to be excluded" + }, + { + "name": "include_contacts", + "type": "Bool", + "description": "True, if contacts need to be included" + }, + { + "name": "include_non_contacts", + "type": "Bool", + "description": "True, if non-contact users need to be included" + }, + { + "name": "include_bots", + "type": "Bool", + "description": "True, if bots need to be included" + }, + { + "name": "include_groups", + "type": "Bool", + "description": "True, if basic groups and supergroups need to be included" + }, + { + "name": "include_channels", + "type": "Bool", + "description": "True, if channels need to be included" + } + ] + }, + { + "name": "chatFilterInfo", + "description": "Contains basic information about a chat filter", + "class": "ChatFilterInfo", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Unique chat filter identifier" + }, + { + "name": "title", + "type": "string", + "description": "The title of the filter; 1-12 characters without line feeds" + }, + { + "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\"" + } + ] + }, + { + "name": "recommendedChatFilter", + "description": "Describes a recommended chat filter", + "class": "RecommendedChatFilter", + "properties": [ + { + "name": "filter", + "type": "chatFilter", + "description": "The chat filter" + }, + { + "name": "description", + "type": "string", + "description": "Chat filter description" + } + ] + }, + { + "name": "recommendedChatFilters", + "description": "Contains a list of recommended chat filters", + "class": "RecommendedChatFilters", + "properties": [ + { + "name": "chat_filters", + "type": "vector\u003crecommendedChatFilter\u003e", + "description": "List of recommended chat filters" + } + ] + }, { "name": "chatListMain", "description": "A main list of chats", @@ -2748,6 +3258,80 @@ "class": "ChatList", "properties": [] }, + { + "name": "chatListFilter", + "description": "A list of chats belonging to a chat filter", + "class": "ChatList", + "properties": [ + { + "name": "chat_filter_id", + "type": "int32", + "description": "Chat filter identifier" + } + ] + }, + { + "name": "chatLists", + "description": "Contains a list of chat lists", + "class": "ChatLists", + "properties": [ + { + "name": "chat_lists", + "type": "vector\u003cChatList\u003e", + "description": "List of chat lists" + } + ] + }, + { + "name": "chatSourceMtprotoProxy", + "description": "The chat is sponsored by the user's MTProxy server", + "class": "ChatSource", + "properties": [] + }, + { + "name": "chatSourcePublicServiceAnnouncement", + "description": "The chat contains a public service announcement", + "class": "ChatSource", + "properties": [ + { + "name": "type", + "type": "string", + "description": "The type of the announcement" + }, + { + "name": "text", + "type": "string", + "description": "The text of the announcement" + } + ] + }, + { + "name": "chatPosition", + "description": "Describes a position of a chat in a chat list", + "class": "ChatPosition", + "properties": [ + { + "name": "list", + "type": "ChatList", + "description": "The chat list" + }, + { + "name": "order", + "type": "int64", + "description": "A parameter used to determine order of the chat in the chat list. Chats must be sorted by the pair (order, chat.id) in descending order" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the chat is pinned in the chat list" + }, + { + "name": "source", + "type": "ChatSource", + "description": "Source of the chat in the chat list; may be null" + } + ] + }, { "name": "chat", "description": "A chat. (Can be a private chat, basic group, supergroup, or secret chat)", @@ -2763,11 +3347,6 @@ "type": "ChatType", "description": "Type of the chat" }, - { - "name": "chat_list", - "type": "ChatList", - "description": "A chat list to which the chat belongs; may be null" - }, { "name": "title", "type": "string", @@ -2775,7 +3354,7 @@ }, { "name": "photo", - "type": "chatPhoto", + "type": "chatPhotoInfo", "description": "Chat photo; may be null" }, { @@ -2789,14 +3368,9 @@ "description": "Last message in the chat; may be null" }, { - "name": "order", - "type": "int64", - "description": "Descending parameter by which chats are sorted in the main chat list. If the order number of two chats is the same, they must be sorted in descending order by ID. If 0, the position of the chat in the list is undetermined" - }, - { - "name": "is_pinned", - "type": "Bool", - "description": "True, if the chat is pinned" + "name": "positions", + "type": "vector\u003cchatPosition\u003e", + "description": "Positions of the chat in chat lists" }, { "name": "is_marked_as_unread", @@ -2804,9 +3378,9 @@ "description": "True, if the chat is marked as unread" }, { - "name": "is_sponsored", + "name": "is_blocked", "type": "Bool", - "description": "True, if the chat is sponsored by the user's MTProxy server" + "description": "True, if the chat is blocked by the current user and private messages from the chat can't be received" }, { "name": "has_scheduled_messages", @@ -2863,11 +3437,6 @@ "type": "ChatActionBar", "description": "Describes actions which should be possible to do through a chat action bar; may be null" }, - { - "name": "pinned_message_id", - "type": "int53", - "description": "Identifier of the pinned message in the chat; 0 if none" - }, { "name": "reply_markup_message_id", "type": "int53", @@ -2881,7 +3450,7 @@ { "name": "client_data", "type": "string", - "description": "Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if the message database is used" + "description": "Contains 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" } ] }, @@ -2890,6 +3459,11 @@ "description": "Represents a list of chats", "class": "Chats", "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total count of chats found" + }, { "name": "chat_ids", "type": "vector\u003cint53\u003e", @@ -2910,7 +3484,7 @@ { "name": "distance", "type": "int32", - "description": "Distance to the chat location in meters" + "description": "Distance to the chat location, in meters" } ] }, @@ -2951,7 +3525,12 @@ { "name": "chat_id", "type": "int53", - "description": "Chat identifier of the invite link; 0 if the user is not a member of this chat" + "description": "Chat identifier of the invite link; 0 if the user has no access to the chat before joining" + }, + { + "name": "accessible_for", + "type": "int32", + "description": "If non-zero, the amount of time for which read access to the chat will remain available, in seconds" }, { "name": "type", @@ -2965,13 +3544,13 @@ }, { "name": "photo", - "type": "chatPhoto", + "type": "chatPhotoInfo", "description": "Chat photo; may be null" }, { "name": "member_count", "type": "int32", - "description": "Number of members" + "description": "Number of members in the chat" }, { "name": "member_user_ids", @@ -3001,7 +3580,13 @@ "name": "chatActionBarReportSpam", "description": "The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam", "class": "ChatActionBar", - "properties": [] + "properties": [ + { + "name": "can_unarchive", + "type": "Bool", + "description": "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" + } + ] }, { "name": "chatActionBarReportUnrelatedLocation", @@ -3011,9 +3596,20 @@ }, { "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 added to the contact list using the method addContact, or the other user can be blocked using the method blockUser", + "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 blockUser, or the other user can be added to the contact list using the method addContact", "class": "ChatActionBar", - "properties": [] + "properties": [ + { + "name": "can_unarchive", + "type": "Bool", + "description": "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" + }, + { + "name": "distance", + "type": "int32", + "description": "If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users" + } + ] }, { "name": "chatActionBarAddContact", @@ -3115,7 +3711,19 @@ }, { "name": "inlineKeyboardButtonTypeCallback", - "description": "A button that sends a special callback query to a bot", + "description": "A button that sends a callback query to a bot", + "class": "InlineKeyboardButtonType", + "properties": [ + { + "name": "data", + "type": "bytes", + "description": "Data to be sent to the bot via a callback query" + } + ] + }, + { + "name": "inlineKeyboardButtonTypeCallbackWithPassword", + "description": "A button that asks for password of the current user and then sends a callback query to a bot", "class": "InlineKeyboardButtonType", "properties": [ { @@ -3127,7 +3735,7 @@ }, { "name": "inlineKeyboardButtonTypeCallbackGame", - "description": "A button with a game that sends a special callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame", + "description": "A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame", "class": "InlineKeyboardButtonType", "properties": [] }, @@ -3173,7 +3781,7 @@ }, { "name": "replyMarkupRemoveKeyboard", - "description": "Instructs clients 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": [ { @@ -3185,7 +3793,7 @@ }, { "name": "replyMarkupForceReply", - "description": "Instructs clients to force a reply to this message", + "description": "Instructs application to force a reply to this message", "class": "ReplyMarkup", "properties": [ { @@ -3208,12 +3816,12 @@ { "name": "resize_keyboard", "type": "Bool", - "description": "True, if the client needs to resize the keyboard vertically" + "description": "True, if the application needs to resize the keyboard vertically" }, { "name": "one_time", "type": "Bool", - "description": "True, if the client needs to hide the keyboard after use" + "description": "True, if the application needs to hide the keyboard after use" }, { "name": "is_personal", @@ -3278,6 +3886,38 @@ } ] }, + { + "name": "messageThreadInfo", + "description": "Contains information about a message thread", + "class": "MessageThreadInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message thread belongs" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier, unique within the chat" + }, + { + "name": "reply_info", + "type": "messageReplyInfo", + "description": "Contains information about the message thread" + }, + { + "name": "messages", + "type": "vector\u003cmessage\u003e", + "description": "The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)" + }, + { + "name": "draft_message", + "type": "draftMessage", + "description": "A draft of a message in the message thread; may be null" + } + ] + }, { "name": "richTextPlain", "description": "A plain text", @@ -3465,15 +4105,32 @@ ] }, { - "name": "richTextAnchor", - "description": "A rich text anchor", + "name": "richTextReference", + "description": "A reference to a richTexts object on the same web page", "class": "RichText", "properties": [ { "name": "text", "type": "RichText", - "description": "Text" + "description": "The text" }, + { + "name": "anchor_name", + "type": "string", + "description": "The name of a richTextAnchor object, which is the first element of the target richTexts object" + }, + { + "name": "url", + "type": "string", + "description": "An HTTP URL, opening the reference" + } + ] + }, + { + "name": "richTextAnchor", + "description": "An anchor", + "class": "RichText", + "properties": [ { "name": "name", "type": "string", @@ -3481,6 +4138,28 @@ } ] }, + { + "name": "richTextAnchorLink", + "description": "A link to an anchor on the same web page", + "class": "RichText", + "properties": [ + { + "name": "text", + "type": "RichText", + "description": "The link text" + }, + { + "name": "anchor_name", + "type": "string", + "description": "The anchor name. If the name is empty, the link should bring back to top" + }, + { + "name": "url", + "type": "string", + "description": "An HTTP URL, opening the anchor" + } + ] + }, { "name": "richTexts", "description": "A concatenation of rich texts", @@ -4066,7 +4745,7 @@ }, { "name": "photo", - "type": "chatPhoto", + "type": "chatPhotoInfo", "description": "Chat photo; may be null" }, { @@ -4184,16 +4863,16 @@ "type": "vector\u003cPageBlock\u003e", "description": "Content of the web page" }, + { + "name": "view_count", + "type": "int32", + "description": "Number of the instant view views; 0 if unknown" + }, { "name": "version", "type": "int32", "description": "Version of the instant view, currently can be 1 or 2" }, - { - "name": "url", - "type": "string", - "description": "Instant view URL; may be different from WebPage.url and must be used for the correct anchors handling" - }, { "name": "is_rtl", "type": "Bool", @@ -4238,7 +4917,7 @@ }, { "name": "description", - "type": "string", + "type": "formattedText", "description": "Description of the content" }, { @@ -4318,6 +4997,106 @@ } ] }, + { + "name": "countryInfo", + "description": "Contains information about a country", + "class": "CountryInfo", + "properties": [ + { + "name": "country_code", + "type": "string", + "description": "A two-letter ISO 3166-1 alpha-2 country code" + }, + { + "name": "name", + "type": "string", + "description": "Native name of the country" + }, + { + "name": "english_name", + "type": "string", + "description": "English name of the country" + }, + { + "name": "is_hidden", + "type": "Bool", + "description": "True, if the country should be hidden from the list of all countries" + }, + { + "name": "calling_codes", + "type": "vector\u003cstring\u003e", + "description": "List of country calling codes" + } + ] + }, + { + "name": "countries", + "description": "Contains information about countries", + "class": "Countries", + "properties": [ + { + "name": "countries", + "type": "vector\u003ccountryInfo\u003e", + "description": "The list of countries" + } + ] + }, + { + "name": "phoneNumberInfo", + "description": "Contains information about a phone number", + "class": "PhoneNumberInfo", + "properties": [ + { + "name": "country", + "type": "countryInfo", + "description": "Information about the country to which the phone number belongs; may be null" + }, + { + "name": "country_calling_code", + "type": "string", + "description": "The part of the phone number denoting country calling code or its part" + }, + { + "name": "formatted_phone_number", + "type": "string", + "description": "The phone number without country calling code formatted accordingly to local rules" + } + ] + }, + { + "name": "bankCardActionOpenUrl", + "description": "Describes an action associated with a bank card number", + "class": "BankCardActionOpenUrl", + "properties": [ + { + "name": "text", + "type": "string", + "description": "Action text" + }, + { + "name": "url", + "type": "string", + "description": "The URL to be opened" + } + ] + }, + { + "name": "bankCardInfo", + "description": "Information about a bank card", + "class": "BankCardInfo", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Title of the bank card description" + }, + { + "name": "actions", + "type": "vector\u003cbankCardActionOpenUrl\u003e", + "description": "Actions that can be done with the bank card number" + } + ] + }, { "name": "address", "description": "Describes an address", @@ -5440,7 +6219,7 @@ { "name": "required_elements", "type": "vector\u003cpassportRequiredElement\u003e", - "description": "Information about the Telegram Passport elements that need to be provided to complete the form" + "description": "Information about the Telegram Passport elements that must be provided to complete the form" }, { "name": "privacy_policy_url", @@ -5873,12 +6652,22 @@ { "name": "live_period", "type": "int32", - "description": "Time relative to the message sent date until which the location can be updated, in seconds" + "description": "Time relative to the message send date, for which the location can be updated, in seconds" }, { "name": "expires_in", "type": "int32", "description": "Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes" + }, + { + "name": "heading", + "type": "int32", + "description": "For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown" + }, + { + "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" } ] }, @@ -5906,6 +6695,38 @@ } ] }, + { + "name": "messageDice", + "description": "A dice message. The dice value is randomly generated by the server", + "class": "MessageContent", + "properties": [ + { + "name": "initial_state", + "type": "DiceStickers", + "description": "The animated stickers with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known" + }, + { + "name": "final_state", + "type": "DiceStickers", + "description": "The animated stickers with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known" + }, + { + "name": "emoji", + "type": "string", + "description": "Emoji on which the dice throw animation is based" + }, + { + "name": "value", + "type": "int32", + "description": "The dice value. If the value is 0, the dice don't have final state yet" + }, + { + "name": "success_animation_frame_number", + "type": "int32", + "description": "Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded" + } + ] + }, { "name": "messageGame", "description": "A message with a game", @@ -5987,6 +6808,11 @@ "description": "A message with information about an ended call", "class": "MessageContent", "properties": [ + { + "name": "is_video", + "type": "Bool", + "description": "True, if the call was a video call" + }, { "name": "discard_reason", "type": "CallDiscardReason", @@ -6047,7 +6873,7 @@ "properties": [ { "name": "photo", - "type": "photo", + "type": "chatPhoto", "description": "New chat photo" } ] @@ -6297,9 +7123,31 @@ } ] }, + { + "name": "messageProximityAlertTriggered", + "description": "A user in the chat came within proximity alert range", + "class": "MessageContent", + "properties": [ + { + "name": "traveler", + "type": "MessageSender", + "description": "The user or chat, which triggered the proximity alert" + }, + { + "name": "watcher", + "type": "MessageSender", + "description": "The user or chat, which subscribed for the proximity alert" + }, + { + "name": "distance", + "type": "int32", + "description": "The distance between the users" + } + ] + }, { "name": "messageUnsupported", - "description": "Message content that is not supported by the client", + "description": "Message content that is not supported in the current TDLib version", "class": "MessageContent", "properties": [] }, @@ -6345,6 +7193,12 @@ "class": "TextEntityType", "properties": [] }, + { + "name": "textEntityTypeBankCardNumber", + "description": "A bank card number. The getBankCardInfo method can be used to get information about the bank card", + "class": "TextEntityType", + "properties": [] + }, { "name": "textEntityTypeBold", "description": "A bold text", @@ -6419,7 +7273,7 @@ }, { "name": "inputThumbnail", - "description": "A thumbnail to be sent along with a file; should be in JPEG or WEBP format for stickers, and less than 200 kB in size", + "description": "A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size", "class": "InputThumbnail", "properties": [ { @@ -6458,14 +7312,14 @@ "properties": [] }, { - "name": "sendMessageOptions", - "description": "Options to be used when a message is send", - "class": "SendMessageOptions", + "name": "messageSendOptions", + "description": "Options to be used when a message is sent", + "class": "MessageSendOptions", "properties": [ { "name": "disable_notification", "type": "Bool", - "description": "Pass true to disable notification for the message. Must be false if the message is sent to a secret chat" + "description": "Pass true to disable notification for the message" }, { "name": "from_background", @@ -6479,6 +7333,28 @@ } ] }, + { + "name": "messageCopyOptions", + "description": "Options to be used when a message content is copied without a link to the original message", + "class": "MessageCopyOptions", + "properties": [ + { + "name": "send_copy", + "type": "Bool", + "description": "True, if content of the message needs to be copied without a link to the original message. Always true if the message is forwarded to a secret chat" + }, + { + "name": "replace_caption", + "type": "Bool", + "description": "True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false" + }, + { + "name": "new_caption", + "type": "formattedText", + "description": "New message caption. Ignored if replace_caption is false" + } + ] + }, { "name": "inputMessageText", "description": "A text message", @@ -6516,6 +7392,11 @@ "type": "inputThumbnail", "description": "Animation thumbnail, if available" }, + { + "name": "added_sticker_file_ids", + "type": "vector\u003cint32\u003e", + "description": "File identifiers of the stickers added to the animation, if applicable" + }, { "name": "duration", "type": "int32", @@ -6590,6 +7471,11 @@ "type": "inputThumbnail", "description": "Document thumbnail, if available" }, + { + "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" + }, { "name": "caption", "type": "formattedText", @@ -6786,6 +7672,16 @@ "name": "live_period", "type": "int32", "description": "Period for which the location can be updated, in seconds; should be between 60 and 86400 for a live location and 0 otherwise" + }, + { + "name": "heading", + "type": "int32", + "description": "For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown" + }, + { + "name": "proximity_alert_radius", + "type": "int32", + "description": "For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can't be enabled in channels and Saved Messages" } ] }, @@ -6813,6 +7709,23 @@ } ] }, + { + "name": "inputMessageDice", + "description": "A dice message", + "class": "InputMessageContent", + "properties": [ + { + "name": "emoji", + "type": "string", + "description": "Emoji on which the dice throw animation is based" + }, + { + "name": "clear_draft", + "type": "Bool", + "description": "True, if a chat message draft should be deleted" + } + ] + }, { "name": "inputMessageGame", "description": "A message with a game; not supported for channels or secret chats", @@ -6900,7 +7813,7 @@ { "name": "question", "type": "string", - "description": "Poll question, 1-255 characters" + "description": "Poll question, 1-255 characters (up to 300 characters for bots)" }, { "name": "options", @@ -6917,6 +7830,16 @@ "type": "PollType", "description": "Type of the poll" }, + { + "name": "open_period", + "type": "int32", + "description": "Amount of time the poll will be active after creation, in seconds; for bots only" + }, + { + "name": "close_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the poll will be automatically closed; for bots only" + }, { "name": "is_closed", "type": "Bool", @@ -6945,14 +7868,9 @@ "description": "True, if a game message should be shared within a launched game; applies only to game messages" }, { - "name": "send_copy", - "type": "Bool", - "description": "True, if content of the message needs to be copied without a link to the original message. Always true if the message is forwarded to a secret chat" - }, - { - "name": "remove_caption", - "type": "Bool", - "description": "True, if media caption of the message copy needs to be removed. Ignored if send_copy is false" + "name": "copy_options", + "type": "messageCopyOptions", + "description": "Options to be used to copy content of the message without a link to the original message" } ] }, @@ -7048,7 +7966,19 @@ }, { "name": "searchMessagesFilterUnreadMention", - "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 or by the sending user", + "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", + "class": "SearchMessagesFilter", + "properties": [] + }, + { + "name": "searchMessagesFilterFailedToSend", + "description": "Returns only failed to send messages. This filter can be used only if the message database is used", + "class": "SearchMessagesFilter", + "properties": [] + }, + { + "name": "searchMessagesFilterPinned", + "description": "Returns only pinned messages", "class": "SearchMessagesFilter", "properties": [] }, @@ -7254,8 +8184,8 @@ }, { "name": "thumbnail", - "type": "photoSize", - "description": "Sticker set thumbnail in WEBP format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed" + "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" }, { "name": "is_installed", @@ -7321,8 +8251,8 @@ }, { "name": "thumbnail", - "type": "photoSize", - "description": "Sticker set thumbnail in WEBP format with width and height 100; may be null" + "type": "thumbnail", + "description": "Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null" }, { "name": "is_installed", @@ -7362,7 +8292,7 @@ { "name": "covers", "type": "vector\u003csticker\u003e", - "description": "Contains up to the first 5 stickers from the set, depending on the context. If the client needs more stickers the full set should be requested" + "description": "Contains up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full set should be requested" } ] }, @@ -7437,38 +8367,82 @@ "name": "max_layer", "type": "int32", "description": "The maximum supported API layer; use 65" + }, + { + "name": "library_versions", + "type": "vector\u003cstring\u003e", + "description": "List of supported libtgvoip versions" } ] }, { - "name": "callConnection", - "description": "Describes the address of UDP reflectors", - "class": "CallConnection", + "name": "callServerTypeTelegramReflector", + "description": "A Telegram call reflector", + "class": "CallServerType", + "properties": [ + { + "name": "peer_tag", + "type": "bytes", + "description": "A peer tag to be used with the reflector" + } + ] + }, + { + "name": "callServerTypeWebrtc", + "description": "A WebRTC server", + "class": "CallServerType", + "properties": [ + { + "name": "username", + "type": "string", + "description": "Username to be used for authentication" + }, + { + "name": "password", + "type": "string", + "description": "Authentication password" + }, + { + "name": "supports_turn", + "type": "Bool", + "description": "True, if the server supports TURN" + }, + { + "name": "supports_stun", + "type": "Bool", + "description": "True, if the server supports STUN" + } + ] + }, + { + "name": "callServer", + "description": "Describes a server for relaying call data", + "class": "CallServer", "properties": [ { "name": "id", "type": "int64", - "description": "Reflector identifier" + "description": "Server identifier" }, { - "name": "ip", + "name": "ip_address", "type": "string", - "description": "IPv4 reflector address" + "description": "Server IPv4 address" }, { - "name": "ipv6", + "name": "ipv6_address", "type": "string", - "description": "IPv6 reflector address" + "description": "Server IPv6 address" }, { "name": "port", "type": "int32", - "description": "Reflector port number" + "description": "Server port number" }, { - "name": "peer_tag", - "type": "bytes", - "description": "Connection peer tag" + "name": "type", + "type": "CallServerType", + "description": "Server type" } ] }, @@ -7518,9 +8492,9 @@ "description": "Call protocols supported by the peer" }, { - "name": "connections", - "type": "vector\u003ccallConnection\u003e", - "description": "Available UDP reflectors" + "name": "servers", + "type": "vector\u003ccallServer\u003e", + "description": "List of available call servers" }, { "name": "config", @@ -7626,6 +8600,18 @@ "class": "CallProblem", "properties": [] }, + { + "name": "callProblemDistortedVideo", + "description": "The video was distorted", + "class": "CallProblem", + "properties": [] + }, + { + "name": "callProblemPixelatedVideo", + "description": "The video was pixelated", + "class": "CallProblem", + "properties": [] + }, { "name": "call", "description": "Describes a call", @@ -7646,6 +8632,11 @@ "type": "Bool", "description": "True, if the call is outgoing" }, + { + "name": "is_video", + "type": "Bool", + "description": "True, if the call is a video call" + }, { "name": "state", "type": "CallState", @@ -7671,7 +8662,7 @@ { "name": "allow_sms_retriever_api", "type": "Bool", - "description": "For official applications only. True, if the app can use Android SMS Retriever API (requires Google Play Services \u003e= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details" + "description": "For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services \u003e= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details" } ] }, @@ -7687,6 +8678,50 @@ } ] }, + { + "name": "diceStickersRegular", + "description": "A regular animated sticker", + "class": "DiceStickers", + "properties": [ + { + "name": "sticker", + "type": "sticker", + "description": "The animated sticker with the dice animation" + } + ] + }, + { + "name": "diceStickersSlotMachine", + "description": "Animated stickers to be combined into a slot machine", + "class": "DiceStickers", + "properties": [ + { + "name": "background", + "type": "sticker", + "description": "The animated sticker with the slot machine background. The background animation must start playing after all reel animations finish" + }, + { + "name": "lever", + "type": "sticker", + "description": "The animated sticker with the lever animation. The lever animation must play once in the initial dice state" + }, + { + "name": "left_reel", + "type": "sticker", + "description": "The animated sticker with the left reel" + }, + { + "name": "center_reel", + "type": "sticker", + "description": "The animated sticker with the center reel" + }, + { + "name": "right_reel", + "type": "sticker", + "description": "The animated sticker with the right reel" + } + ] + }, { "name": "importedContacts", "description": "Represents the result of an ImportContacts request", @@ -7717,8 +8752,8 @@ ] }, { - "name": "inputInlineQueryResultAnimatedGif", - "description": "Represents a link to an animated GIF", + "name": "inputInlineQueryResultAnimation", + "description": "Represents a link to an animated GIF or an animated (i.e. without sound) H.264/MPEG-4 AVC video", "class": "InputInlineQueryResult", "properties": [ { @@ -7734,77 +8769,35 @@ { "name": "thumbnail_url", "type": "string", - "description": "URL of the static result thumbnail (JPEG or GIF), if it exists" + "description": "URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists" }, { - "name": "gif_url", + "name": "thumbnail_mime_type", "type": "string", - "description": "The URL of the GIF-file (file size must not exceed 1MB)" + "description": "MIME type of the video thumbnail. If non-empty, must be one of \"image/jpeg\", \"image/gif\" and \"video/mp4\"" }, { - "name": "gif_duration", - "type": "int32", - "description": "Duration of the GIF, in seconds" - }, - { - "name": "gif_width", - "type": "int32", - "description": "Width of the GIF" - }, - { - "name": "gif_height", - "type": "int32", - "description": "Height of the GIF" - }, - { - "name": "reply_markup", - "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" - }, - { - "name": "input_message_content", - "type": "InputMessageContent", - "description": "The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageAnimation, InputMessageLocation, InputMessageVenue or InputMessageContact" - } - ] - }, - { - "name": "inputInlineQueryResultAnimatedMpeg4", - "description": "Represents a link to an animated (i.e. without sound) H.264/MPEG-4 AVC video", - "class": "InputInlineQueryResult", - "properties": [ - { - "name": "id", + "name": "video_url", "type": "string", - "description": "Unique identifier of the query result" + "description": "The URL of the video file (file size must not exceed 1MB)" }, { - "name": "title", + "name": "video_mime_type", "type": "string", - "description": "Title of the result" + "description": "MIME type of the video file. Must be one of \"image/gif\" and \"video/mp4\"" }, { - "name": "thumbnail_url", - "type": "string", - "description": "URL of the static result thumbnail (JPEG or GIF), if it exists" - }, - { - "name": "mpeg4_url", - "type": "string", - "description": "The URL of the MPEG4-file (file size must not exceed 1MB)" - }, - { - "name": "mpeg4_duration", + "name": "video_duration", "type": "int32", "description": "Duration of the video, in seconds" }, { - "name": "mpeg4_width", + "name": "video_width", "type": "int32", "description": "Width of the video" }, { - "name": "mpeg4_height", + "name": "video_height", "type": "int32", "description": "Height of the video" }, @@ -8359,8 +9352,8 @@ }, { "name": "thumbnail", - "type": "photoSize", - "description": "Result thumbnail; may be null" + "type": "thumbnail", + "description": "Result thumbnail in JPEG format; may be null" } ] }, @@ -8381,8 +9374,8 @@ }, { "name": "thumbnail", - "type": "photoSize", - "description": "Result thumbnail; may be null" + "type": "thumbnail", + "description": "Result thumbnail in JPEG format; may be null" } ] }, @@ -8408,8 +9401,8 @@ }, { "name": "thumbnail", - "type": "photoSize", - "description": "Result thumbnail; may be null" + "type": "thumbnail", + "description": "Result thumbnail in JPEG format; may be null" } ] }, @@ -8430,8 +9423,8 @@ }, { "name": "thumbnail", - "type": "photoSize", - "description": "Result thumbnail; may be null" + "type": "thumbnail", + "description": "Result thumbnail in JPEG format; may be null" } ] }, @@ -8645,7 +9638,7 @@ }, { "name": "callbackQueryPayloadData", - "description": "The payload from a general callback button", + "description": "The payload for a general callback button", "class": "CallbackQueryPayload", "properties": [ { @@ -8655,9 +9648,26 @@ } ] }, + { + "name": "callbackQueryPayloadDataWithPassword", + "description": "The payload for a callback button requiring password", + "class": "CallbackQueryPayload", + "properties": [ + { + "name": "password", + "type": "string", + "description": "The password for the current user" + }, + { + "name": "data", + "type": "bytes", + "description": "Data that was attached to the callback button" + } + ] + }, { "name": "callbackQueryPayloadGame", - "description": "The payload from a game callback button", + "description": "The payload for a game callback button", "class": "CallbackQueryPayload", "properties": [ { @@ -8792,7 +9802,13 @@ "name": "chatEventMessageUnpinned", "description": "A message was unpinned", "class": "ChatEventAction", - "properties": [] + "properties": [ + { + "name": "message", + "type": "message", + "description": "Unpinned message" + } + ] }, { "name": "chatEventMemberJoined", @@ -8942,12 +9958,12 @@ "properties": [ { "name": "old_photo", - "type": "photo", + "type": "chatPhoto", "description": "Previous chat photo value; may be null" }, { "name": "new_photo", - "type": "photo", + "type": "chatPhoto", "description": "New chat photo value; may be null" } ] @@ -10154,6 +11170,16 @@ "name": "has_videos", "type": "Bool", "description": "True, if the album has at least one video" + }, + { + "name": "has_audios", + "type": "Bool", + "description": "True, if the album has at least one audio file" + }, + { + "name": "has_documents", + "type": "Bool", + "description": "True, if the album has at least one document" } ] }, @@ -10195,12 +11221,22 @@ { "name": "message_id", "type": "int53", - "description": "The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages and as reply_to_message_id" + "description": "The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id" }, { - "name": "sender_user_id", - "type": "int32", - "description": "Sender of the message. Corresponding user may be inaccessible" + "name": "sender", + "type": "MessageSender", + "description": "The sender of the message. Corresponding user or chat may be inaccessible" + }, + { + "name": "sender_name", + "type": "string", + "description": "Name of the sender" + }, + { + "name": "is_outgoing", + "type": "Bool", + "description": "True, if the message is outgoing" }, { "name": "content", @@ -10317,7 +11353,7 @@ "properties": [ { "name": "value", - "type": "int32", + "type": "int64", "description": "The value of the option" } ] @@ -10768,9 +11804,9 @@ ] }, { - "name": "publicMessageLink", - "description": "Contains a public HTTPS link to a message in a supergroup or channel with a username", - "class": "PublicMessageLink", + "name": "messageLink", + "description": "Contains an HTTPS link to a message in a supergroup or channel", + "class": "MessageLink", "properties": [ { "name": "link", @@ -10778,9 +11814,9 @@ "description": "Message link" }, { - "name": "html", - "type": "string", - "description": "HTML-code for embedding the message" + "name": "is_public", + "type": "Bool", + "description": "True, if the link will work for non-members of the chat" } ] }, @@ -10808,6 +11844,11 @@ "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" } ] }, @@ -11126,7 +12167,7 @@ { "name": "since_date", "type": "int32", - "description": "Point in time (Unix timestamp) when the app began collecting statistics" + "description": "Point in time (Unix timestamp) from which the statistics are collected" }, { "name": "entries", @@ -11168,7 +12209,7 @@ { "name": "preload_large_videos", "type": "Bool", - "description": "True, if the beginning of videos needs to be preloaded for instant playback" + "description": "True, if the beginning of video files needs to be preloaded for instant playback" }, { "name": "preload_next_audio", @@ -11224,7 +12265,7 @@ }, { "name": "connectionStateUpdating", - "description": "Downloading data received while the client was offline", + "description": "Downloading data received while the application was offline", "class": "ConnectionState", "properties": [] }, @@ -11353,6 +12394,18 @@ } ] }, + { + "name": "suggestedActionEnableArchiveAndMuteNewChats", + "description": "Suggests the user to enable \"archive_and_mute_new_chats_from_unknown_users\" option", + "class": "SuggestedAction", + "properties": [] + }, + { + "name": "suggestedActionCheckPhoneNumber", + "description": "Suggests the user to check authorization phone number and change the phone number if it is inaccessible", + "class": "SuggestedAction", + "properties": [] + }, { "name": "count", "description": "Contains a counter", @@ -11408,19 +12461,19 @@ }, { "name": "textParseModeMarkdown", - "description": "The text should be parsed in markdown-style", + "description": "The text uses Markdown-style formatting", "class": "TextParseMode", "properties": [ { "name": "version", "type": "int32", - "description": "Version of the parser: 0 or 1 - Bot API Markdown parse mode, 2 - Bot API MarkdownV2 parse mode" + "description": "Version of the parser: 0 or 1 - Telegram Bot API \"Markdown\" parse mode, 2 - Telegram Bot API \"MarkdownV2\" parse mode" } ] }, { "name": "textParseModeHTML", - "description": "The text should be parsed in HTML-style", + "description": "The text uses HTML-style formatting. The same as Telegram Bot API \"HTML\" parse mode", "class": "TextParseMode", "properties": [] }, @@ -11459,7 +12512,7 @@ { "name": "http_only", "type": "Bool", - "description": "Pass true, if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method" + "description": "Pass true if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method" } ] }, @@ -11525,19 +12578,19 @@ ] }, { - "name": "inputSticker", - "description": "Describes a sticker that should 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": "png_sticker", + "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": "PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square" }, { "name": "emojis", "type": "string", - "description": "Emoji corresponding to the sticker" + "description": "Emojis corresponding to the sticker" }, { "name": "mask_position", @@ -11546,6 +12599,372 @@ } ] }, + { + "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": "dateRange", + "description": "Represents a date range", + "class": "DateRange", + "properties": [ + { + "name": "start_date", + "type": "int32", + "description": "Point in time (Unix timestamp) at which the date range begins" + }, + { + "name": "end_date", + "type": "int32", + "description": "Point in time (Unix timestamp) at which the date range ends" + } + ] + }, + { + "name": "statisticalValue", + "description": "A value with information about its recent changes", + "class": "StatisticalValue", + "properties": [ + { + "name": "value", + "type": "double", + "description": "The current value" + }, + { + "name": "previous_value", + "type": "double", + "description": "The value for the previous day" + }, + { + "name": "growth_rate_percentage", + "type": "double", + "description": "The growth rate of the value, as a percentage" + } + ] + }, + { + "name": "statisticalGraphData", + "description": "A graph data", + "class": "StatisticalGraph", + "properties": [ + { + "name": "json_data", + "type": "string", + "description": "Graph data in JSON format" + }, + { + "name": "zoom_token", + "type": "string", + "description": "If non-empty, a token which can be used to receive a zoomed in graph" + } + ] + }, + { + "name": "statisticalGraphAsync", + "description": "The graph data to be asynchronously loaded through getStatisticalGraph", + "class": "StatisticalGraph", + "properties": [ + { + "name": "token", + "type": "string", + "description": "The token to use for data loading" + } + ] + }, + { + "name": "statisticalGraphError", + "description": "An error message to be shown to the user instead of the graph", + "class": "StatisticalGraph", + "properties": [ + { + "name": "error_message", + "type": "string", + "description": "The error message" + } + ] + }, + { + "name": "chatStatisticsMessageInteractionInfo", + "description": "Contains statistics about interactions with a message", + "class": "ChatStatisticsMessageInteractionInfo", + "properties": [ + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "view_count", + "type": "int32", + "description": "Number of times the message was viewed" + }, + { + "name": "forward_count", + "type": "int32", + "description": "Number of times the message was forwarded" + } + ] + }, + { + "name": "chatStatisticsMessageSenderInfo", + "description": "Contains statistics about messages sent by a user", + "class": "ChatStatisticsMessageSenderInfo", + "properties": [ + { + "name": "user_id", + "type": "int32", + "description": "User identifier" + }, + { + "name": "sent_message_count", + "type": "int32", + "description": "Number of sent messages" + }, + { + "name": "average_character_count", + "type": "int32", + "description": "Average number of characters in sent messages" + } + ] + }, + { + "name": "chatStatisticsAdministratorActionsInfo", + "description": "Contains statistics about administrator actions done by a user", + "class": "ChatStatisticsAdministratorActionsInfo", + "properties": [ + { + "name": "user_id", + "type": "int32", + "description": "Administrator user identifier" + }, + { + "name": "deleted_message_count", + "type": "int32", + "description": "Number of messages deleted by the administrator" + }, + { + "name": "banned_user_count", + "type": "int32", + "description": "Number of users banned by the administrator" + }, + { + "name": "restricted_user_count", + "type": "int32", + "description": "Number of users restricted by the administrator" + } + ] + }, + { + "name": "chatStatisticsInviterInfo", + "description": "Contains statistics about number of new members invited by a user", + "class": "ChatStatisticsInviterInfo", + "properties": [ + { + "name": "user_id", + "type": "int32", + "description": "User identifier" + }, + { + "name": "added_member_count", + "type": "int32", + "description": "Number of new members invited by the user" + } + ] + }, + { + "name": "chatStatisticsSupergroup", + "description": "A detailed statistics about a supergroup chat", + "class": "ChatStatistics", + "properties": [ + { + "name": "period", + "type": "dateRange", + "description": "A period to which the statistics applies" + }, + { + "name": "member_count", + "type": "statisticalValue", + "description": "Number of members in the chat" + }, + { + "name": "message_count", + "type": "statisticalValue", + "description": "Number of messages sent to the chat" + }, + { + "name": "viewer_count", + "type": "statisticalValue", + "description": "Number of users who viewed messages in the chat" + }, + { + "name": "sender_count", + "type": "statisticalValue", + "description": "Number of users who sent messages to the chat" + }, + { + "name": "member_count_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of members in the chat" + }, + { + "name": "join_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of members joined and left the chat" + }, + { + "name": "join_by_source_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of new member joins per source" + }, + { + "name": "language_graph", + "type": "StatisticalGraph", + "description": "A graph containing distribution of active users per language" + }, + { + "name": "message_content_graph", + "type": "StatisticalGraph", + "description": "A graph containing distribution of sent messages by content type" + }, + { + "name": "action_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of different actions in the chat" + }, + { + "name": "day_graph", + "type": "StatisticalGraph", + "description": "A graph containing distribution of message views per hour" + }, + { + "name": "week_graph", + "type": "StatisticalGraph", + "description": "A graph containing distribution of message views per day of week" + }, + { + "name": "top_senders", + "type": "vector\u003cchatStatisticsMessageSenderInfo\u003e", + "description": "List of users sent most messages in the last week" + }, + { + "name": "top_administrators", + "type": "vector\u003cchatStatisticsAdministratorActionsInfo\u003e", + "description": "List of most active administrators in the last week" + }, + { + "name": "top_inviters", + "type": "vector\u003cchatStatisticsInviterInfo\u003e", + "description": "List of most active inviters of new members in the last week" + } + ] + }, + { + "name": "chatStatisticsChannel", + "description": "A detailed statistics about a channel chat", + "class": "ChatStatistics", + "properties": [ + { + "name": "period", + "type": "dateRange", + "description": "A period to which the statistics applies" + }, + { + "name": "member_count", + "type": "statisticalValue", + "description": "Number of members in the chat" + }, + { + "name": "mean_view_count", + "type": "statisticalValue", + "description": "Mean number of times the recently sent messages was viewed" + }, + { + "name": "mean_share_count", + "type": "statisticalValue", + "description": "Mean number of times the recently sent messages was shared" + }, + { + "name": "enabled_notifications_percentage", + "type": "double", + "description": "A percentage of users with enabled notifications for the chat" + }, + { + "name": "member_count_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of members in the chat" + }, + { + "name": "join_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of members joined and left the chat" + }, + { + "name": "mute_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of members muted and unmuted the chat" + }, + { + "name": "view_count_by_hour_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of message views in a given hour in the last two weeks" + }, + { + "name": "view_count_by_source_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of message views per source" + }, + { + "name": "join_by_source_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of new member joins per source" + }, + { + "name": "language_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of users viewed chat messages per language" + }, + { + "name": "message_interaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of chat message views and shares" + }, + { + "name": "instant_view_interaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of views of associated with the chat instant views" + }, + { + "name": "recent_message_interactions", + "type": "vector\u003cchatStatisticsMessageInteractionInfo\u003e", + "description": "Detailed statistics about number of views and shares of recently sent messages" + } + ] + }, + { + "name": "messageStatistics", + "description": "A detailed statistics about a message", + "class": "MessageStatistics", + "properties": [ + { + "name": "message_interaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of message views and shares" + } + ] + }, { "name": "updateAuthorizationState", "description": "The user authorization state has changed", @@ -11681,8 +13100,30 @@ ] }, { - "name": "updateMessageViews", - "description": "The view count of the message has changed", + "name": "updateMessageIsPinned", + "description": "The message pinned state was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "The message identifier" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the message is pinned" + } + ] + }, + { + "name": "updateMessageInteractionInfo", + "description": "The information about interactions with a message has changed", "class": "Update", "properties": [ { @@ -11696,9 +13137,9 @@ "description": "Message identifier" }, { - "name": "views", - "type": "int32", - "description": "New value of the view count" + "name": "interaction_info", + "type": "messageInteractionInfo", + "description": "New information about interactions with the message; may be null" } ] }, @@ -11743,7 +13184,7 @@ }, { "name": "updateMessageLiveLocationViewed", - "description": "A message with a live location was viewed. When the update is received, the client is supposed to update the live location", + "description": "A message with a live location was viewed. When the update is received, the application is supposed to update the live location", "class": "Update", "properties": [ { @@ -11760,7 +13201,7 @@ }, { "name": "updateNewChat", - "description": "A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the client. The chat field changes will be reported through separate updates", + "description": "A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates", "class": "Update", "properties": [ { @@ -11770,23 +13211,6 @@ } ] }, - { - "name": "updateChatChatList", - "description": "The list to which the chat belongs was changed. This update is guaranteed to be sent only when chat.order == 0 and the current or the new chat list is null", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "chat_list", - "type": "ChatList", - "description": "The new chat's chat list; may be null" - } - ] - }, { "name": "updateChatTitle", "description": "The title of a chat was changed", @@ -11816,7 +13240,7 @@ }, { "name": "photo", - "type": "chatPhoto", + "type": "chatPhotoInfo", "description": "The new chat photo; may be null" } ] @@ -11854,15 +13278,15 @@ "description": "The new last message in the chat; may be null" }, { - "name": "order", - "type": "int64", - "description": "New value of the chat order" + "name": "positions", + "type": "vector\u003cchatPosition\u003e", + "description": "The new chat positions in the chat lists" } ] }, { - "name": "updateChatOrder", - "description": "The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned, updateChatDraftMessage, or updateChatIsSponsored might be sent", + "name": "updateChatPosition", + "description": "The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent", "class": "Update", "properties": [ { @@ -11871,31 +13295,9 @@ "description": "Chat identifier" }, { - "name": "order", - "type": "int64", - "description": "New value of the order" - } - ] - }, - { - "name": "updateChatIsPinned", - "description": "A chat was pinned or unpinned", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "is_pinned", - "type": "Bool", - "description": "New value of is_pinned" - }, - { - "name": "order", - "type": "int64", - "description": "New value of the chat order" + "name": "position", + "type": "chatPosition", + "description": "New chat position. If new order is 0, then the chat needs to be removed from the list" } ] }, @@ -11917,8 +13319,8 @@ ] }, { - "name": "updateChatIsSponsored", - "description": "A chat's is_sponsored field has changed", + "name": "updateChatIsBlocked", + "description": "A chat was blocked or unblocked", "class": "Update", "properties": [ { @@ -11927,14 +13329,9 @@ "description": "Chat identifier" }, { - "name": "is_sponsored", + "name": "is_blocked", "type": "Bool", - "description": "New value of is_sponsored" - }, - { - "name": "order", - "type": "int64", - "description": "New value of chat order" + "description": "New value of is_blocked" } ] }, @@ -12079,23 +13476,6 @@ } ] }, - { - "name": "updateChatPinnedMessage", - "description": "The chat pinned message was changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "pinned_message_id", - "type": "int53", - "description": "The new identifier of the pinned message; 0 if there is no pinned message in the chat" - } - ] - }, { "name": "updateChatReplyMarkup", "description": "The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user", @@ -12129,9 +13509,21 @@ "description": "The new draft message; may be null" }, { - "name": "order", - "type": "int64", - "description": "New value of the chat order" + "name": "positions", + "type": "vector\u003cchatPosition\u003e", + "description": "The new chat positions in the chat lists" + } + ] + }, + { + "name": "updateChatFilters", + "description": "The list of chat filters or a chat filter has changed", + "class": "Update", + "properties": [ + { + "name": "chat_filters", + "type": "vector\u003cchatFilterInfo\u003e", + "description": "The new list of chat filters" } ] }, @@ -12282,6 +13674,11 @@ "type": "int53", "description": "Chat identifier" }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, a message thread identifier in which the action was performed" + }, { "name": "user_id", "type": "int32", @@ -12313,7 +13710,7 @@ }, { "name": "updateUser", - "description": "Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the client", + "description": "Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application", "class": "Update", "properties": [ { @@ -12325,7 +13722,7 @@ }, { "name": "updateBasicGroup", - "description": "Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the client", + "description": "Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application", "class": "Update", "properties": [ { @@ -12337,7 +13734,7 @@ }, { "name": "updateSupergroup", - "description": "Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the client", + "description": "Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application", "class": "Update", "properties": [ { @@ -12349,7 +13746,7 @@ }, { "name": "updateSecretChat", - "description": "Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the client", + "description": "Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application", "class": "Update", "properties": [ { @@ -12412,7 +13809,7 @@ }, { "name": "updateServiceNotification", - "description": "Service notification from the server. Upon receiving this the client must show a popup with the content of the notification", + "description": "Service notification from the server. Upon receiving this the application must show a popup with the content of the notification", "class": "Update", "properties": [ { @@ -12441,7 +13838,7 @@ }, { "name": "updateFileGenerationStart", - "description": "The file generation process needs to be started by the client", + "description": "The file generation process needs to be started by the application", "class": "Update", "properties": [ { @@ -12462,7 +13859,7 @@ { "name": "conversion", "type": "string", - "description": "String specifying the conversion applied to the original file. If conversion is \"#url#\" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by the client" + "description": "String specifying the conversion applied to the original file. If conversion is \"#url#\" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by the application" } ] }, @@ -12490,6 +13887,23 @@ } ] }, + { + "name": "updateNewCallSignalingData", + "description": "New call signaling data arrived", + "class": "Update", + "properties": [ + { + "name": "call_id", + "type": "int32", + "description": "The call identifier" + }, + { + "name": "data", + "type": "bytes", + "description": "The data" + } + ] + }, { "name": "updateUserPrivacySettingRules", "description": "Some privacy setting rules have been changed", @@ -12583,6 +13997,18 @@ } ] }, + { + "name": "updateStickerSet", + "description": "A sticker set has changed", + "class": "Update", + "properties": [ + { + "name": "sticker_set", + "type": "stickerSet", + "description": "The sticker set" + } + ] + }, { "name": "updateInstalledStickerSets", "description": "The list of installed sticker sets was updated", @@ -12608,7 +14034,7 @@ { "name": "sticker_sets", "type": "stickerSets", - "description": "The new list of trending sticker sets" + "description": "The prefix of the list of trending sticker sets with the newest trending sticker sets" } ] }, @@ -12694,7 +14120,7 @@ }, { "name": "updateConnectionState", - "description": "The connection state has changed", + "description": "The connection state has changed. This update must be used only to show a human-readable description of the connection state", "class": "Update", "properties": [ { @@ -12723,7 +14149,7 @@ }, { "name": "updateUsersNearby", - "description": "List of users nearby has changed. The update is sent only 60 seconds after a successful searchChatsNearby request", + "description": "The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request", "class": "Update", "properties": [ { @@ -12733,6 +14159,52 @@ } ] }, + { + "name": "updateDiceEmojis", + "description": "The list of supported dice emojis has changed", + "class": "Update", + "properties": [ + { + "name": "emojis", + "type": "vector\u003cstring\u003e", + "description": "The new list of supported dice emojis" + } + ] + }, + { + "name": "updateAnimationSearchParameters", + "description": "The parameters of animation search through GetOption(\"animation_search_bot_username\") bot has changed", + "class": "Update", + "properties": [ + { + "name": "provider", + "type": "string", + "description": "Name of the animation search provider" + }, + { + "name": "emojis", + "type": "vector\u003cstring\u003e", + "description": "The new list of emojis suggested for searching" + } + ] + }, + { + "name": "updateSuggestedActions", + "description": "The list of suggested to the user actions has changed", + "class": "Update", + "properties": [ + { + "name": "added_actions", + "type": "vector\u003cSuggestedAction\u003e", + "description": "Added suggested actions" + }, + { + "name": "removed_actions", + "type": "vector\u003cSuggestedAction\u003e", + "description": "Removed suggested actions" + } + ] + }, { "name": "updateNewInlineQuery", "description": "A new incoming inline query; for bots only", @@ -12751,7 +14223,7 @@ { "name": "user_location", "type": "location", - "description": "User location, provided by the client; may be null" + "description": "User location; may be null" }, { "name": "query", @@ -12778,7 +14250,7 @@ { "name": "user_location", "type": "location", - "description": "User location, provided by the client; may be null" + "description": "User location; may be null" }, { "name": "query", @@ -13035,6 +14507,11 @@ "name": "max_file_size", "type": "int53", "description": "The maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated" + }, + { + "name": "redirect_stderr", + "type": "Bool", + "description": "Pass true to additionally redirect stderr to the log file. Ignored on Windows" } ] }, @@ -13160,12 +14637,16 @@ }, { "name": "AuthorizationState", - "description": "Represents the current authorization state of the client" + "description": "Represents the current authorization state of the TDLib client" }, { "name": "InputFile", "description": "Points to a file" }, + { + "name": "ThumbnailFormat", + "description": "Describes format of the thumbnail" + }, { "name": "MaskPoint", "description": "Part of the face, relative to which a mask should be placed" @@ -13178,6 +14659,10 @@ "name": "UserType", "description": "Represents the type of a user. The following types are possible: regular users, deleted users and bots" }, + { + "name": "InputChatPhoto", + "description": "Describes a photo to be set as a user profile or chat photo" + }, { "name": "ChatMemberStatus", "description": "Provides information about the status of a member in a chat" @@ -13194,6 +14679,10 @@ "name": "SecretChatState", "description": "Describes the current secret chat state" }, + { + "name": "MessageSender", + "description": "Contains information about the sender of a message" + }, { "name": "MessageForwardOrigin", "description": "Contains information about the origin of a forwarded message" @@ -13214,6 +14703,10 @@ "name": "ChatList", "description": "Describes a list of chats" }, + { + "name": "ChatSource", + "description": "Describes a reason why an external chat is shown in a chat list" + }, { "name": "PublicChatType", "description": "Describes a type of public chats" @@ -13310,6 +14803,10 @@ "name": "CallDiscardReason", "description": "Describes the reason why a call was discarded" }, + { + "name": "CallServerType", + "description": "Describes the type of a call server" + }, { "name": "CallState", "description": "Describes the current call state" @@ -13318,6 +14815,10 @@ "name": "CallProblem", "description": "Describes the exact type of a problem with a call" }, + { + "name": "DiceStickers", + "description": "Contains animated stickers which should be used for dice animation rendering" + }, { "name": "InputInlineQueryResult", "description": "Represents a single result of an inline query; for bots only" @@ -13340,7 +14841,7 @@ }, { "name": "DeviceToken", - "description": "Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, you must specify the correct application platform and upload valid server authentication data at https://my.telegram.org" + "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" }, { "name": "BackgroundFill", @@ -13418,6 +14919,10 @@ "name": "TMeUrlType", "description": "Describes the type of a URL linking to an internal Telegram entity" }, + { + "name": "SuggestedAction", + "description": "Describes an action suggested to the current user" + }, { "name": "TextParseMode", "description": "Describes the way the text should be parsed for TextEntities" @@ -13426,6 +14931,18 @@ "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" + }, + { + "name": "ChatStatistics", + "description": "Contains a detailed statistics about a chat" + }, { "name": "Update", "description": "Contains notifications about data changes" @@ -13438,7 +14955,7 @@ "functions": [ { "name": "getAuthorizationState", - "description": "Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state", + "description": "Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization", "class": "AuthorizationState", "properties": [], "is_synchronous": false, @@ -13515,13 +15032,13 @@ }, { "name": "requestQrCodeAuthentication", - "description": "Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber", + "description": "Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword", "class": "Ok", "properties": [ { "name": "other_user_ids", "type": "vector\u003cint32\u003e", - "description": "List of user identifiers of other users currently using the client" + "description": "List of user identifiers of other users currently using the application" } ], "is_synchronous": false, @@ -13606,7 +15123,7 @@ }, { "name": "close", - "description": "Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent", + "description": "Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent. Can be called before initialization", "class": "Ok", "properties": [], "is_synchronous": false, @@ -13614,7 +15131,7 @@ }, { "name": "destroy", - "description": "Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed. After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent", + "description": "Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed. After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent. Can be called before authorization", "class": "Ok", "properties": [], "is_synchronous": false, @@ -13636,7 +15153,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. This is an offline method. Can be called before authorization", + "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, @@ -13962,7 +15479,7 @@ }, { "name": "getRepliedMessage", - "description": "Returns information about a message that is replied by given 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", "class": "Message", "properties": [ { @@ -13973,7 +15490,7 @@ { "name": "message_id", "type": "int53", - "description": "Identifier of the message reply to which get" + "description": "Identifier of the message reply to which to get" } ], "is_synchronous": false, @@ -13981,7 +15498,7 @@ }, { "name": "getChatPinnedMessage", - "description": "Returns information about a pinned chat message", + "description": "Returns information about a newest pinned message in the chat", "class": "Message", "properties": [ { @@ -13993,6 +15510,30 @@ "is_synchronous": false, "type": 1 }, + { + "name": "getCallbackQueryMessage", + "description": "Returns information about a message with the callback button that originated a callback query; for bots only", + "class": "Message", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat the message belongs to" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "callback_query_id", + "type": "int64", + "description": "Identifier of the callback query" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getMessages", "description": "Returns information about messages. If a message is not found, returns null on the corresponding position of the result", @@ -14012,6 +15553,25 @@ "is_synchronous": false, "type": 1 }, + { + "name": "getMessageThread", + "description": "Returns information about a message thread. Can be used only if message.can_get_message_thread == true", + "class": "MessageThreadInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getFile", "description": "Returns information about a file; this is an offline request", @@ -14028,7 +15588,7 @@ }, { "name": "getRemoteFile", - "description": "Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client", + "description": "Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application", "class": "File", "properties": [ { @@ -14047,7 +15607,7 @@ }, { "name": "getChats", - "description": "Returns an ordered list of chats in a chat list. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). For optimal performance the number of returned chats is chosen by the library", + "description": "Returns an ordered list of chats in a chat list. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). For optimal performance the number of returned chats is chosen by the library", "class": "Chats", "properties": [ { @@ -14104,7 +15664,7 @@ }, { "name": "searchChats", - "description": "Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the chat list", + "description": "Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list", "class": "Chats", "properties": [ { @@ -14123,7 +15683,7 @@ }, { "name": "searchChatsOnServer", - "description": "Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the chat list", + "description": "Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the main chat list", "class": "Chats", "properties": [ { @@ -14277,7 +15837,7 @@ }, { "name": "getSuitableDiscussionChats", - "description": "Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Basic group chats need to be first upgraded to supergroups before they can be set as a discussion group", + "description": "Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group. To set a returned supergroup as a discussion group, access to its old messages must be enabled using toggleSupergroupIsAllHistoryAvailable first", "class": "Chats", "properties": [], "is_synchronous": false, @@ -14338,7 +15898,7 @@ { "name": "limit", "type": "int32", - "description": "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 or equal to -offset. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached" + "description": "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. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached" }, { "name": "only_local", @@ -14349,6 +15909,40 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getMessageThreadHistory", + "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. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library", + "class": "Messages", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier, which thread history needs to be returned" + }, + { + "name": "from_message_id", + "type": "int53", + "description": "Identifier of the message starting from which history must be fetched; use 0 to get results from the last message" + }, + { + "name": "offset", + "type": "int32", + "description": "Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages" + }, + { + "name": "limit", + "type": "int32", + "description": "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. Fewer messages may be returned than specified by the limit, even if the end of the message thread history has not been reached" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "deleteChatHistory", "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", @@ -14389,9 +15983,9 @@ "description": "Query to search for" }, { - "name": "sender_user_id", - "type": "int32", - "description": "If not 0, only messages sent by the specified user will be returned. Not supported in secret chats" + "name": "sender", + "type": "MessageSender", + "description": "If not null, only messages sent by the specified sender will be returned. Not supported in secret chats" }, { "name": "from_message_id", @@ -14412,6 +16006,11 @@ "name": "filter", "type": "SearchMessagesFilter", "description": "Filter for message content in the search results" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, only messages in the specified thread will be returned; supergroups only" } ], "is_synchronous": false, @@ -14450,7 +16049,22 @@ { "name": "limit", "type": "int32", - "description": "The maximum number of messages to be returned, up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached" + "description": "The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached" + }, + { + "name": "filter", + "type": "SearchMessagesFilter", + "description": "Filter for message content in the search results; searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function" + }, + { + "name": "min_date", + "type": "int32", + "description": "If not 0, the minimum date of the messages to return" + }, + { + "name": "max_date", + "type": "int32", + "description": "If not 0, the maximum date of the messages to return" } ], "is_synchronous": false, @@ -14472,9 +16086,9 @@ "description": "Query to search for. If empty, searchChatMessages should be used instead" }, { - "name": "from_search_id", - "type": "int64", - "description": "The identifier from the result of a previous request, 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 first chunk of results" }, { "name": "limit", @@ -14484,7 +16098,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "A filter for the content of messages in the search results" + "description": "A filter for message content in the search results" } ], "is_synchronous": false, @@ -14535,7 +16149,7 @@ }, { "name": "getActiveLiveLocationMessages", - "description": "Returns all active live locations that should be updated by the client. The list is persistent across application restarts only if the message database is used", + "description": "Returns all active live locations that should be updated by the application. The list is persistent across application restarts only if the message database is used", "class": "Messages", "properties": [], "is_synchronous": false, @@ -14598,6 +16212,35 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getMessagePublicForwards", + "description": "Returns forwarded copies of a channel message to different public channels. For optimal performance the number of returned messages is chosen by the library", + "class": "FoundMessages", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "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" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of messages to be returned; must be positive and can't be greater than 100. Fewer messages may be returned than specified by the limit, even if the end of the list has not been reached" + } + ], + "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", @@ -14637,9 +16280,9 @@ "type": 2 }, { - "name": "getPublicMessageLink", - "description": "Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with a username", - "class": "PublicMessageLink", + "name": "getMessageLink", + "description": "Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. This is an offline request", + "class": "MessageLink", "properties": [ { "name": "chat_id", @@ -14654,16 +16297,21 @@ { "name": "for_album", "type": "Bool", - "description": "Pass true if a link for a whole media album should be returned" + "description": "Pass true to create a link for the whole media album" + }, + { + "name": "for_comment", + "type": "Bool", + "description": "Pass true to create a link to the message as a channel post comment, or from a message thread" } ], "is_synchronous": false, - "type": 2 + "type": 1 }, { - "name": "getMessageLink", - "description": "Returns a private HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. The link will work only for members of the chat", - "class": "HttpUrl", + "name": "getMessageEmbeddingCode", + "description": "Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username", + "class": "Text", "properties": [ { "name": "chat_id", @@ -14674,6 +16322,11 @@ "name": "message_id", "type": "int53", "description": "Identifier of the message" + }, + { + "name": "for_album", + "type": "Bool", + "description": "Pass true to return an HTML code for embedding of the whole media album" } ], "is_synchronous": false, @@ -14703,6 +16356,11 @@ "type": "int53", "description": "Target chat" }, + { + "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", @@ -14710,7 +16368,7 @@ }, { "name": "options", - "type": "sendMessageOptions", + "type": "messageSendOptions", "description": "Options to be used to send the message" }, { @@ -14729,7 +16387,7 @@ }, { "name": "sendMessageAlbum", - "description": "Sends messages grouped together into an album. Currently only photo and video messages can be grouped into an album. Returns sent messages", + "description": "Sends 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": [ { @@ -14737,6 +16395,11 @@ "type": "int53", "description": "Target chat" }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, a message thread identifier in which the messages will be sent" + }, { "name": "reply_to_message_id", "type": "int53", @@ -14744,7 +16407,7 @@ }, { "name": "options", - "type": "sendMessageOptions", + "type": "messageSendOptions", "description": "Options to be used to send the messages" }, { @@ -14790,6 +16453,11 @@ "type": "int53", "description": "Target chat" }, + { + "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", @@ -14797,7 +16465,7 @@ }, { "name": "options", - "type": "sendMessageOptions", + "type": "messageSendOptions", "description": "Options to be used to send the message" }, { @@ -14837,18 +16505,13 @@ { "name": "message_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of the messages to forward" + "description": "Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order" }, { "name": "options", - "type": "sendMessageOptions", + "type": "messageSendOptions", "description": "Options to be used to send the messages" }, - { - "name": "as_album", - "type": "Bool", - "description": "True, if the messages should be grouped into an album after forwarding. For this to work, no more than 10 messages may be forwarded, and all of them must be photo or video messages" - }, { "name": "send_copy", "type": "Bool", @@ -14857,7 +16520,7 @@ { "name": "remove_caption", "type": "Bool", - "description": "True, if media captions of message copies needs to be removed. Ignored if send_copy is false" + "description": "True, if media caption of message copies needs to be removed. Ignored if send_copy is false" } ], "is_synchronous": false, @@ -14926,9 +16589,9 @@ "description": "Target chat" }, { - "name": "sender_user_id", - "type": "int32", - "description": "Identifier of the user who will be shown as the sender of the message; may be 0 for channel posts" + "name": "sender", + "type": "MessageSender", + "description": "The sender sender of the message" }, { "name": "reply_to_message_id", @@ -15045,6 +16708,16 @@ "name": "location", "type": "location", "description": "New location content of the message; may be null. Pass null to stop sharing the live location" + }, + { + "name": "heading", + "type": "int32", + "description": "The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown" + }, + { + "name": "proximity_alert_radius", + "type": "int32", + "description": "The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled" } ], "is_synchronous": false, @@ -15175,6 +16848,16 @@ "name": "location", "type": "location", "description": "New location content of the message; may be null. Pass null to stop sharing the live location" + }, + { + "name": "heading", + "type": "int32", + "description": "The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown" + }, + { + "name": "proximity_alert_radius", + "type": "int32", + "description": "The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled" } ], "is_synchronous": false, @@ -15273,7 +16956,7 @@ }, { "name": "getTextEntities", - "description": "Returns all entities (mentions, hashtags, cashtags, bot commands, URLs, and email addresses) contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously", "class": "TextEntities", "properties": [ { @@ -15287,13 +16970,13 @@ }, { "name": "parseTextEntities", - "description": "Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. This is an offline method. Can be called before authorization. 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": [ { "name": "text", "type": "string", - "description": "The text which should be parsed" + "description": "The text to parse" }, { "name": "parse_mode", @@ -15304,9 +16987,37 @@ "is_synchronous": true, "type": 1 }, + { + "name": "parseMarkdown", + "description": "Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously", + "class": "FormattedText", + "properties": [ + { + "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**\"" + } + ], + "is_synchronous": true, + "type": 1 + }, + { + "name": "getMarkdownText", + "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", + "class": "FormattedText", + "properties": [ + { + "name": "text", + "type": "formattedText", + "description": "The text" + } + ], + "is_synchronous": true, + "type": 1 + }, { "name": "getFileMimeType", - "description": "Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously", "class": "Text", "properties": [ { @@ -15320,7 +17031,7 @@ }, { "name": "getFileExtension", - "description": "Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously", "class": "Text", "properties": [ { @@ -15334,7 +17045,7 @@ }, { "name": "cleanFileName", - "description": "Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. Can be called synchronously", "class": "Text", "properties": [ { @@ -15348,7 +17059,7 @@ }, { "name": "getLanguagePackString", - "description": "Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. Can be called synchronously", "class": "LanguagePackStringValue", "properties": [ { @@ -15377,7 +17088,7 @@ }, { "name": "getJsonValue", - "description": "Converts a JSON-serialized string to corresponding JsonValue object. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously", "class": "JsonValue", "properties": [ { @@ -15391,7 +17102,7 @@ }, { "name": "getJsonString", - "description": "Converts a JsonValue object to corresponding JSON-serialized string. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously", "class": "Text", "properties": [ { @@ -15485,6 +17196,20 @@ "is_synchronous": false, "type": 1 }, + { + "name": "hideSuggestedAction", + "description": "Hides a suggested action", + "class": "Ok", + "properties": [ + { + "name": "action", + "type": "SuggestedAction", + "description": "Suggested action to hide" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getLoginUrlInfo", "description": "Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button", @@ -15862,6 +17587,11 @@ "type": "int53", "description": "Chat identifier" }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, a message thread identifier in which the action was performed" + }, { "name": "action", "type": "ChatAction", @@ -15909,6 +17639,11 @@ "type": "int53", "description": "Chat identifier" }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, a message thread identifier in which the messages are being viewed" + }, { "name": "message_ids", "type": "vector\u003cint53\u003e", @@ -15917,7 +17652,7 @@ { "name": "force_read", "type": "Bool", - "description": "True, if messages in closed chats should be marked as read" + "description": "True, if messages in closed chats should be marked as read by the request" } ], "is_synchronous": false, @@ -16104,8 +17839,22 @@ "type": 2 }, { - "name": "setChatChatList", - "description": "Moves a chat to a different chat list. Current chat list of the chat must ne non-null", + "name": "getChatListsToAddChat", + "description": "Returns chat lists to which the chat can be added. This is an offline request", + "class": "ChatLists", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "addChatToList", + "description": "Adds a chat to a chat list. A chat can't be simultaneously in Main and Archive chat lists, so it is automatically removed from another one if needed", "class": "Ok", "properties": [ { @@ -16116,15 +17865,112 @@ { "name": "chat_list", "type": "ChatList", - "description": "New chat list of the chat" + "description": "The chat list. Use getChatListsToAddChat to get suitable chat lists" } ], "is_synchronous": false, "type": 2 }, + { + "name": "getChatFilter", + "description": "Returns information about a chat filter by its identifier", + "class": "ChatFilter", + "properties": [ + { + "name": "chat_filter_id", + "type": "int32", + "description": "Chat filter identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "createChatFilter", + "description": "Creates new chat filter. Returns information about the created chat filter", + "class": "ChatFilterInfo", + "properties": [ + { + "name": "filter", + "type": "chatFilter", + "description": "Chat filter" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "editChatFilter", + "description": "Edits existing chat filter. Returns information about the edited chat filter", + "class": "ChatFilterInfo", + "properties": [ + { + "name": "chat_filter_id", + "type": "int32", + "description": "Chat filter identifier" + }, + { + "name": "filter", + "type": "chatFilter", + "description": "The edited chat filter" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteChatFilter", + "description": "Deletes existing chat filter", + "class": "Ok", + "properties": [ + { + "name": "chat_filter_id", + "type": "int32", + "description": "Chat filter identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reorderChatFilters", + "description": "Changes the order of chat filters", + "class": "Ok", + "properties": [ + { + "name": "chat_filter_ids", + "type": "vector\u003cint32\u003e", + "description": "Identifiers of chat filters in the new correct order" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getRecommendedChatFilters", + "description": "Returns recommended chat filters for the current user", + "class": "RecommendedChatFilters", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatFilterDefaultIconName", + "description": "Returns default icon name for a filter. Can be called synchronously", + "class": "Text", + "properties": [ + { + "name": "filter", + "type": "chatFilter", + "description": "Chat filter" + } + ], + "is_synchronous": true, + "type": 1 + }, { "name": "setChatTitle", - "description": "Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The title will not be changed until the request to the server has been completed", + "description": "Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights", "class": "Ok", "properties": [ { @@ -16143,7 +17989,7 @@ }, { "name": "setChatPhoto", - "description": "Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The photo will not be changed before request to the server has been completed", + "description": "Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info rights", "class": "Ok", "properties": [ { @@ -16153,8 +17999,8 @@ }, { "name": "photo", - "type": "InputFile", - "description": "New chat photo. You can use a zero InputFileId to delete the chat photo. Files that are accessible only by HTTP URL are not acceptable" + "type": "InputChatPhoto", + "description": "New chat photo. Pass null to delete the chat photo" } ], "is_synchronous": false, @@ -16189,6 +18035,11 @@ "type": "int53", "description": "Chat identifier" }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, a message thread identifier in which the draft was changed" + }, { "name": "draft_message", "type": "draftMessage", @@ -16217,25 +18068,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "toggleChatIsPinned", - "description": "Changes the pinned state of a chat. You can pin up to GetOption(\"pinned_chat_count_max\")/GetOption(\"pinned_archived_chat_count_max\") non-secret chats and the same number of secret chats in the main/archive chat list", - "class": "Ok", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "is_pinned", - "type": "Bool", - "description": "New value of is_pinned" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "toggleChatIsMarkedAsUnread", "description": "Changes the marked as unread state of a chat", @@ -16276,7 +18108,7 @@ }, { "name": "setChatClientData", - "description": "Changes client data associated with a chat", + "description": "Changes application-specific data associated with a chat", "class": "Ok", "properties": [ { @@ -16325,7 +18157,7 @@ { "name": "discussion_chat_id", "type": "int53", - "description": "Identifier of a new channel's discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats needs to be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable needs to be used first to change that" + "description": "Identifier of a new channel's discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats must be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable must be used first to change that" } ], "is_synchronous": false, @@ -16371,7 +18203,7 @@ }, { "name": "pinChatMessage", - "description": "Pins a message in a chat; requires can_pin_messages rights", + "description": "Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel", "class": "Ok", "properties": [ { @@ -16387,7 +18219,12 @@ { "name": "disable_notification", "type": "Bool", - "description": "True, if there should be no notification about the pinned message" + "description": "True, if there should be no 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" } ], "is_synchronous": false, @@ -16395,7 +18232,26 @@ }, { "name": "unpinChatMessage", - "description": "Removes the pinned message from a chat; requires can_pin_messages rights in the group or channel", + "description": "Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the removed pinned message" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "unpinAllChatMessages", + "description": "Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel", "class": "Ok", "properties": [ { @@ -16670,6 +18526,30 @@ "is_synchronous": false, "type": 2 }, + { + "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", + "class": "Ok", + "properties": [ + { + "name": "chat_list", + "type": "ChatList", + "description": "Chat list in which to change the pinned state of the chat" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the chat is pinned" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setPinnedChats", "description": "Changes the order of pinned chats", @@ -16801,7 +18681,7 @@ }, { "name": "writeGeneratedFilePart", - "description": "Writes a part of a generated file. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file", + "description": "Writes a part of a generated file. 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 write to the destination file", "class": "Ok", "properties": [ { @@ -16868,7 +18748,7 @@ }, { "name": "readFilePart", - "description": "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 client has no direct access to TDLib's file system, because it is usually slower than a direct read from the file", + "description": "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", "class": "FilePart", "properties": [ { @@ -16959,7 +18839,12 @@ { "name": "protocol", "type": "callProtocol", - "description": "Description of the call protocols supported by the client" + "description": "Description of the call protocols supported by the application" + }, + { + "name": "is_video", + "type": "Bool", + "description": "True, if a video call needs to be created" } ], "is_synchronous": false, @@ -16978,7 +18863,26 @@ { "name": "protocol", "type": "callProtocol", - "description": "Description of the call protocols supported by the client" + "description": "Description of the call protocols supported by the application" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "sendCallSignalingData", + "description": "Sends call signaling data", + "class": "Ok", + "properties": [ + { + "name": "call_id", + "type": "int32", + "description": "Call identifier" + }, + { + "name": "data", + "type": "bytes", + "description": "The data" } ], "is_synchronous": false, @@ -17004,6 +18908,11 @@ "type": "int32", "description": "The call duration, in seconds" }, + { + "name": "is_video", + "type": "Bool", + "description": "True, if the call was a video call" + }, { "name": "connection_id", "type": "int64", @@ -17062,47 +18971,67 @@ "type": 2 }, { - "name": "blockUser", - "description": "Adds a user to the blacklist", + "name": "toggleMessageSenderIsBlocked", + "description": "Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked", "class": "Ok", "properties": [ { - "name": "user_id", - "type": "int32", - "description": "User identifier" + "name": "sender", + "type": "MessageSender", + "description": "Message Sender" + }, + { + "name": "is_blocked", + "type": "Bool", + "description": "New value of is_blocked" } ], "is_synchronous": false, "type": 2 }, { - "name": "unblockUser", - "description": "Removes a user from the blacklist", + "name": "blockMessageSenderFromReplies", + "description": "Blocks an original sender of a message in the Replies chat", "class": "Ok", "properties": [ { - "name": "user_id", - "type": "int32", - "description": "User identifier" + "name": "message_id", + "type": "int53", + "description": "The identifier of an incoming message in the Replies chat" + }, + { + "name": "delete_message", + "type": "Bool", + "description": "Pass true if the message must be deleted" + }, + { + "name": "delete_all_messages", + "type": "Bool", + "description": "Pass true if all messages from the same sender must be deleted" + }, + { + "name": "report_spam", + "type": "Bool", + "description": "Pass true if the sender must be reported to the Telegram moderators" } ], "is_synchronous": false, "type": 2 }, { - "name": "getBlockedUsers", - "description": "Returns users that were blocked by the current user", - "class": "Users", + "name": "getBlockedMessageSenders", + "description": "Returns users and chats that were blocked by the current user", + "class": "MessageSenders", "properties": [ { "name": "offset", "type": "int32", - "description": "Number of users to skip in the result; must be non-negative" + "description": "Number of users and chats to skip in the result; must be non-negative" }, { "name": "limit", "type": "int32", - "description": "The maximum number of users to return; up to 100" + "description": "The maximum number of users and chats to return; up to 100" } ], "is_synchronous": false, @@ -17229,7 +19158,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", - "class": "UserProfilePhotos", + "class": "ChatPhotos", "properties": [ { "name": "user_id", @@ -17328,9 +19257,20 @@ }, { "name": "getTrendingStickerSets", - "description": "Returns a list of trending sticker sets", + "description": "Returns a list of trending sticker sets. For the optimal performance the number of returned sticker sets is chosen by the library", "class": "StickerSets", - "properties": [], + "properties": [ + { + "name": "offset", + "type": "int32", + "description": "The offset from which to return the sticker sets; must be non-negative" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of sticker sets to be returned; must be non-negative. Fewer sticker sets may be returned than specified by the limit, even if the end of the list has not been reached" + } + ], "is_synchronous": false, "type": 2 }, @@ -17603,9 +19543,9 @@ "description": "True, if only emojis, which exactly match text needs to be returned" }, { - "name": "input_language_code", - "type": "string", - "description": "IETF language tag of the user's input language; may be empty if unknown" + "name": "input_language_codes", + "type": "vector\u003cstring\u003e", + "description": "List of possible IETF language tags of the user's input language; may be empty if unknown" } ], "is_synchronous": false, @@ -17737,13 +19677,13 @@ }, { "name": "setProfilePhoto", - "description": "Uploads a new profile photo for the current user. If something changes, updateUser will be sent", + "description": "Changes a profile photo for the current user", "class": "Ok", "properties": [ { "name": "photo", - "type": "InputFile", - "description": "Profile photo to set. inputFileId and inputFileRemote may still be unsupported" + "type": "InputChatPhoto", + "description": "Profile photo to set" } ], "is_synchronous": false, @@ -17751,7 +19691,7 @@ }, { "name": "deleteProfilePhoto", - "description": "Deletes a profile photo. If something changes, updateUser will be sent", + "description": "Deletes a profile photo", "class": "Ok", "properties": [ { @@ -17765,7 +19705,7 @@ }, { "name": "setName", - "description": "Changes the first and last name of the current user. If something changes, updateUser will be sent", + "description": "Changes the first and last name of the current user", "class": "Ok", "properties": [ { @@ -17798,7 +19738,7 @@ }, { "name": "setUsername", - "description": "Changes the username of the current user. If something changes, updateUser will be sent", + "description": "Changes the username of the current user", "class": "Ok", "properties": [ { @@ -17810,6 +19750,20 @@ "is_synchronous": false, "type": 2 }, + { + "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", + "class": "Ok", + "properties": [ + { + "name": "location", + "type": "location", + "description": "The new location of the user" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "changePhoneNumber", "description": "Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code", @@ -17851,6 +19805,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setCommands", + "description": "Sets the list of commands supported by the bot; for bots only", + "class": "Ok", + "properties": [ + { + "name": "commands", + "type": "vector\u003cbotCommand\u003e", + "description": "List of the bot's commands" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getActiveSessions", "description": "Returns all active sessions of the current user", @@ -18024,7 +19992,7 @@ { "name": "filter", "type": "SupergroupMembersFilter", - "description": "The type of users to return. By default, supergroupMembersRecent" + "description": "The type of users to return. By default, supergroupMembersFilterRecent" }, { "name": "offset", @@ -18248,7 +20216,7 @@ { "name": "for_dark_theme", "type": "Bool", - "description": "True, if the backgrounds needs to be ordered for dark theme" + "description": "True, if the backgrounds must be ordered for dark theme" } ], "is_synchronous": false, @@ -18382,7 +20350,7 @@ }, { "name": "synchronizeLanguagePack", - "description": "Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization", + "description": "Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method shouldn't be called explicitly for the current used/base language packs. Can be called before authorization", "class": "Ok", "properties": [ { @@ -18487,7 +20455,7 @@ { "name": "other_user_ids", "type": "vector\u003cint32\u003e", - "description": "List of user identifiers of other users currently using the client" + "description": "List of user identifiers of other users currently using the application" } ], "is_synchronous": false, @@ -18509,7 +20477,7 @@ }, { "name": "getPushReceiverId", - "description": "Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. Can be called synchronously", "class": "PushReceiverId", "properties": [ { @@ -18653,7 +20621,7 @@ }, { "name": "reportChat", - "description": "Reports a chat to the Telegram moderators. Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by moderators, or when the report is done from the chat action bar", + "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 chats 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", "class": "Ok", "properties": [ { @@ -18677,7 +20645,7 @@ }, { "name": "getChatStatisticsUrl", - "description": "Returns an HTTP URL with the chat statistics. Currently this method can be used only for channels. Can be used only if SupergroupFullInfo.can_view_statistics == true", + "description": "Returns an HTTP URL with the chat statistics. Currently this method of getting the statistics are disabled and can be deleted in the future", "class": "HttpUrl", "properties": [ { @@ -18699,6 +20667,73 @@ "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", + "class": "ChatStatistics", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "is_dark", + "type": "Bool", + "description": "Pass true if a dark theme is used by the application" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getMessageStatistics", + "description": "Returns detailed statistics about a message. Can be used only if Message.can_get_statistics == true", + "class": "MessageStatistics", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "is_dark", + "type": "Bool", + "description": "Pass true if a dark theme is used by the application" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStatisticalGraph", + "description": "Loads an asynchronous or a zoomed in statistical graph", + "class": "StatisticalGraph", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "token", + "type": "string", + "description": "The token for graph loading" + }, + { + "name": "x", + "type": "int53", + "description": "X-value for zoomed in graph or 0 otherwise" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getStorageStatistics", "description": "Returns storage usage statistics. Can be called before authorization", @@ -18769,6 +20804,11 @@ "type": "vector\u003cint53\u003e", "description": "If not empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos)" }, + { + "name": "return_deleted_file_statistics", + "type": "Bool", + "description": "Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics" + }, { "name": "chat_limit", "type": "int32", @@ -18830,7 +20870,7 @@ }, { "name": "getAutoDownloadSettingsPresets", - "description": "Returns auto-download settings presets for the currently logged in user", + "description": "Returns auto-download settings presets for the current user", "class": "AutoDownloadSettingsPresets", "properties": [], "is_synchronous": false, @@ -18855,6 +20895,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getBankCardInfo", + "description": "Returns information about a bank card", + "class": "BankCardInfo", + "properties": [ + { + "name": "bank_card_number", + "type": "string", + "description": "The bank card number" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getPassportElement", "description": "Returns one of the available Telegram Passport elements", @@ -19081,7 +21135,7 @@ }, { "name": "sendPassportAuthorizationForm", - "description": "Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements need to be used", + "description": "Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements are going to be reused", "class": "Ok", "properties": [ { @@ -19176,7 +21230,7 @@ { "name": "png_sticker", "type": "InputFile", - "description": "PNG image with the sticker; must be up to 512 kB in size and fit in 512x512 square" + "description": "PNG image with the sticker; must be up to 512 KB in size and fit in 512x512 square" } ], "is_synchronous": false, @@ -19205,12 +21259,12 @@ { "name": "is_masks", "type": "Bool", - "description": "True, if stickers are masks" + "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" + "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" } ], "is_synchronous": false, @@ -19233,13 +21287,37 @@ }, { "name": "sticker", - "type": "inputSticker", + "type": "InputSticker", "description": "Sticker to add to the set" } ], "is_synchronous": false, "type": 3 }, + { + "name": "setStickerSetThumbnail", + "description": "Sets a sticker set thumbnail; for bots only. Returns the sticker set", + "class": "StickerSet", + "properties": [ + { + "name": "user_id", + "type": "int32", + "description": "Sticker set owner" + }, + { + "name": "name", + "type": "string", + "description": "Sticker set name" + }, + { + "name": "thumbnail", + "type": "InputFile", + "description": "Thumbnail to set in PNG or TGS format. Animated thumbnail must be set for animated sticker sets and only for them. Pass a zero InputFileId to delete the thumbnail" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "setStickerPositionInSet", "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", @@ -19366,7 +21444,7 @@ }, { "name": "setAlarm", - "description": "Succeeds after a specified amount of time has passed. Can be called before authorization. Can be called before initialization", + "description": "Succeeds after a specified amount of time has passed. Can be called before initialization", "class": "Ok", "properties": [ { @@ -19378,14 +21456,36 @@ "is_synchronous": false, "type": 1 }, + { + "name": "getCountries", + "description": "Returns information about existing countries. Can be called before authorization", + "class": "Countries", + "properties": [], + "is_synchronous": false, + "type": 1 + }, { "name": "getCountryCode", - "description": "Uses current user IP to found their country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization", + "description": "Uses current user IP address to find their country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization", "class": "Text", "properties": [], "is_synchronous": false, "type": 1 }, + { + "name": "getPhoneNumberInfo", + "description": "Returns information about a phone number by its prefix. Can be called before authorization", + "class": "PhoneNumberInfo", + "properties": [ + { + "name": "phone_number_prefix", + "type": "string", + "description": "The phone number prefix" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "getInviteText", "description": "Returns the default text for invitation messages to be used as a placeholder when the current user invites friends to Telegram", @@ -19577,7 +21677,7 @@ }, { "name": "setLogStream", - "description": "Sets new log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Sets new log stream for internal logging of TDLib. Can be called synchronously", "class": "Ok", "properties": [ { @@ -19591,7 +21691,7 @@ }, { "name": "getLogStream", - "description": "Returns information about currently used log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously", "class": "LogStream", "properties": [], "is_synchronous": true, @@ -19599,7 +21699,7 @@ }, { "name": "setLogVerbosityLevel", - "description": "Sets the verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Sets the verbosity level of the internal logging of TDLib. Can be called synchronously", "class": "Ok", "properties": [ { @@ -19613,7 +21713,7 @@ }, { "name": "getLogVerbosityLevel", - "description": "Returns current verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Returns current verbosity level of the internal logging of TDLib. Can be called synchronously", "class": "LogVerbosityLevel", "properties": [], "is_synchronous": true, @@ -19621,7 +21721,7 @@ }, { "name": "getLogTags", - "description": "Returns list of available TDLib internal log tags, for example, [\"actor\", \"binlog\", \"connections\", \"notifications\", \"proxy\"]. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Returns list of available TDLib internal log tags, for example, [\"actor\", \"binlog\", \"connections\", \"notifications\", \"proxy\"]. Can be called synchronously", "class": "LogTags", "properties": [], "is_synchronous": true, @@ -19629,7 +21729,7 @@ }, { "name": "setLogTagVerbosityLevel", - "description": "Sets the verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously", "class": "Ok", "properties": [ { @@ -19648,7 +21748,7 @@ }, { "name": "getLogTagVerbosityLevel", - "description": "Returns current verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Returns current verbosity level for a specified TDLib internal log tag. Can be called synchronously", "class": "LogVerbosityLevel", "properties": [ { @@ -19662,7 +21762,7 @@ }, { "name": "addLogMessage", - "description": "Adds a message to TDLib internal log. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Adds a message to TDLib internal log. Can be called synchronously", "class": "Ok", "properties": [ { @@ -19845,7 +21945,7 @@ }, { "name": "testReturnError", - "description": "Returns the specified error and ensures that the Error object is used; for testing only. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously", "class": "Error", "properties": [ { diff --git a/data/td_api.tl b/data/td_api.tl index 99ec8b5..0b02922 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -34,7 +34,7 @@ ok = Ok; //@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; 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 @@ -43,7 +43,7 @@ tdlibParameters use_test_dc:Bool database_directory:string files_directory:strin //@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 in another client @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 @@ -63,7 +63,7 @@ authenticationCodeInfo phone_number:string type:AuthenticationCodeType next_type emailAddressAuthenticationCodeInfo email_address_pattern:string length:int32 = EmailAddressAuthenticationCodeInfo; -//@description Represents a part of the text that needs to be formatted in some unusual way @offset Offset of the entity in UTF-16 code units @length Length of the entity, in UTF-16 code units @type Type of the entity +//@description Represents a part of the text that needs to be formatted in some unusual way @offset Offset of the entity, in UTF-16 code units @length Length of the entity, in UTF-16 code units @type Type of the entity textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; //@description Contains a list of text entities @entities List of text entities @@ -78,7 +78,7 @@ formattedText text:string entities:vector = FormattedText; termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfService; -//@class AuthorizationState @description Represents the current authorization state of the client +//@class AuthorizationState @description Represents the current authorization state of the TDLib client //@description TDLib needs TdlibParameters for initialization authorizationStateWaitTdlibParameters = AuthorizationState; @@ -141,9 +141,9 @@ temporaryPasswordState has_password:Bool valid_for:int32 = TemporaryPasswordStat 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; //@description Represents a remote file -//@id Remote file identifier; may be empty. Can be used across application restarts or even from other devices for the current user. Uniquely identifies a file, but a file can have a lot of different valid identifiers. +//@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 client with the HTTP URL in the original_path and "#url#" as the conversion string. Clients should 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 should 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 @@ -165,26 +165,53 @@ file id:int32 size:int32 expected_size:int32 local:localFile remote:remoteFile = inputFileId id:int32 = InputFile; //@description A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. -//-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client +//-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application //@id Remote file identifier 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 client @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; should be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage //@expected_size Expected size of the generated file; 0 if unknown inputFileGenerated original_path:string conversion:string expected_size:int32 = InputFile; -//@description Photo description @type Thumbnail type (see https://core.telegram.org/constructor/photoSize) @photo Information about the photo file @width Photo width @height Photo height -photoSize type:string photo:file width:int32 height:int32 = PhotoSize; +//@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 +photoSize type:string photo:file width:int32 height:int32 progressive_sizes:vector = PhotoSize; //@description Thumbnail image of a very poor quality and low resolution @width Thumbnail width, usually doesn't exceed 40 @height Thumbnail height, usually doesn't exceed 40 @data The thumbnail in JPEG format minithumbnail width:int32 height:int32 data:bytes = Minithumbnail; +//@class ThumbnailFormat @description Describes format of the 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 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; + + //@class MaskPoint @description Part of the face, relative to which a mask should be placed //@description A mask should be placed relatively to the forehead @@ -216,37 +243,47 @@ pollOption text:string voter_count:int32 vote_percentage:int32 is_chosen:Bool is //@description A regular poll @allow_multiple_answers True, if multiple answer options can be chosen simultaneously pollTypeRegular allow_multiple_answers:Bool = PollType; -//@description A poll in quiz mode, which has exactly one correct answer option and can be answered only once @correct_option_id 0-based identifier of the correct answer option; -1 for a yet unanswered poll -pollTypeQuiz correct_option_id:int32 = PollType; +//@description A poll in quiz mode, which has exactly one correct answer option and can be answered only once +//@correct_option_id 0-based identifier of the correct answer option; -1 for a yet unanswered poll +//@explanation Text that is shown when the user chooses an incorrect answer or taps on the lamp icon, 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll +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" -//@minithumbnail Animation minithumbnail; may be null @thumbnail Animation thumbnail; may be null @animation File containing the animation -animation duration:int32 width:int32 height:int32 file_name:string mime_type:string minithumbnail:minithumbnail thumbnail:photoSize animation:file = Animation; +//@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 +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; as defined by the sender. The full size thumbnail should 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:photoSize audio:file = Audio; +//@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 should 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 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:photoSize document:file = 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 @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 should be placed; may be null @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 thumbnail:photoSize 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 should be placed; may be null +//@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 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 @has_stickers True, if stickers were added to the video -//@supports_streaming True, if the video should be tried to be streamed @minithumbnail Video minithumbnail; may be null @thumbnail Video thumbnail; 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:photoSize video:file = Video; +//@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 should be tried 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; as defined by the sender; may be null @video File containing the video -videoNote duration:int32 length:int32 minithumbnail:minithumbnail thumbnail:photoSize 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 +//@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 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 @@ -256,9 +293,10 @@ voiceNote duration:int32 waveform:bytes mime_type:string voice:file = VoiceNote; contact phone_number:string first_name:string last_name:string vcard:string user_id:int32 = 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 -location latitude:double longitude:double = Location; +//@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" needs 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; @@ -266,18 +304,24 @@ venue location:location title:string address:string provider:string id:string ty //@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-255 characters @options List of poll answer options +//@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 @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 is_closed:Bool = Poll; +//@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 be automatically 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 userProfilePhotos -//@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 -profilePhoto id:int64 small:file big:file = ProfilePhoto; +//@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 +//@has_animation True, if the photo has animated variant +profilePhoto id:int64 small:file big:file has_animation:Bool = ProfilePhoto; -//@description Describes the photo of a chat @small A small (160x160) chat photo. The file can be downloaded only before the photo is changed @big A big (640x640) chat photo. The file can be downloaded only before the photo is changed -chatPhoto small:file big:file = ChatPhoto; +//@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 +//@has_animation True, if the photo has animated variant +chatPhotoInfo small:file big:file has_animation:Bool = ChatPhotoInfo; //@class UserType @description Represents the type of a user. The following types are possible: regular users, deleted users and bots @@ -290,14 +334,14 @@ 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 //@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 client input field) @need_location True, if the location of the user should be sent with every inline query to this bot +//@is_inline True, if the bot supports inline queries @inline_query_placeholder Placeholder for inline queries (displayed on the application input field) @need_location True, if the location of the user should 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; -//@description Represents commands supported by a bot @command Text of the bot command @param_description Description of the bot command +//@description Represents a command supported by a bot @command Text of the bot command @param_description Description of the bot command botCommand command:string description:string = BotCommand; //@description Provides information about a bot and its supported commands @param_description Long description shown on the user info page @commands A list of commands supported by the bot @@ -308,27 +352,69 @@ botInfo description:string commands:vector = BotInfo; chatLocation location:location address:string = ChatLocation; -//@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 -//@phone_number Phone number of the user @status Current online status of the user @profile_photo Profile photo of the user; may be null +//@description Animated variant of a chat photo in MPEG4 format +//@length Animation width and height +//@file Information about the animation file +//@main_frame_timestamp Timestamp of the frame, used as a static chat photo +animatedChatPhoto length:int32 file:file main_frame_timestamp:double = AnimatedChatPhoto; + + +//@description Describes a chat or user profile photo +//@id Unique photo identifier +//@added_date Point in time (Unix timestamp) when the photo has been added +//@minithumbnail Photo minithumbnail; may be null +//@sizes Available variants of the photo in JPEG format, in different size +//@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; + +//@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; + + +//@class InputChatPhoto @description Describes a photo to be set as a user profile or chat photo + +//@description A previously used profile photo of the current user @chat_photo_id Identifier of the profile photo to reuse +inputChatPhotoPrevious chat_photo_id:int64 = InputChatPhoto; + +//@description A static photo in JPEG format @photo Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed +inputChatPhotoStatic photo:InputFile = InputChatPhoto; + +//@description An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 800 and be at most 2MB in size +//@animation Animation to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed +//@main_frame_timestamp Timestamp of the frame, which will be used as static chat photo +inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputChatPhoto; + + +//@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 +//@phone_number Phone number of the user +//@status Current online status of the user +//@profile_photo Profile photo of the user; may be null //@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_support True, if the user is Telegram support account +//@is_verified True, if the user is verified +//@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 -//@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 +//@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:int32 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 have_access:Bool type:UserType language_code:string = User; -//@description Contains full information about a user (except the full list of profile photos) @is_blocked True, if the user is blacklisted by the current user -//@can_be_called True, if the user can be called @has_private_calls True, if the user can't be called due to their privacy settings +//@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 +//@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 //@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 included with the link when users share the bot @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 If the user is a bot, information about the bot; may be null -userFullInfo is_blocked:Bool can_be_called:Bool has_private_calls:Bool need_phone_number_privacy_exception:Bool bio:string share_text:string group_in_common_count:int32 bot_info:botInfo = UserFullInfo; - -//@description Contains full information about a user profile photo @id Unique user profile photo identifier @added_date Point in time (Unix timestamp) when the photo has been added @sizes Available variants of the user photo, in different sizes -userProfilePhoto id:int64 added_date:int32 sizes:vector = UserProfilePhoto; - -//@description Contains part of the list of user photos @total_count Total number of user profile photos @photos A list of photos -userProfilePhotos total_count:int32 photos:vector = UserProfilePhotos; +//@bio A short user bio @share_text For bots, the text that is included with the link when users share the bot +//@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 If the user is a bot, 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 need_phone_number_privacy_exception:Bool bio:string share_text: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 users total_count:int32 user_ids:vector = Users; @@ -345,7 +431,7 @@ chatAdministrators administrators:vector = ChatAdministrators //@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, and stickers and use inline bots. 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 @@ -357,8 +443,9 @@ chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_pol //@description The user is the owner of a chat and has all the administrator privileges //@custom_title A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only +//@is_anonymous True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only //@is_member True, if the user is a member of the chat -chatMemberStatusCreator custom_title:string is_member:Bool = ChatMemberStatus; +chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = ChatMemberStatus; //@description The user is a member of a chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, and ban unprivileged members. 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 @@ -371,7 +458,8 @@ chatMemberStatusCreator custom_title:string is_member:Bool = ChatMemberStatus; //@can_restrict_members True, if the administrator can restrict, ban, or unban chat members //@can_pin_messages True, if the administrator can pin messages; applicable to groups 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 -chatMemberStatusAdministrator custom_title:string can_be_edited: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 = ChatMemberStatus; +//@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_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 is_anonymous:Bool = ChatMemberStatus; //@description The user is a member of a chat, without any additional privileges or restrictions chatMemberStatusMember = ChatMemberStatus; @@ -390,8 +478,11 @@ chatMemberStatusLeft = ChatMemberStatus; chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus; -//@description A user with information about joining/leaving a chat @user_id User identifier of the chat member @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 a chat @status Status of the member in the chat @bot_info If the user is a bot, information about the bot; may be null. Can be null even for a bot if the bot is not a chat member +//@description A user with information about joining/leaving a chat @user_id User identifier of the chat member +//@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 +//@status Status of the member in the chat +//@bot_info If the user is a bot, information about the bot; may be null. Can be null even for a bot if the bot is not the chat member chatMember user_id:int32 inviter_user_id:int32 joined_chat_date:int32 status:ChatMemberStatus bot_info:botInfo = ChatMember; //@description Contains a list of chat members @total_count Approximate total count of chat members found @members A list of chat members @@ -409,6 +500,9 @@ chatMembersFilterAdministrators = ChatMembersFilter; //@description Returns all chat members, including restricted chat members chatMembersFilterMembers = ChatMembersFilter; +//@description Returns users which can be mentioned in the chat @message_thread_id If non-zero, the identifier of the current message thread +chatMembersFilterMention message_thread_id:int53 = ChatMembersFilter; + //@description Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup chatMembersFilterRestricted = ChatMembersFilter; @@ -439,6 +533,9 @@ supergroupMembersFilterRestricted query:string = SupergroupMembersFilter; //@description Returns users banned from the supergroup or channel; can be used only by administrators @query Query to search for supergroupMembersFilterBanned query:string = SupergroupMembersFilter; +//@description Returns users which can be mentioned in the supergroup @query Query to search for @message_thread_id If non-zero, the identifier of the current message thread +supergroupMembersFilterMention query:string message_thread_id:int53 = SupergroupMembersFilter; + //@description Returns bot members of the supergroup or channel supergroupMembersFilterBots = SupergroupMembersFilter; @@ -451,8 +548,13 @@ supergroupMembersFilterBots = SupergroupMembersFilter; //@upgraded_to_supergroup_id Identifier of the supergroup to which this group was upgraded; 0 if none basicGroup id:int32 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int32 = BasicGroup; -//@description Contains full information about a basic group @param_description Group description @creator_user_id User identifier of the creator of the group; 0 if unknown @members Group members @invite_link Invite link for this group; available only after it has been generated at least once and only for the group creator -basicGroupFullInfo description:string creator_user_id:int32 members:vector invite_link:string = BasicGroupFullInfo; +//@description Contains full information about a basic group +//@photo Chat photo; may be null +//@param_description Group description +//@creator_user_id User identifier of the creator of the group; 0 if unknown +//@members Group members +//@invite_link Invite link for this group; available only after it has been generated at least once and only for the group creator +basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int32 members:vector invite_link:string = 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 @@ -460,7 +562,7 @@ basicGroupFullInfo description:string creator_user_id:int32 members:vector= 66; 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. Video notes are supported if the layer >= 66; nested text entities and underline and strikethrough entities are supported if the layer >= 101 secretChat id:int32 user_id:int32 state:SecretChatState is_outbound:Bool ttl:int32 key_hash:bytes layer:int32 = SecretChat; +//@class MessageSender @description Contains information about the sender of a message + +//@description The message was sent by a known user @user_id Identifier of the user that sent the message +messageSenderUser user_id:int32 = MessageSender; + +//@description The message was sent on behalf of a chat @chat_id Identifier of the chat that sent the message +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 +messageSenders total_count:int32 senders:vector = MessageSenders; + + //@class MessageForwardOrigin @description Contains information about the origin of a forwarded message -//@description The message was originally written by a known user @sender_user_id Identifier of the user that originally sent the message +//@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message messageForwardOriginUser sender_user_id:int32 = MessageForwardOrigin; -//@description The message was originally written by a user, which is hidden by their privacy settings @sender_name Name of the sender +//@description The message was originally sent by an anonymous chat administrator on behalf of the chat +//@sender_chat_id Identifier of the chat that originally sent the message +//@author_signature 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 messageForwardOriginHiddenUser sender_name:string = MessageForwardOrigin; //@description The message was originally a post in a channel //@chat_id Identifier of the chat from which the message was originally forwarded -//@message_id Message identifier of the original message; 0 if unknown +//@message_id Message identifier of the original message //@author_signature Original post author signature messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin; @@ -536,9 +657,24 @@ messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:stri //@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 -//@from_chat_id For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown -//@from_message_id For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown -messageForwardInfo origin:MessageForwardOrigin date:int32 from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; +//@public_service_announcement_type The type of a public service announcement for the forwarded message +//@from_chat_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown +//@from_message_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown +messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; + +//@description Contains information about replies to a message +//@reply_count Number of times the message was directly or indirectly replied +//@recent_repliers Recent repliers to the message; available in channels with a discussion supergroup +//@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_repliers:vector last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 last_message_id:int53 = MessageReplyInfo; + +//@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 Contains 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; //@class MessageSendingState @description Contains information about the sending state of the message @@ -552,38 +688,43 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool r //@description Describes a message -//@id Message identifier, unique for the chat to which the message belongs -//@sender_user_id Identifier of the user who sent the message; 0 if unknown. Currently, it is unknown for channel posts and for channel posts automatically forwarded to discussion group +//@id Message identifier; unique for the chat to which the message belongs +//@sender The sender of the message //@chat_id Chat identifier //@sending_state Information about the sending state of the message; may be null //@scheduling_state Information about the scheduling state of the message; may be null //@is_outgoing True, if the message is outgoing -//@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the client +//@is_pinned True, if the message is pinned +//@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application //@can_be_forwarded True, if the message can be forwarded //@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 //@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 //@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 +//@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 //@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent -//@author_signature For channel posts, optional author signature -//@views Number of times this message was viewed +//@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 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_user_id:int32 chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo reply_to_message_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int32 author_signature:string views:int32 media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender: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_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_statistics:Bool can_get_message_thread: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:int32 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 messages total_count:int32 messages:vector = Messages; -//@description Contains a list of messages found by a search @messages List of messages @next_from_search_id Value to pass as from_search_id to get more results -foundMessages messages:vector next_from_search_id:int64 = FoundMessages; +//@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; //@class NotificationSettingsScope @description Describes the types of chats to which notification settings are applied @@ -615,8 +756,11 @@ chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_so 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 message to reply to; 0 if none @input_message_text Content of the message draft; this should always be of type inputMessageText -draftMessage reply_to_message_id:int53 input_message_text:InputMessageContent = DraftMessage; +//@description Contains information about a message draft +//@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; this should always be of type inputMessageText +draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage; //@class ChatType @description Describes the type of a chat @@ -634,6 +778,36 @@ chatTypeSupergroup supergroup_id:int32 is_channel:Bool = ChatType; chatTypeSecret secret_chat_id:int32 user_id:int32 = 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". +//-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 +//@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 +//@include_contacts True, if contacts need to be included +//@include_non_contacts True, if non-contact users need to be included +//@include_bots True, if bots need to be included +//@include_groups True, if basic groups and supergroups need to be included +//@include_channels True, if channels need to be included +chatFilter title:string icon_name:string pinned_chat_ids:vector included_chat_ids:vector excluded_chat_ids:vector exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFilter; + +//@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" +chatFilterInfo id:int32 title:string icon_name:string = ChatFilterInfo; + +//@description Describes a recommended chat filter @filter The chat filter @param_description Chat filter description +recommendedChatFilter filter:chatFilter description:string = RecommendedChatFilter; + +//@description Contains a list of recommended chat filters @chat_filters List of recommended chat filters +recommendedChatFilters chat_filters:vector = RecommendedChatFilters; + + //@class ChatList @description Describes a list of chats //@description A main list of chats @@ -642,19 +816,40 @@ chatListMain = ChatList; //@description A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives chatListArchive = ChatList; +//@description A list of chats belonging to a chat filter @chat_filter_id Chat filter identifier +chatListFilter chat_filter_id:int32 = ChatList; + +//@description Contains a list of chat lists @chat_lists List of chat lists +chatLists chat_lists:vector = ChatLists; + + +//@class ChatSource @description Describes a reason why an external chat is shown in a chat list + +//@description The chat is sponsored by the user's MTProxy server +chatSourceMtprotoProxy = ChatSource; + +//@description The chat contains a public service announcement @type The type of the announcement @text The text of the announcement +chatSourcePublicServiceAnnouncement type:string text:string = ChatSource; + + +//@description Describes a position of a chat in a chat list +//@list The chat list +//@order A parameter used to determine order of the chat in the chat list. Chats must be sorted by the pair (order, chat.id) in descending order +//@is_pinned True, if the chat is pinned in the chat list +//@source Source of the chat in the chat list; may be null +chatPosition list:ChatList order:int64 is_pinned:Bool source:ChatSource = ChatPosition; + //@description A chat. (Can be a private chat, basic group, supergroup, or secret chat) //@id Chat unique identifier //@type Type of the chat -//@chat_list A chat list to which the chat belongs; may be null //@title Chat title //@photo Chat photo; may be null //@permissions Actions that non-administrator chat members are allowed to take in the chat //@last_message Last message in the chat; may be null -//@order Descending parameter by which chats are sorted in the main chat list. If the order number of two chats is the same, they must be sorted in descending order by ID. If 0, the position of the chat in the list is undetermined -//@is_pinned True, if the chat is pinned +//@positions Positions of the chat in chat lists //@is_marked_as_unread True, if the chat is marked as unread -//@is_sponsored True, if the chat is sponsored by the user's MTProxy server +//@is_blocked True, if the chat is blocked by the current user and private messages from the chat can't be received //@has_scheduled_messages True, if the chat has scheduled messages //@can_be_deleted_only_for_self True, if the chat messages can be deleted only for the current user while other users will continue to see the messages //@can_be_deleted_for_all_users True, if the chat messages can be deleted for all users @@ -666,17 +861,16 @@ chatListArchive = ChatList; //@unread_mention_count Number of unread messages with a mention/reply in the chat //@notification_settings Notification settings for this chat //@action_bar Describes actions which should be possible to do through a chat action bar; may be null -//@pinned_message_id Identifier of the pinned message in the chat; 0 if none //@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 Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType chat_list:ChatList title:string photo:chatPhoto permissions:chatPermissions last_message:message order:int64 is_pinned:Bool is_marked_as_unread:Bool is_sponsored: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 action_bar:ChatActionBar pinned_message_id:int53 reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +//@client_data Contains 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 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 action_bar:ChatActionBar reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; -//@description Represents a list of chats @chat_ids List of chat identifiers -chats chat_ids:vector = Chats; +//@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; -//@description Describes a chat located nearby @chat_id Chat identifier @distance Distance to the chat location in meters +//@description Describes a chat located nearby @chat_id Chat identifier @distance Distance to the chat location, in meters chatNearby chat_id:int53 distance:int32 = ChatNearby; //@description Represents a list of chats located nearby @users_nearby List of users nearby @supergroups_nearby List of location-based supergroups nearby @@ -687,14 +881,15 @@ chatsNearby users_nearby:vector supergroups_nearby:vector is_public:Bool = ChatInviteLinkInfo; +chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string photo:chatPhotoInfo member_count:int32 member_user_ids:vector is_public:Bool = ChatInviteLinkInfo; //@class PublicChatType @description Describes a type of public chats @@ -709,13 +904,16 @@ publicChatTypeIsLocationBased = PublicChatType; //@class ChatActionBar @description Describes actions which should be possible to do through a chat action bar //@description The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam -chatActionBarReportSpam = ChatActionBar; +//@can_unarchive 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 +chatActionBarReportSpam can_unarchive:Bool = ChatActionBar; //@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation chatActionBarReportUnrelatedLocation = ChatActionBar; -//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be added to the contact list using the method addContact, or the other user can be blocked using the method blockUser -chatActionBarReportAddBlock = ChatActionBar; +//@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 blockUser, or the other user can be added to the contact list using the method addContact +//@can_unarchive 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 +//@distance If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users +chatActionBarReportAddBlock can_unarchive:Bool distance:int32 = ChatActionBar; //@description The chat is a private or secret chat and the other user can be added to the contact list using the method addContact chatActionBarAddContact = ChatActionBar; @@ -751,10 +949,13 @@ inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType; //@description A button that opens a specified URL and automatically logs in in current user if they allowed to do that @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:int32 forward_text:string = InlineKeyboardButtonType; -//@description A button that sends a special callback query to a bot @data Data to be sent to the bot via a callback query +//@description A button that sends a callback query to a bot @data Data to be sent to the bot via a callback query inlineKeyboardButtonTypeCallback data:bytes = InlineKeyboardButtonType; -//@description A button with a game that sends a special callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame +//@description A button that asks for password of the current user and then sends a callback query to a bot @data Data to be sent to the bot via a callback query +inlineKeyboardButtonTypeCallbackWithPassword data:bytes = InlineKeyboardButtonType; + +//@description A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame inlineKeyboardButtonTypeCallbackGame = InlineKeyboardButtonType; //@description A button that forces an inline query to the bot to be inserted in the input field @query Inline query to be sent to the bot @in_current_chat True, if the inline query should be sent from the current chat @@ -770,18 +971,18 @@ inlineKeyboardButton text:string type:InlineKeyboardButtonType = InlineKeyboardB //@class ReplyMarkup @description Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots -//@description Instructs clients 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 //@is_personal True, if the keyboard is removed only for the mentioned users or the target user of a reply replyMarkupRemoveKeyboard is_personal:Bool = ReplyMarkup; -//@description Instructs clients to force a reply to this message +//@description Instructs application to force a reply to this message //@is_personal True, if a forced reply must automatically be shown to the current user. For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user of a reply replyMarkupForceReply is_personal:Bool = ReplyMarkup; //@description Contains a custom keyboard layout to quickly reply to bots //@rows A list of rows of bot keyboard buttons -//@resize_keyboard True, if the client needs to resize the keyboard vertically -//@one_time True, if the client needs to hide the keyboard after use +//@resize_keyboard True, if the application needs to resize the keyboard vertically +//@one_time True, if the application needs to hide the keyboard after use //@is_personal True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply replyMarkupShowKeyboard rows:vector> resize_keyboard:Bool one_time:Bool is_personal:Bool = ReplyMarkup; @@ -800,6 +1001,15 @@ loginUrlInfoOpen url:string skip_confirm:Bool = LoginUrlInfo; loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int32 request_write_access:Bool = LoginUrlInfo; +//@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 +//@reply_info Contains information about the message thread +//@messages The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) +//@draft_message A draft of a message in the message thread; may be null +messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo messages:vector draft_message:draftMessage = MessageThreadInfo; + + //@class RichText @description Describes a text object inside an instant-view web page //@description A plain text @text Text @@ -843,8 +1053,14 @@ richTextPhoneNumber text:RichText phone_number:string = RichText; //@height Height of a bounding box in which the image should be shown; 0 if unknown richTextIcon document:document width:int32 height:int32 = RichText; -//@description A rich text anchor @text Text @name Anchor name -richTextAnchor text:RichText name:string = RichText; +//@description A reference to a richTexts object on the same web page @text The text @anchor_name The name of a richTextAnchor object, which is the first element of the target richTexts object @url An HTTP URL, opening the reference +richTextReference text:RichText anchor_name:string url:string = RichText; + +//@description An anchor @name Anchor name +richTextAnchor name:string = RichText; + +//@description A link to an anchor on the same web page @text The link text @anchor_name The anchor name. If the name is empty, the link should bring back to top @url An HTTP URL, opening the anchor +richTextAnchorLink text:RichText anchor_name:string url:string = RichText; //@description A concatenation of rich texts @texts Texts richTexts texts:vector = RichText; @@ -963,7 +1179,7 @@ pageBlockCollage page_blocks:vector caption:pageBlockCaption = PageBl 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 should be resolved -pageBlockChatLink title:string photo:chatPhoto username:string = PageBlock; +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 pageBlockTable caption:RichText cells:vector> is_bordered:Bool is_striped:Bool = PageBlock; @@ -978,12 +1194,13 @@ pageBlockRelatedArticles header:RichText articles:vector version:int32 url:string is_rtl:Bool is_full:Bool = WebPageInstantView; +webPageInstantView page_blocks:vector view_count:int32 version:int32 is_rtl:Bool is_full:Bool = WebPageInstantView; //@description Describes a web page preview @@ -1008,7 +1225,32 @@ webPageInstantView page_blocks:vector version:int32 url:string is_rtl //@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 -webPage url:string display_url:string type:string site_name:string title:string description:string 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; +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; + + +//@description Contains information about a country +//@country_code A two-letter ISO 3166-1 alpha-2 country code +//@name Native name of the country +//@english_name English name of the country +//@is_hidden True, if the country should be hidden from the list of all countries +//@calling_codes List of country calling codes +countryInfo country_code:string name:string english_name:string is_hidden:Bool calling_codes:vector = CountryInfo; + +//@description Contains information about countries @countries The list of countries +countries countries:vector = Countries; + +//@description Contains information about a phone number +//@country Information about the country to which the phone number belongs; may be null +//@country_calling_code The part of the phone number denoting country calling code or its part +//@formatted_phone_number The phone number without country calling code formatted accordingly to local rules +phoneNumberInfo country:countryInfo country_calling_code:string formatted_phone_number:string = PhoneNumberInfo; + + +//@description Describes an action associated with a bank card number @text Action text @url The URL to be opened +bankCardActionOpenUrl text:string url:string = BankCardActionOpenUrl; + +//@description Information about a bank card @title Title of the bank card description @actions Actions that can be done with the bank card number +bankCardInfo title:string actions:vector = BankCardInfo; //@description Describes an address @country_code A two-letter ISO 3166-1 alpha-2 country code @state State, if applicable @city City @street_line1 First line of the address @street_line2 Second line of the address @postal_code Address postal code @@ -1265,7 +1507,7 @@ passportSuitableElement type:PassportElementType is_selfie_required:Bool is_tran passportRequiredElement suitable_elements:vector = PassportRequiredElement; //@description Contains information about a Telegram Passport authorization form that was requested @id Unique identifier of the authorization form -//@required_elements Information about the Telegram Passport elements that need to be provided to complete the form +//@required_elements Information about the Telegram Passport elements that must be provided to complete the form //@privacy_policy_url URL for the privacy policy of the service; may be empty passportAuthorizationForm id:int32 required_elements:vector privacy_policy_url:string = PassportAuthorizationForm; @@ -1350,9 +1592,11 @@ messageVideoNote video_note:videoNote is_viewed:Bool is_secret:Bool = MessageCon //@description A voice note message @voice_note The voice note description @caption Voice note caption @is_listened True, if at least one of the recipients has listened to the voice note messageVoiceNote voice_note:voiceNote caption:formattedText is_listened:Bool = MessageContent; -//@description A message with a location @location The location description @live_period Time relative to the message sent date until which the location can be updated, in seconds +//@description A message with a location @location The location description @live_period Time relative to the message send date, for which the location can be updated, in seconds //@expires_in Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes -messageLocation location:location live_period:int32 expires_in:int32 = MessageContent; +//@heading For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown +//@proximity_alert_radius 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 +messageLocation location:location live_period:int32 expires_in:int32 heading:int32 proximity_alert_radius:int32 = MessageContent; //@description A message with information about a venue @venue The venue description messageVenue venue:venue = MessageContent; @@ -1360,6 +1604,14 @@ messageVenue venue:venue = MessageContent; //@description A message with a user contact @contact The contact description messageContact contact:contact = MessageContent; +//@description A dice message. The dice value is randomly generated by the server +//@initial_state The animated stickers with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known +//@final_state The animated stickers with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known +//@emoji Emoji on which the dice throw animation is based +//@value The dice value. If the value is 0, the dice don't have final state yet +//@success_animation_frame_number Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded +messageDice initial_state:DiceStickers final_state:DiceStickers emoji:string value:int32 success_animation_frame_number:int32 = MessageContent; + //@description A message with a game @game The game description messageGame game:game = MessageContent; @@ -1371,8 +1623,8 @@ messagePoll poll:poll = MessageContent; //@need_shipping_address True, if the shipping address should be specified @receipt_message_id The identifier of the message with the receipt, after the product has been purchased messageInvoice title:string description:string photo:photo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 = MessageContent; -//@description A message with information about an ended call @discard_reason Reason why the call was discarded @duration Call duration, in seconds -messageCall discard_reason:CallDiscardReason duration:int32 = MessageContent; +//@description A message with information about an ended call @is_video True, if the call was a video call @discard_reason Reason why the call was discarded @duration Call duration, in seconds +messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = MessageContent; //@description A newly created basic group @title Title of the basic group @member_user_ids User identifiers of members in the basic group messageBasicGroupChatCreate title:string member_user_ids:vector = MessageContent; @@ -1384,7 +1636,7 @@ messageSupergroupChatCreate title:string = MessageContent; messageChatChangeTitle title:string = MessageContent; //@description An updated chat photo @photo New chat photo -messageChatChangePhoto photo:photo = MessageContent; +messageChatChangePhoto photo:chatPhoto = MessageContent; //@description A deleted chat photo messageChatDeletePhoto = MessageContent; @@ -1439,7 +1691,10 @@ messagePassportDataSent types:vector = MessageContent; //@description Telegram Passport data has been received; for bots only @elements List of received Telegram Passport elements @credentials Encrypted data credentials messagePassportDataReceived elements:vector credentials:encryptedCredentials = MessageContent; -//@description Message content that is not supported by the client +//@description A user in the chat came within proximity alert range @traveler The user or chat, which triggered the proximity alert @watcher The user or chat, which subscribed for the proximity alert @distance The distance between the users +messageProximityAlertTriggered traveler:MessageSender watcher:MessageSender distance:int32 = MessageContent; + +//@description Message content that is not supported in the current TDLib version messageUnsupported = MessageContent; @@ -1466,6 +1721,9 @@ textEntityTypeEmailAddress = TextEntityType; //@description A phone number textEntityTypePhoneNumber = TextEntityType; +//@description A bank card number. The getBankCardInfo method can be used to get information about the bank card +textEntityTypeBankCardNumber = TextEntityType; + //@description A bold text textEntityTypeBold = TextEntityType; @@ -1494,7 +1752,7 @@ textEntityTypeTextUrl url:string = TextEntityType; textEntityTypeMentionName user_id:int32 = TextEntityType; -//@description A thumbnail to be sent along with a file; should be in JPEG or WEBP format for stickers, and less than 200 kB in size @thumbnail Thumbnail file to send. Sending thumbnails by file_id is currently not supported +//@description A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size @thumbnail Thumbnail file to send. Sending thumbnails by file_id is currently not supported //@width Thumbnail width, usually shouldn't exceed 320. Use 0 if unknown @height Thumbnail height, usually shouldn't exceed 320. Use 0 if unknown inputThumbnail thumbnail:InputFile width:int32 height:int32 = InputThumbnail; @@ -1508,11 +1766,17 @@ messageSchedulingStateSendAtDate send_date:int32 = MessageSchedulingState; messageSchedulingStateSendWhenOnline = MessageSchedulingState; -//@description Options to be used when a message is send -//@disable_notification Pass true to disable notification for the message. Must be false if the message is sent to a secret chat +//@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 //@scheduling_state Message scheduling state. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled -sendMessageOptions disable_notification:Bool from_background:Bool scheduling_state:MessageSchedulingState = SendMessageOptions; +messageSendOptions disable_notification:Bool from_background:Bool scheduling_state:MessageSchedulingState = MessageSendOptions; + +//@description Options to be used when a message content is copied without a link to the original message +//@send_copy True, if content of the message needs to be copied without a link to the original message. Always true if the message is forwarded to a secret chat +//@replace_caption True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false +//@new_caption New message caption. Ignored if replace_caption is false +messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText = MessageCopyOptions; //@class InputMessageContent @description The content of a message to send @@ -1521,15 +1785,16 @@ sendMessageOptions disable_notification:Bool from_background:Bool scheduling_sta //@disable_web_page_preview True, if rich web page previews for URLs in the message text should be disabled @clear_draft True, if a chat message draft should be deleted inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent; -//@description An animation message (GIF-style). @animation Animation file to be sent @thumbnail Animation thumbnail, if available @duration Duration of the animation, in seconds @width Width of the animation; may be replaced by the server @height Height of the animation; may be replaced by the server @caption Animation caption; 0-GetOption("message_caption_length_max") characters -inputMessageAnimation animation:InputFile thumbnail:inputThumbnail duration:int32 width:int32 height:int32 caption:formattedText = InputMessageContent; +//@description An animation message (GIF-style). @animation Animation file to be sent @thumbnail Animation thumbnail, if available @added_sticker_file_ids File identifiers of the stickers added to the animation, if applicable +//@duration Duration of the animation, in seconds @width Width of the animation; may be replaced by the server @height Height of the animation; may be replaced by the server @caption Animation caption; 0-GetOption("message_caption_length_max") characters +inputMessageAnimation animation:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector duration:int32 width:int32 height:int32 caption:formattedText = InputMessageContent; //@description An audio message @audio Audio file to be sent @album_cover_thumbnail Thumbnail of the cover for the album, if available @duration Duration of the audio, in seconds; may be replaced by the server @title Title of the audio; 0-64 characters; may be replaced by the server //@performer Performer of the audio; 0-64 characters, may be replaced by the server @caption Audio caption; 0-GetOption("message_caption_length_max") characters inputMessageAudio audio:InputFile album_cover_thumbnail:inputThumbnail duration:int32 title:string performer:string caption:formattedText = InputMessageContent; -//@description A document message (general file) @document Document to be sent @thumbnail Document thumbnail, if available @caption Document caption; 0-GetOption("message_caption_length_max") characters -inputMessageDocument document:InputFile thumbnail:inputThumbnail caption:formattedText = InputMessageContent; +//@description A document message (general file) @document Document to be sent @thumbnail Document thumbnail, if available @disable_content_type_detection 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 @caption Document caption; 0-GetOption("message_caption_length_max") characters +inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content_type_detection:Bool caption:formattedText = InputMessageContent; //@description A photo message @photo Photo to send @thumbnail Photo thumbnail to be sent, this is sent to the other party in secret chats only @added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable @width Photo width @height Photo height @caption Photo caption; 0-GetOption("message_caption_length_max") characters //@ttl Photo TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats @@ -1550,7 +1815,9 @@ inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int inputMessageVoiceNote voice_note:InputFile duration:int32 waveform:bytes caption:formattedText = InputMessageContent; //@description A message with a location @location Location to be sent @live_period Period for which the location can be updated, in seconds; should be between 60 and 86400 for a live location and 0 otherwise -inputMessageLocation location:location live_period:int32 = InputMessageContent; +//@heading For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown +//@proximity_alert_radius For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can't be enabled in channels and Saved Messages +inputMessageLocation location:location live_period:int32 heading:int32 proximity_alert_radius:int32 = InputMessageContent; //@description A message with information about a venue @venue Venue to send inputMessageVenue venue:venue = InputMessageContent; @@ -1558,6 +1825,9 @@ inputMessageVenue venue:venue = InputMessageContent; //@description A message containing a user contact @contact Contact to send inputMessageContact contact:contact = InputMessageContent; +//@description A dice message @emoji Emoji on which the dice throw animation is based @clear_draft True, if a chat message draft should be deleted +inputMessageDice emoji:string clear_draft:Bool = InputMessageContent; + //@description A message with a game; not supported for channels or secret chats @bot_user_id User identifier of the bot that owns the game @game_short_name Short name of the game inputMessageGame bot_user_id:int32 game_short_name:string = InputMessageContent; @@ -1565,15 +1835,17 @@ inputMessageGame bot_user_id:int32 game_short_name:string = InputMessageContent; //@payload The invoice payload @provider_token Payment provider token @provider_data JSON-encoded data about the invoice, which will be shared with the payment provider @start_parameter Unique invoice bot start_parameter for the generation of this invoice inputMessageInvoice invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string = InputMessageContent; -//@description 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 @question Poll question, 1-255 characters @options List of poll answer options, 2-10 strings 1-100 characters each -//@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels @type Type of the poll @is_closed True, if the poll needs to be sent already closed; for bots only -inputMessagePoll question:string options:vector is_anonymous:Bool type:PollType is_closed:Bool = InputMessageContent; +//@description 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 @question Poll question, 1-255 characters (up to 300 characters for bots) @options List of poll answer options, 2-10 strings 1-100 characters each +//@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels @type Type of the poll +//@open_period Amount of time the poll will be active after creation, in seconds; for bots only +//@close_date Point in time (Unix timestamp) when the poll will be automatically closed; for bots only +//@is_closed True, if the poll needs to be sent already closed; for bots only +inputMessagePoll question:string options:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = InputMessageContent; //@description A forwarded message @from_chat_id Identifier for the chat this forwarded message came from @message_id Identifier of the message to forward //@in_game_share True, if a game message should be shared within a launched game; applies only to game messages -//@send_copy True, if content of the message needs to be copied without a link to the original message. Always true if the message is forwarded to a secret chat -//@remove_caption True, if media caption of the message copy needs to be removed. Ignored if send_copy is false -inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool send_copy:Bool remove_caption:Bool = InputMessageContent; +//@copy_options Options to be used to copy content of the message without a link to the original message +inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool copy_options:messageCopyOptions = InputMessageContent; //@class SearchMessagesFilter @description Represents a filter for message search results @@ -1623,9 +1895,15 @@ searchMessagesFilterVoiceAndVideoNote = SearchMessagesFilter; //@description Returns only messages with mentions of the current user, or messages that are replies to their messages 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 or by the sending user +//@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 failed to send messages. This filter can be used only if the message database is used +searchMessagesFilterFailedToSend = SearchMessagesFilter; + +//@description Returns only pinned messages +searchMessagesFilterPinned = SearchMessagesFilter; + //@class ChatAction @description Describes the different types of activity in a chat @@ -1685,18 +1963,18 @@ 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 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 //@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 //@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:photoSize 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 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 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 //@is_installed True, if the sticker set has been installed by 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 -//@size Total number of stickers in the set @covers Contains up to the first 5 stickers from the set, depending on the context. If the client needs more stickers the full set should be requested -stickerSetInfo id:int64 title:string name:string thumbnail:photoSize is_installed:Bool is_archived:Bool is_official:Bool is_animated:Bool is_masks:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +//@size Total number of stickers in the set @covers Contains up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full set should be requested +stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail 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; @@ -1720,11 +1998,26 @@ callDiscardReasonDisconnected = CallDiscardReason; callDiscardReasonHungUp = CallDiscardReason; -//@description Specifies the supported call protocols @udp_p2p True, if UDP peer-to-peer connections are supported @udp_reflector True, if connection through UDP reflectors is supported @min_layer The minimum supported API layer; use 65 @max_layer The maximum supported API layer; use 65 -callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 = CallProtocol; +//@description Specifies the supported call protocols +//@udp_p2p True, if UDP peer-to-peer connections are supported +//@udp_reflector True, if connection through UDP reflectors is supported +//@min_layer The minimum supported API layer; use 65 +//@max_layer The maximum supported API layer; use 65 +//@library_versions List of supported libtgvoip versions +callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 library_versions:vector = CallProtocol; -//@description Describes the address of UDP reflectors @id Reflector identifier @ip IPv4 reflector address @ipv6 IPv6 reflector address @port Reflector port number @peer_tag Connection peer tag -callConnection id:int64 ip:string ipv6:string port:int32 peer_tag:bytes = CallConnection; + +//@class CallServerType @description Describes the type of a call server + +//@description A Telegram call reflector @peer_tag A peer tag to be used with the reflector +callServerTypeTelegramReflector peer_tag:bytes = CallServerType; + +//@description A WebRTC server @username Username to be used for authentication @password Authentication password @supports_turn True, if the server supports TURN @supports_stun True, if the server supports STUN +callServerTypeWebrtc username:string password:string supports_turn:Bool supports_stun:Bool = CallServerType; + + +//@description Describes a server for relaying call data @id Server identifier @ip_address Server IPv4 address @ipv6_address Server IPv6 address @port Server port number @type Server type +callServer id:int64 ip_address:string ipv6_address:string port:int32 type:CallServerType = CallServer; //@description Contains the call identifier @id Call identifier @@ -1739,8 +2032,8 @@ callStatePending is_created:Bool is_received:Bool = CallState; //@description The call has been answered and encryption keys are being exchanged callStateExchangingKeys = CallState; -//@description The call is ready to use @protocol Call protocols supported by the peer @connections Available UDP reflectors @config A JSON-encoded call config @encryption_key Call encryption key @emojis Encryption key emojis fingerprint @allow_p2p True, if peer-to-peer connection is allowed by users privacy settings -callStateReady protocol:callProtocol connections:vector config:string encryption_key:bytes emojis:vector allow_p2p:Bool = CallState; +//@description The call is ready to use @protocol Call protocols supported by the peer @servers List of available call servers @config A JSON-encoded call config @encryption_key Call encryption key @emojis Encryption key emojis fingerprint @allow_p2p True, if peer-to-peer connection is allowed by users privacy settings +callStateReady protocol:callProtocol servers:vector config:string encryption_key:bytes emojis:vector allow_p2p:Bool = CallState; //@description The call is hanging up after discardCall has been called callStateHangingUp = CallState; @@ -1775,15 +2068,21 @@ callProblemSilentRemote = CallProblem; //@description The call ended unexpectedly callProblemDropped = CallProblem; +//@description The video was distorted +callProblemDistortedVideo = CallProblem; -//@description Describes a call @id Call identifier, not persistent @user_id Peer user identifier @is_outgoing True, if the call is outgoing @state Call state -call id:int32 user_id:int32 is_outgoing:Bool state:CallState = Call; +//@description The video was pixelated +callProblemPixelatedVideo = CallProblem; + + +//@description Describes a call @id Call identifier, not persistent @user_id Peer user identifier @is_outgoing True, if the call is outgoing @is_video True, if the call is a video call @state Call state +call id:int32 user_id:int32 is_outgoing:Bool is_video:Bool state:CallState = Call; //@description Contains settings for the authentication of the user's phone number //@allow_flash_call Pass true if the authentication code may be sent via flash 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 app can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details +//@allow_sms_retriever_api For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details phoneNumberAuthenticationSettings allow_flash_call:Bool is_current_phone_number:Bool allow_sms_retriever_api:Bool = PhoneNumberAuthenticationSettings; @@ -1791,6 +2090,20 @@ phoneNumberAuthenticationSettings allow_flash_call:Bool is_current_phone_number: animations animations:vector = Animations; +//@class DiceStickers @description Contains animated stickers which should be used for dice animation rendering + +//@description A regular animated sticker @sticker The animated sticker with the dice animation +diceStickersRegular sticker:sticker = DiceStickers; + +//@description Animated stickers to be combined into a slot machine +//@background The animated sticker with the slot machine background. The background animation must start playing after all reel animations finish +//@lever The animated sticker with the lever animation. The lever animation must play once in the initial dice state +//@left_reel The animated sticker with the left reel +//@center_reel The animated sticker with the center reel +//@right_reel The animated sticker with the right reel +diceStickersSlotMachine background:sticker lever:sticker left_reel:sticker center_reel:sticker right_reel:sticker = DiceStickers; + + //@description Represents the result of an ImportContacts request @user_ids User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user //@importer_count The number of users that imported the corresponding contact; 0 for already registered users or if unavailable importedContacts user_ids:vector importer_count:vector = ImportedContacts; @@ -1802,17 +2115,14 @@ httpUrl url:string = HttpUrl; //@class InputInlineQueryResult @description Represents a single result of an inline query; for bots only -//@description Represents a link to an animated GIF @id Unique identifier of the query result @title Title of the query result @thumbnail_url URL of the static result thumbnail (JPEG or GIF), if it exists -//@gif_url The URL of the GIF-file (file size must not exceed 1MB) @gif_duration Duration of the GIF, in seconds @gif_width Width of the GIF @gif_height Height of the GIF +//@description Represents a link to an animated GIF or an animated (i.e. without sound) H.264/MPEG-4 AVC video +//@id Unique identifier of the query result @title Title of the query result +//@thumbnail_url URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists @thumbnail_mime_type MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4" +//@video_url The URL of the video file (file size must not exceed 1MB) @video_mime_type MIME type of the video file. Must be one of "image/gif" and "video/mp4" +//@video_duration Duration of the video, in seconds @video_width Width of the video @video_height Height of the video //@reply_markup The message reply markup. 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, InputMessageAnimation, InputMessageLocation, InputMessageVenue or InputMessageContact -inputInlineQueryResultAnimatedGif id:string title:string thumbnail_url:string gif_url:string gif_duration:int32 gif_width:int32 gif_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; - -//@description Represents a link to an animated (i.e. without sound) H.264/MPEG-4 AVC video @id Unique identifier of the query result @title Title of the result @thumbnail_url URL of the static result thumbnail (JPEG or GIF), if it exists -//@mpeg4_url The URL of the MPEG4-file (file size must not exceed 1MB) @mpeg4_duration Duration of the video, in seconds @mpeg4_width Width of the video @mpeg4_height Height of the video -//@reply_markup The message reply markup. 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, InputMessageAnimation, InputMessageLocation, InputMessageVenue or InputMessageContact -inputInlineQueryResultAnimatedMpeg4 id:string title:string thumbnail_url:string mpeg4_url:string mpeg4_duration:int32 mpeg4_width:int32 mpeg4_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; +inputInlineQueryResultAnimation id:string title:string thumbnail_url:string thumbnail_mime_type:string video_url:string video_mime_type:string video_duration:int32 video_width:int32 video_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to an article or web page @id Unique identifier of the query result @url URL of the result, if it exists @hide_url True, if the URL must be not shown @title Title of the result //@param_description A short description of the result @thumbnail_url URL of the result thumbnail, if it exists @thumbnail_width Thumbnail width, if known @thumbnail_height Thumbnail height, if known @@ -1840,7 +2150,9 @@ inputInlineQueryResultDocument id:string title:string description:string documen //@description Represents a game @id Unique identifier of the query result @game_short_name Short name of the game @reply_markup Message reply markup. Must be of type replyMarkupInlineKeyboard or null inputInlineQueryResultGame id:string game_short_name:string reply_markup:ReplyMarkup = InputInlineQueryResult; -//@description Represents a point on the map @id Unique identifier of the query result @location Location result @live_period Amount of time relative to the message sent time until the location can be updated, in seconds @title Title of the result @thumbnail_url URL of the result thumbnail, if it exists @thumbnail_width Thumbnail width, if known @thumbnail_height Thumbnail height, if known +//@description Represents a point on the map @id Unique identifier of the query result @location Location result +//@live_period Amount of time relative to the message sent time until the location can be updated, in seconds +//@title Title of the result @thumbnail_url URL of the result thumbnail, if it exists @thumbnail_width Thumbnail width, if known @thumbnail_height Thumbnail height, if known //@reply_markup The message reply markup. 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, InputMessageLocation, InputMessageVenue or InputMessageContact inputInlineQueryResultLocation id:string location:location live_period:int32 title:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; @@ -1879,17 +2191,17 @@ inputInlineQueryResultVoiceNote id:string title:string voice_note_url:string voi //@class InlineQueryResult @description Represents a single result of an inline query //@description Represents a link to an article or web page @id Unique identifier of the query result @url URL of the result, if it exists @hide_url True, if the URL must be not shown @title Title of the result -//@param_description A short description of the result @thumbnail Result thumbnail; may be null -inlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumbnail:photoSize = InlineQueryResult; +//@param_description A short description of the result @thumbnail Result thumbnail in JPEG format; may be null +inlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumbnail:thumbnail = InlineQueryResult; -//@description Represents a user contact @id Unique identifier of the query result @contact A user contact @thumbnail Result thumbnail; may be null -inlineQueryResultContact id:string contact:contact thumbnail:photoSize = InlineQueryResult; +//@description Represents a user contact @id Unique identifier of the query result @contact A user contact @thumbnail Result thumbnail in JPEG format; may be null +inlineQueryResultContact id:string contact:contact thumbnail:thumbnail = InlineQueryResult; -//@description Represents a point on the map @id Unique identifier of the query result @location Location result @title Title of the result @thumbnail Result thumbnail; may be null -inlineQueryResultLocation id:string location:location title:string thumbnail:photoSize = InlineQueryResult; +//@description Represents a point on the map @id Unique identifier of the query result @location Location result @title Title of the result @thumbnail Result thumbnail in JPEG format; may be null +inlineQueryResultLocation id:string location:location title:string thumbnail:thumbnail = InlineQueryResult; -//@description Represents information about a venue @id Unique identifier of the query result @venue Venue result @thumbnail Result thumbnail; may be null -inlineQueryResultVenue id:string venue:venue thumbnail:photoSize = InlineQueryResult; +//@description Represents information about a venue @id Unique identifier of the query result @venue Venue result @thumbnail Result thumbnail in JPEG format; may be null +inlineQueryResultVenue id:string venue:venue thumbnail:thumbnail = InlineQueryResult; //@description Represents information about a game @id Unique identifier of the query result @game Game result inlineQueryResultGame id:string game:game = InlineQueryResult; @@ -1923,10 +2235,13 @@ inlineQueryResults inline_query_id:int64 next_offset:string results:vector = LocalizationTargetInfo; -//@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, you must specify the correct application platform and upload valid server authentication data at https://my.telegram.org +//@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 should be additionally encrypted deviceTokenFirebaseCloudMessaging token:string encrypt:Bool = DeviceToken; @@ -2275,7 +2590,8 @@ pushMessageContentChatJoinByLink = PushMessageContent; pushMessageContentMessageForwards total_count:int32 = PushMessageContent; //@description A media album @total_count Number of messages in the album @has_photos True, if the album has at least one photo @has_videos True, if the album has at least one video -pushMessageContentMediaAlbum total_count:int32 has_photos:Bool has_videos:Bool = PushMessageContent; +//@has_audios True, if the album has at least one audio file @has_documents True, if the album has at least one document +pushMessageContentMediaAlbum total_count:int32 has_photos:Bool has_videos:Bool has_audios:Bool has_documents:Bool = PushMessageContent; //@class NotificationType @description Contains detailed information about a notification @@ -2290,9 +2606,12 @@ notificationTypeNewSecretChat = NotificationType; notificationTypeNewCall call_id:int32 = NotificationType; //@description New message was received through a push notification -//@message_id The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages and as reply_to_message_id -//@sender_user_id Sender of the message. Corresponding user may be inaccessible @content Push message content -notificationTypeNewPushMessage message_id:int53 sender_user_id:int32 content:PushMessageContent = NotificationType; +//@message_id The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id +//@sender The sender of the message. Corresponding user or chat may be inaccessible +//@sender_name Name of the sender +//@is_outgoing True, if the message is outgoing +//@content Push message content +notificationTypeNewPushMessage message_id:int53 sender:MessageSender sender_name:string is_outgoing:Bool content:PushMessageContent = NotificationType; //@class NotificationGroupType @description Describes the type of notifications in a notification group @@ -2329,7 +2648,7 @@ optionValueBoolean value:Bool = OptionValue; optionValueEmpty = OptionValue; //@description Represents an integer option @value The value of the option -optionValueInteger value:int32 = OptionValue; +optionValueInteger value:int64 = OptionValue; //@description Represents a string option @value The value of the option optionValueString value:string = OptionValue; @@ -2474,15 +2793,16 @@ chatReportReasonUnrelatedLocation = ChatReportReason; chatReportReasonCustom text:string = ChatReportReason; -//@description Contains a public HTTPS link to a message in a supergroup or channel with a username @link Message link @html HTML-code for embedding the message -publicMessageLink link:string html:string = PublicMessageLink; +//@description Contains an HTTPS link to a message in a supergroup or channel @link Message link @is_public True, if the link will work for non-members of the chat +messageLink link:string is_public:Bool = MessageLink; //@description Contains information about a link to a message in a chat //@is_public True, if the link is a public link for a message in a chat //@chat_id If found, identifier of the chat to which the message belongs, 0 otherwise //@message If found, the linked message; may be null //@for_album True, if the whole media album to which the message belongs is linked -messageLinkInfo is_public:Bool chat_id:int53 message:message for_album:Bool = MessageLinkInfo; +//@for_comment True, if the message is linked as a channel post comment or from a message thread +messageLinkInfo is_public:Bool chat_id:int53 message:message for_album:Bool for_comment:Bool = MessageLinkInfo; //@description Contains a part of a file @data File bytes @@ -2586,7 +2906,7 @@ networkStatisticsEntryFile file_type:FileType network_type:NetworkType sent_byte //@sent_bytes Total number of bytes sent @received_bytes Total number of bytes received @duration Total call duration, in seconds networkStatisticsEntryCall network_type:NetworkType sent_bytes:int53 received_bytes:int53 duration:double = NetworkStatisticsEntry; -//@description A full list of available network statistic entries @since_date Point in time (Unix timestamp) when the app began collecting statistics @entries Network statistics entries +//@description A full list of available network statistic entries @since_date Point in time (Unix timestamp) from which the statistics are collected @entries Network statistics entries networkStatistics since_date:int32 entries:vector = NetworkStatistics; @@ -2596,7 +2916,7 @@ networkStatistics since_date:int32 entries:vector = Netw //@max_video_file_size The maximum size of a video file to be auto-downloaded //@max_other_file_size The maximum size of other file types to be auto-downloaded //@video_upload_bitrate The maximum suggested bitrate for uploaded videos -//@preload_large_videos True, if the beginning of videos needs to be preloaded for instant playback +//@preload_large_videos True, if the beginning of video files needs to be preloaded for instant playback //@preload_next_audio True, if the next audio track needs to be preloaded while the user is listening to an audio file //@use_less_data_for_calls True, if "use less data for calls" option needs to be enabled autoDownloadSettings is_auto_download_enabled:Bool max_photo_file_size:int32 max_video_file_size:int32 max_other_file_size:int32 video_upload_bitrate:int32 preload_large_videos:Bool preload_next_audio:Bool use_less_data_for_calls:Bool = AutoDownloadSettings; @@ -2619,7 +2939,7 @@ connectionStateConnectingToProxy = ConnectionState; //@description Currently establishing a connection to the Telegram servers connectionStateConnecting = ConnectionState; -//@description Downloading data received while the client was offline +//@description Downloading data received while the application was offline connectionStateUpdating = ConnectionState; //@description There is a working connection to the Telegram servers @@ -2671,6 +2991,15 @@ tMeUrl url:string type:TMeUrlType = TMeUrl; tMeUrls urls:vector = TMeUrls; +//@class SuggestedAction @description Describes an action suggested to the current user + +//@description Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option +suggestedActionEnableArchiveAndMuteNewChats = SuggestedAction; + +//@description Suggests the user to check authorization phone number and change the phone number if it is inaccessible +suggestedActionCheckPhoneNumber = SuggestedAction; + + //@description Contains a counter @count Count count count:int32 = Count; @@ -2687,11 +3016,11 @@ deepLinkInfo text:formattedText need_update_application:Bool = DeepLinkInfo; //@class TextParseMode @description Describes the way the text should be parsed for TextEntities -//@description The text should be parsed in markdown-style -//@version Version of the parser: 0 or 1 - Bot API Markdown parse mode, 2 - Bot API MarkdownV2 parse mode +//@description The text uses Markdown-style formatting +//@version Version of the parser: 0 or 1 - Telegram Bot API "Markdown" parse mode, 2 - Telegram Bot API "MarkdownV2" parse mode textParseModeMarkdown version:int32 = TextParseMode; -//@description The text should be parsed in HTML-style +//@description The text uses HTML-style formatting. The same as Telegram Bot API "HTML" parse mode textParseModeHTML = TextParseMode; @@ -2700,7 +3029,7 @@ textParseModeHTML = TextParseMode; //@description A SOCKS5 proxy server @username Username for logging in; may be empty @password Password for logging in; may be empty proxyTypeSocks5 username:string password:string = ProxyType; -//@description A HTTP transparent proxy server @username Username for logging in; may be empty @password Password for logging in; may be empty @http_only Pass true, if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method +//@description A HTTP transparent proxy server @username Username for logging in; may be empty @password Password for logging in; may be empty @http_only Pass true if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method proxyTypeHttp username:string password:string http_only:Bool = ProxyType; //@description An MTProto proxy server @secret The proxy's secret in hexadecimal encoding @@ -2714,8 +3043,107 @@ proxy id:int32 server:string port:int32 last_used_date:int32 is_enabled:Bool typ proxies proxies:vector = Proxies; -//@description Describes a sticker that should be added to a sticker set @png_sticker PNG image with the sticker; must be up to 512 kB in size and fit in a 512x512 square @emojis Emoji corresponding to the sticker @mask_position For masks, position where the mask should be placed; may be null -inputSticker png_sticker:InputFile emojis:string mask_position:maskPosition = InputSticker; +//@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 +//@mask_position For masks, position where the mask should be placed; may be null +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 +dateRange start_date:int32 end_date:int32 = DateRange; + + +//@description A value with information about its recent changes @value The current value @previous_value The value for the previous day @growth_rate_percentage The growth rate of the value, as a percentage +statisticalValue value:double previous_value:double growth_rate_percentage:double = StatisticalValue; + + +//@class StatisticalGraph @description Describes a statistical graph + +//@description A graph data @json_data Graph data in JSON format @zoom_token If non-empty, a token which can be used to receive a zoomed in graph +statisticalGraphData json_data:string zoom_token:string = StatisticalGraph; + +//@description The graph data to be asynchronously loaded through getStatisticalGraph @token The token to use for data loading +statisticalGraphAsync token:string = StatisticalGraph; + +//@description An error message to be shown to the user instead of the graph @error_message The error message +statisticalGraphError error_message:string = StatisticalGraph; + + +//@description Contains statistics about interactions with a message +//@message_id Message identifier +//@view_count Number of times the message was viewed +//@forward_count Number of times the message was forwarded +chatStatisticsMessageInteractionInfo message_id:int53 view_count:int32 forward_count:int32 = ChatStatisticsMessageInteractionInfo; + +//@description Contains statistics about messages sent by a user +//@user_id User identifier +//@sent_message_count Number of sent messages +//@average_character_count Average number of characters in sent messages +chatStatisticsMessageSenderInfo user_id:int32 sent_message_count:int32 average_character_count:int32 = ChatStatisticsMessageSenderInfo; + +//@description Contains statistics about administrator actions done by a user +//@user_id Administrator user identifier +//@deleted_message_count Number of messages deleted by the administrator +//@banned_user_count Number of users banned by the administrator +//@restricted_user_count Number of users restricted by the administrator +chatStatisticsAdministratorActionsInfo user_id:int32 deleted_message_count:int32 banned_user_count:int32 restricted_user_count:int32 = ChatStatisticsAdministratorActionsInfo; + +//@description Contains statistics about number of new members invited by a user +//@user_id User identifier +//@added_member_count Number of new members invited by the user +chatStatisticsInviterInfo user_id:int32 added_member_count:int32 = ChatStatisticsInviterInfo; + + +//@class ChatStatistics @description Contains a detailed statistics about a chat + +//@description A detailed statistics about a supergroup chat +//@period A period to which the statistics applies +//@member_count Number of members in the chat +//@message_count Number of messages sent to the chat +//@viewer_count Number of users who viewed messages in the chat +//@sender_count Number of users who sent messages to the chat +//@member_count_graph A graph containing number of members in the chat +//@join_graph A graph containing number of members joined and left the chat +//@join_by_source_graph A graph containing number of new member joins per source +//@language_graph A graph containing distribution of active users per language +//@message_content_graph A graph containing distribution of sent messages by content type +//@action_graph A graph containing number of different actions in the chat +//@day_graph A graph containing distribution of message views per hour +//@week_graph A graph containing distribution of message views per day of week +//@top_senders List of users sent most messages in the last week +//@top_administrators List of most active administrators in the last week +//@top_inviters List of most active inviters of new members in the last week +chatStatisticsSupergroup period:dateRange member_count:statisticalValue message_count:statisticalValue viewer_count:statisticalValue sender_count:statisticalValue member_count_graph:StatisticalGraph join_graph:StatisticalGraph join_by_source_graph:StatisticalGraph language_graph:StatisticalGraph message_content_graph:StatisticalGraph action_graph:StatisticalGraph day_graph:StatisticalGraph week_graph:StatisticalGraph top_senders:vector top_administrators:vector top_inviters:vector = ChatStatistics; + +//@description A detailed statistics about a channel chat +//@period A period to which the statistics applies +//@member_count Number of members in the chat +//@mean_view_count Mean number of times the recently sent messages was viewed +//@mean_share_count Mean number of times the recently sent messages was shared +//@enabled_notifications_percentage A percentage of users with enabled notifications for the chat +//@member_count_graph A graph containing number of members in the chat +//@join_graph A graph containing number of members joined and left the chat +//@mute_graph A graph containing number of members muted and unmuted the chat +//@view_count_by_hour_graph A graph containing number of message views in a given hour in the last two weeks +//@view_count_by_source_graph A graph containing number of message views per source +//@join_by_source_graph A graph containing number of new member joins per source +//@language_graph A graph containing number of users viewed chat messages per language +//@message_interaction_graph A graph containing number of chat message views and shares +//@instant_view_interaction_graph A graph containing number of views of associated with the chat instant views +//@recent_message_interactions Detailed statistics about number of views and shares of recently sent messages +chatStatisticsChannel period:dateRange member_count:statisticalValue mean_view_count:statisticalValue mean_share_count:statisticalValue enabled_notifications_percentage:double member_count_graph:StatisticalGraph join_graph:StatisticalGraph mute_graph:StatisticalGraph view_count_by_hour_graph:StatisticalGraph view_count_by_source_graph:StatisticalGraph join_by_source_graph:StatisticalGraph language_graph:StatisticalGraph message_interaction_graph:StatisticalGraph instant_view_interaction_graph:StatisticalGraph recent_message_interactions:vector = ChatStatistics; + + +//@description A detailed statistics about a message @message_interaction_graph A graph containing number of message views and shares +messageStatistics message_interaction_graph:StatisticalGraph = MessageStatistics; //@class Update @description Contains notifications about data changes @@ -2743,8 +3171,11 @@ updateMessageContent chat_id:int53 message_id:int53 new_content:MessageContent = //@description A message was edited. Changes in the message content will come in a separate updateMessageContent @chat_id Chat identifier @message_id Message identifier @edit_date Point in time (Unix timestamp) when the message was edited @reply_markup New message reply markup; may be null updateMessageEdited chat_id:int53 message_id:int53 edit_date:int32 reply_markup:ReplyMarkup = Update; -//@description The view count of the message has changed @chat_id Chat identifier @message_id Message identifier @views New value of the view count -updateMessageViews chat_id:int53 message_id:int53 views:int32 = Update; +//@description The message pinned state was changed @chat_id Chat identifier @message_id The message identifier @is_pinned True, if the message is pinned +updateMessageIsPinned chat_id:int53 message_id:int53 is_pinned:Bool = Update; + +//@description The information about interactions with a message has changed @chat_id Chat identifier @message_id Message identifier @interaction_info New information about interactions with the message; may be null +updateMessageInteractionInfo chat_id:int53 message_id:int53 interaction_info:messageInteractionInfo = Update; //@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 @chat_id Chat identifier @message_id Message identifier updateMessageContentOpened chat_id:int53 message_id:int53 = Update; @@ -2752,39 +3183,33 @@ 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 A message with a live location was viewed. When the update is received, the client is supposed to update the live location +//@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; -//@description A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the client. The chat field changes will be reported through separate updates @chat The chat +//@description A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates @chat The chat updateNewChat chat:chat = Update; -//@description The list to which the chat belongs was changed. This update is guaranteed to be sent only when chat.order == 0 and the current or the new chat list is null @chat_id Chat identifier @chat_list The new chat's chat list; may be null -updateChatChatList chat_id:int53 chat_list:ChatList = Update; - //@description The title of a chat was changed @chat_id Chat identifier @title The new chat title updateChatTitle chat_id:int53 title:string = Update; //@description A chat photo was changed @chat_id Chat identifier @photo The new chat photo; may be null -updateChatPhoto chat_id:int53 photo:chatPhoto = Update; +updateChatPhoto chat_id:int53 photo:chatPhotoInfo = Update; //@description Chat permissions was changed @chat_id Chat identifier @permissions The new chat permissions updateChatPermissions chat_id:int53 permissions:chatPermissions = Update; -//@description The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case @chat_id Chat identifier @last_message The new last message in the chat; may be null @order New value of the chat order -updateChatLastMessage chat_id:int53 last_message:message order:int64 = Update; +//@description The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case @chat_id Chat identifier @last_message The new last message in the chat; may be null @positions The new chat positions in the chat lists +updateChatLastMessage chat_id:int53 last_message:message positions:vector = Update; -//@description The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned, updateChatDraftMessage, or updateChatIsSponsored might be sent @chat_id Chat identifier @order New value of the order -updateChatOrder chat_id:int53 order:int64 = Update; - -//@description A chat was pinned or unpinned @chat_id Chat identifier @is_pinned New value of is_pinned @order New value of the chat order -updateChatIsPinned chat_id:int53 is_pinned:Bool order:int64 = Update; +//@description The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent @chat_id Chat identifier @position New chat position. If new order is 0, then the chat needs to be removed from the list +updateChatPosition chat_id:int53 position:chatPosition = 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 A chat's is_sponsored field has changed @chat_id Chat identifier @is_sponsored New value of is_sponsored @order New value of chat order -updateChatIsSponsored chat_id:int53 is_sponsored:Bool order:int64 = 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'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; @@ -2810,15 +3235,15 @@ updateScopeNotificationSettings scope:NotificationSettingsScope notification_set //@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 pinned message was changed @chat_id Chat identifier @pinned_message_id The new identifier of the pinned message; 0 if there is no pinned message in the chat -updateChatPinnedMessage chat_id:int53 pinned_message_id:int53 = Update; - //@description The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user //@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 shouldn't be applied @chat_id Chat identifier @draft_message The new draft message; may be null @order New value of the chat order -updateChatDraftMessage chat_id:int53 draft_message:draftMessage order:int64 = 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 shouldn'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 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 updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update; @@ -2849,22 +3274,22 @@ updateHavePendingNotifications have_delayed_notifications:Bool have_unreceived_n //@from_cache True, if the messages are deleted only from the cache and can possibly be retrieved again in the future updateDeleteMessages chat_id:int53 message_ids:vector is_permanent:Bool from_cache:Bool = Update; -//@description User activity in the chat has changed @chat_id Chat identifier @user_id Identifier of a user performing an action @action The action description -updateUserChatAction chat_id:int53 user_id:int32 action:ChatAction = Update; +//@description User activity in the chat has changed @chat_id Chat identifier @message_thread_id If not 0, a message thread identifier in which the action was performed @user_id Identifier of a user performing an action @action The action description +updateUserChatAction chat_id:int53 message_thread_id:int53 user_id:int32 action:ChatAction = Update; //@description The user went online or offline @user_id User identifier @status New status of the user updateUserStatus user_id:int32 status:UserStatus = Update; -//@description Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the client @user New data about the user +//@description Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application @user New data about the user updateUser user:user = Update; -//@description Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the client @basic_group New data about the group +//@description Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application @basic_group New data about the group updateBasicGroup basic_group:basicGroup = Update; -//@description Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the client @supergroup New data about the supergroup +//@description Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application @supergroup New data about the supergroup updateSupergroup supergroup:supergroup = Update; -//@description Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the client @secret_chat New data about the secret chat +//@description Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application @secret_chat New data about the secret chat updateSecretChat secret_chat:secretChat = Update; //@description Some data from userFullInfo has been changed @user_id User identifier @user_full_info New full information about the user @@ -2876,7 +3301,7 @@ updateBasicGroupFullInfo basic_group_id:int32 basic_group_full_info:basicGroupFu //@description Some data from supergroupFullInfo has been changed @supergroup_id Identifier of the supergroup or channel @supergroup_full_info New full information about the supergroup updateSupergroupFullInfo supergroup_id:int32 supergroup_full_info:supergroupFullInfo = Update; -//@description Service notification from the server. Upon receiving this the client must show a popup with the content of the notification +//@description Service notification from the server. Upon receiving this the application must show a popup with the content of the notification //@type Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" should be shown under notification; if user presses the second, all local data should be destroyed using Destroy method //@content Notification content updateServiceNotification type:string content:MessageContent = Update; @@ -2884,11 +3309,11 @@ updateServiceNotification type:string content:MessageContent = Update; //@description Information about a file was updated @file New data about the file updateFile file:file = Update; -//@description The file generation process needs to be started by the client +//@description The file generation process needs to be started by the application //@generation_id Unique identifier for the generation process //@original_path The path to a file from which a new file is generated; may be empty //@destination_path The path to a file that should be created and where the new file should be generated -//@conversion String specifying the conversion applied to the original file. If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by the client +//@conversion String specifying the conversion applied to the original file. If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by the application updateFileGenerationStart generation_id:int64 original_path:string destination_path:string conversion:string = Update; //@description File generation is no longer needed @generation_id Unique identifier for the generation process @@ -2897,6 +3322,9 @@ updateFileGenerationStop generation_id:int64 = Update; //@description New call was created or information about a call was updated @call New data about a call updateCall call:call = Update; +//@description New call signaling data arrived @call_id The call identifier @data The data +updateNewCallSignalingData call_id:int32 data:bytes = Update; + //@description Some privacy setting rules have been changed @setting The privacy setting @rules New privacy rules updateUserPrivacySettingRules setting:UserPrivacySetting rules:userPrivacySettingRules = Update; @@ -2914,10 +3342,13 @@ updateUnreadChatCount chat_list:ChatList total_count:int32 unread_count:int32 un //@description An option changed its value @name The option name @value The new option value updateOption name:string value:OptionValue = Update; +//@description A sticker set has changed @sticker_set The sticker set +updateStickerSet sticker_set:stickerSet = Update; + //@description The list of installed sticker sets was updated @is_masks True, if the list of installed mask sticker sets was updated @sticker_set_ids The new list of installed ordinary sticker sets updateInstalledStickerSets is_masks:Bool sticker_set_ids:vector = Update; -//@description The list of trending sticker sets was updated or some of them were viewed @sticker_sets The new list of trending sticker sets +//@description The list of trending sticker sets was updated or some of them were viewed @sticker_sets The prefix of the list of trending sticker sets with the newest trending sticker sets updateTrendingStickerSets sticker_sets:stickerSets = Update; //@description The list of recently used stickers was updated @is_attached True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated @sticker_ids The new list of file identifiers of recently used stickers @@ -2935,20 +3366,29 @@ updateSelectedBackground for_dark_theme:Bool background:background = Update; //@description Some language pack strings have been updated @localization_target Localization target to which the language pack belongs @language_pack_id Identifier of the updated language pack @strings List of changed language pack strings updateLanguagePackStrings localization_target:string language_pack_id:string strings:vector = Update; -//@description The connection state has changed @state The new connection state +//@description The connection state has changed. This update must be used only to show a human-readable description of the connection state @state The new connection state updateConnectionState state:ConnectionState = Update; //@description New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method should be called with the reason "Decline ToS update" @terms_of_service_id Identifier of the terms of service @terms_of_service The new terms of service updateTermsOfService terms_of_service_id:string terms_of_service:termsOfService = Update; -//@description List of users nearby has changed. The update is sent only 60 seconds after a successful searchChatsNearby request @users_nearby The new list of users nearby +//@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 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, provided by the client; may be null +//@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis +updateDiceEmojis emojis:vector = Update; + +//@description The parameters of animation search through GetOption("animation_search_bot_username") bot has changed @provider Name of the animation search provider @emojis The new list of emojis suggested for searching +updateAnimationSearchParameters provider:string emojis:vector = Update; + +//@description The list of suggested to the user actions has changed @added_actions Added suggested actions @removed_actions Removed suggested actions +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 //@query Text of the query @offset Offset of the first entry to return updateNewInlineQuery id:int64 sender_user_id:int32 user_location:location 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, provided by the client; may be null +//@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 //@query Text of the query @result_id Identifier of the chosen result @inline_message_id Identifier of the sent inline message, if known updateNewChosenInlineResult sender_user_id:int32 user_location:location query:string result_id:string inline_message_id:string = Update; @@ -2990,8 +3430,11 @@ updates updates:vector = Updates; //@description The log is written to stderr or an OS specific log logStreamDefault = LogStream; -//@description The log is written to a file @path Path to the file to where the internal TDLib log will be written @max_file_size The maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated -logStreamFile path:string max_file_size:int53 = LogStream; +//@description The log is written to a file +//@path Path to the file to where the internal TDLib log will be written +//@max_file_size The maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated +//@redirect_stderr Pass true to additionally redirect stderr to the log file. Ignored on Windows +logStreamFile path:string max_file_size:int53 redirect_stderr:Bool = LogStream; //@description The log is written nowhere logStreamEmpty = LogStream; @@ -3021,7 +3464,7 @@ testVectorStringObject value:vector = TestVectorStringObject; ---functions--- -//@description Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state +//@description Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization getAuthorizationState = AuthorizationState; @@ -3042,7 +3485,9 @@ resendAuthenticationCode = Ok; //@description Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode @code The verification code received via SMS, Telegram message, phone call, or flash call checkAuthenticationCode code:string = Ok; -//@description Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber @other_user_ids List of user identifiers of other users currently using the client +//@description Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, +//-or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword +//@other_user_ids List of user identifiers of other users currently using the application requestQrCodeAuthentication other_user_ids:vector = Ok; //@description Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration @@ -3064,10 +3509,10 @@ checkAuthenticationBotToken token:string = Ok; //@description Closes the TDLib instance after a proper logout. Requires an available network connection. All local data will be destroyed. After the logout completes, updateAuthorizationState with authorizationStateClosed will be sent logOut = Ok; -//@description Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent +//@description Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent. Can be called before initialization close = Ok; -//@description Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed. After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent +//@description Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed. After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent. Can be called before authorization destroy = Ok; @@ -3075,7 +3520,7 @@ destroy = Ok; confirmQrCodeAuthentication link:string = Session; -//@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. This is an offline method. Can be called before authorization +//@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 getCurrentState = Updates; @@ -3149,24 +3594,31 @@ 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 getMessageLocally chat_id:int53 message_id:int53 = Message; -//@description Returns information about a message that is replied by given message @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message reply to which get +//@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 +//@chat_id Identifier of the chat the message belongs to @message_id Identifier of the message reply to which to get getRepliedMessage chat_id:int53 message_id:int53 = Message; -//@description Returns information about a pinned chat message @chat_id Identifier of the chat the message belongs to +//@description Returns information about a newest pinned message in the chat @chat_id Identifier of the chat the message belongs to getChatPinnedMessage chat_id:int53 = Message; +//@description Returns information about a message with the callback button that originated a callback query; for bots only @chat_id Identifier of the chat the message belongs to @message_id Message identifier @callback_query_id Identifier of the callback query +getCallbackQueryMessage chat_id:int53 message_id:int53 callback_query_id:int64 = Message; + //@description Returns information about messages. If a message is not found, returns null on the corresponding position of the result @chat_id Identifier of the chat the messages belong to @message_ids Identifiers of the messages to get getMessages chat_id:int53 message_ids:vector = Messages; +//@description Returns information about a message thread. Can be used only if message.can_get_message_thread == true @chat_id Chat identifier @message_id Identifier of the message +getMessageThread chat_id:int53 message_id:int53 = MessageThreadInfo; + //@description Returns information about a file; this is an offline request @file_id Identifier of the file to get getFile file_id:int32 = File; //@description Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. -//-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client +//-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application //@remote_file_id Remote identifier of the file to get @file_type File type, if known getRemoteFile remote_file_id:string file_type:FileType = File; -//@description Returns an ordered list of chats in a chat list. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). +//@description Returns an ordered list of chats in a chat list. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). //-For optimal performance the number of returned chats is chosen by the library //@chat_list The chat list in which to return chats //@offset_order Chat order to return chats from @offset_chat_id Chat identifier to return chats from @@ -3179,10 +3631,10 @@ 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. Returns nothing if the length of the searched username prefix is less than 5. Excludes private chats with contacts and chats from the chat list from the results @query Query to search for searchPublicChats query:string = Chats; -//@description Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the chat list @query Query to search for. If the query is empty, returns up to 20 recently found chats @limit The maximum number of chats to be returned +//@description Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list @query Query to search for. If the query is empty, returns up to 20 recently found chats @limit The maximum number of chats to be returned searchChats query:string limit:int32 = Chats; -//@description Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the chat list @query Query to search for @limit The maximum number of chats to be returned +//@description Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the main chat list @query Query to search for @limit The maximum number of chats to be returned searchChatsOnServer query:string limit:int32 = Chats; //@description Returns a list of users and location-based supergroups nearby. The list of users nearby will be updated for 60 seconds after the request by the updates updateUsersNearby. The request should be sent again every 25 seconds with adjusted location to not miss new chats @location Current user location @@ -3212,7 +3664,7 @@ getCreatedPublicChats type:PublicChatType = Chats; //@description Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached @type Type of the public chats, for which to check the limit checkCreatedPublicChatsLimit type:PublicChatType = Ok; -//@description Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Basic group chats need to be first upgraded to supergroups before they can be set as a discussion group +//@description Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group. To set a returned supergroup as a discussion group, access to its old messages must be enabled using toggleSupergroupIsAllHistoryAvailable first getSuitableDiscussionChats = Chats; //@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 @@ -3228,10 +3680,19 @@ getGroupsInCommon user_id:int32 offset_chat_id:int53 limit:int32 = Chats; //@chat_id Chat identifier //@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message //@offset Specify 0 to get results from exactly the 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 or equal to -offset. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached +//@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. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached //@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. +//-The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library +//@chat_id Chat identifier +//@message_id Message identifier, which thread history needs to be returned +//@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. Fewer messages may be returned than specified by the limit, even if the end of the message thread history has not been reached +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 should be removed from the chat list @revoke Pass true to try to delete chat history for all users deleteChatHistory chat_id:int53 remove_from_chat_list:Bool revoke:Bool = Ok; @@ -3240,12 +3701,13 @@ deleteChatHistory chat_id:int53 remove_from_chat_list:Bool revoke:Bool = Ok; //-(searchSecretMessages should be used instead), or without an enabled message database. For optimal performance the number of returned messages is chosen by the library //@chat_id Identifier of the chat in which to search messages //@query Query to search for -//@sender_user_id If not 0, only messages sent by the specified user will be returned. Not supported in secret chats +//@sender If not null, only messages sent by the specified sender will be returned. Not supported in secret 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 to get the specified message and 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 -offset. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached //@filter Filter for message content in the search results -searchChatMessages chat_id:int53 query:string sender_user_id:int32 from_message_id:int53 offset:int32 limit:int32 filter:SearchMessagesFilter = Messages; +//@message_thread_id If not 0, only messages in the specified thread will be returned; supergroups only +searchChatMessages chat_id:int53 query:string sender:MessageSender from_message_id:int53 offset:int32 limit:int32 filter:SearchMessagesFilter message_thread_id:int53 = Messages; //@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 the library @@ -3254,15 +3716,19 @@ searchChatMessages chat_id:int53 query:string sender_user_id:int32 from_message_ //@offset_date The date of the message starting from which the results should be fetched. Use 0 or any date in the future to get results from the last message //@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. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached -searchMessages chat_list:ChatList query:string offset_date:int32 offset_chat_id:int53 offset_message_id:int53 limit:int32 = Messages; +//@limit The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached +//@filter Filter for message content in the search results; searchMessagesFilterCall, searchMessagesFilterMissedCall, 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; //@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 the library -//@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 should be used instead -//@from_search_id The identifier from the result of a previous request, use 0 to get results from the last message +//@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 should 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 //@limit The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached -//@filter A filter for the content of messages in the search results -searchSecretMessages chat_id:int53 query:string from_search_id:int64 limit:int32 filter:SearchMessagesFilter = FoundMessages; +//@filter A filter for message content in the search results +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 the library //@from_message_id Identifier of the message from which to search; use 0 to get results from the last message @@ -3272,7 +3738,7 @@ searchCallMessages from_message_id:int53 limit:int32 only_missed:Bool = Messages //@description Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user @chat_id Chat identifier @limit The maximum number of messages to be returned searchChatRecentLocationMessages chat_id:int53 limit:int32 = Messages; -//@description Returns all active live locations that should be updated by the client. The list is persistent across application restarts only if the message database is used +//@description Returns all active live locations that should be updated by the application. The list is persistent across application restarts only if the message database is used getActiveLiveLocationMessages = Messages; //@description Returns the last message sent in a chat no later than the specified date @chat_id Chat identifier @date Point in time (Unix timestamp) relative to which to search for messages @@ -3284,6 +3750,13 @@ getChatMessageCount chat_id:int53 filter:SearchMessagesFilter return_local:Bool //@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 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 the library +//@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 +//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. Fewer messages may be returned than specified by the limit, even if the end of the list has not been reached +getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; + //@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 removeNotification notification_group_id:int32 notification_id:int32 = Ok; @@ -3292,51 +3765,58 @@ removeNotification notification_group_id:int32 notification_id:int32 = Ok; removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = Ok; -//@description Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with a username +//@description Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. This is an offline request //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -//@for_album Pass true if a link for a whole media album should be returned -getPublicMessageLink chat_id:int53 message_id:int53 for_album:Bool = PublicMessageLink; +//@for_album Pass true to create a link for the whole media album +//@for_comment Pass true to create a link to the message as a channel post comment, or from a message thread +getMessageLink chat_id:int53 message_id:int53 for_album:Bool for_comment:Bool = MessageLink; -//@description Returns a private HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. The link will work only for members of the chat +//@description Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -getMessageLink chat_id:int53 message_id:int53 = HttpUrl; +//@for_album Pass true to return an HTML code for embedding of the whole media album +getMessageEmbeddingCode chat_id:int53 message_id:int53 for_album:Bool = Text; //@description Returns information about a public or private message link @url The message link in the format "https://t.me/c/...", or "tg://privatepost?...", or "https://t.me/username/...", or "tg://resolve?..." getMessageLinkInfo url:string = MessageLinkInfo; //@description Sends a message. Returns the sent message -//@chat_id Target chat @reply_to_message_id Identifier of the message to reply to or 0 +//@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 //@options Options to be used to send the message //@reply_markup Markup for replying to the message; for bots only @input_message_content The content of the message to be sent -sendMessage chat_id:int53 reply_to_message_id:int53 options:sendMessageOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; +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 messages grouped together into an album. Currently only photo and video messages can be grouped into an album. Returns sent messages -//@chat_id Target chat @reply_to_message_id Identifier of a message to reply to or 0 +//@description Sends 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 //@options Options to be used to send the messages //@input_message_contents Contents of messages to be sent -sendMessageAlbum chat_id:int53 reply_to_message_id:int53 options:sendMessageOptions input_message_contents:vector = 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) sendBotStartMessage bot_user_id:int32 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 @reply_to_message_id Identifier of a message to reply to or 0 +//@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 //@options Options to be used to send the message //@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") -sendInlineQueryResultMessage chat_id:int53 reply_to_message_id:int53 options:sendMessageOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; +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 -//@chat_id Identifier of the chat to which to forward messages @from_chat_id Identifier of the chat from which to forward messages @message_ids Identifiers of the messages to forward +//@chat_id Identifier of the chat to which to forward messages @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 //@options Options to be used to send the messages -//@as_album True, if the messages should be grouped into an album after forwarding. For this to work, no more than 10 messages may be forwarded, and all of them must be photo or video messages //@send_copy True, if content of the messages needs to be copied without links to the original messages. Always true if the messages are forwarded to a secret chat -//@remove_caption True, if media captions of message copies needs to be removed. Ignored if send_copy is false -forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector options:sendMessageOptions as_album:Bool send_copy:Bool remove_caption:Bool = Messages; +//@remove_caption True, if media caption of message copies needs to be removed. Ignored if send_copy is false +forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption: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. //-If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message @@ -3349,9 +3829,13 @@ sendChatSetTtlMessage chat_id:int53 ttl:int32 = Message; //@description Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Chat identifier 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_user_id Identifier of the user who will be shown as the sender of the message; may be 0 for channel posts -//@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_user_id:int32 reply_to_message_id:int53 disable_notification:Bool input_message_content:InputMessageContent = Message; +//@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 The sender sender of the message +//@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: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 deleteMessages chat_id:int53 message_ids:vector revoke:Bool = Ok; @@ -3366,7 +3850,9 @@ editMessageText chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_me //@description Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to @message_id Identifier of the message @reply_markup The new message reply markup; for bots only @location New location content of the message; may be null. Pass null to stop sharing the live location -editMessageLiveLocation chat_id:int53 message_id:int53 reply_markup:ReplyMarkup location:location = Message; +//@heading The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown +//@proximity_alert_radius The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled +editMessageLiveLocation chat_id:int53 message_id:int53 reply_markup:ReplyMarkup location:location heading:int32 proximity_alert_radius:int32 = Message; //@description Edits the content of a message with an animation, an audio, a document, a photo or a video. The media in the message can't be replaced if the message was set to self-destruct. Media can't be replaced by self-destructing media. Media in an album can be edited only to contain a photo or a video. Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to @message_id Identifier of the message @reply_markup The new message reply markup; for bots only @input_message_content New content of the message. Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePhoto or InputMessageVideo @@ -3383,8 +3869,11 @@ editMessageReplyMarkup chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = //@description Edits the text of an inline text or game message sent via a bot; for bots only @inline_message_id Inline message identifier @reply_markup The new message reply markup @input_message_content New text content of the message. Should be of type InputMessageText editInlineMessageText inline_message_id:string reply_markup:ReplyMarkup input_message_content:InputMessageContent = Ok; -//@description Edits the content of a live location in an inline message sent via a bot; for bots only @inline_message_id Inline message identifier @reply_markup The new message reply markup @location New location content of the message; may be null. Pass null to stop sharing the live location -editInlineMessageLiveLocation inline_message_id:string reply_markup:ReplyMarkup location:location = Ok; +//@description Edits the content of a live location in an inline message sent via a bot; for bots only @inline_message_id Inline message identifier @reply_markup The new message reply markup +//@location New location content of the message; may be null. Pass null to stop sharing the live location +//@heading The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown +//@proximity_alert_radius The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled +editInlineMessageLiveLocation inline_message_id:string reply_markup:ReplyMarkup location:location heading:int32 proximity_alert_radius:int32 = Ok; //@description Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only @inline_message_id Inline message identifier //@reply_markup The new message reply markup; for bots only @input_message_content New content of the message. Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePhoto or InputMessageVideo @@ -3400,29 +3889,36 @@ editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; -//@description Returns all entities (mentions, hashtags, cashtags, bot commands, URLs, and email addresses) contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously @text The text in which to look for entites +//@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. This is an offline method. Can be called before authorization. Can be called synchronously @text The text which should be parsed @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 Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously @file_name The name of the file or path to the file +//@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**" +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 +getMarkdownText text:formattedText = FormattedText; + +//@description Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously @file_name The name of the file or path to the file getFileMimeType file_name:string = Text; -//@description Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously @mime_type The MIME type of the file +//@description Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously @mime_type The MIME type of the file getFileExtension mime_type:string = Text; -//@description Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously @file_name File name or path to the file +//@description Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. Can be called synchronously @file_name File name or path to the file cleanFileName file_name:string = Text; -//@description Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. This is an offline method. Can be called before authorization. Can be called synchronously +//@description Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. Can be called synchronously //@language_pack_database_path Path to the language pack database in which strings are stored @localization_target Localization target to which the language pack belongs @language_pack_id Language pack identifier @key Language pack key of the string to be returned getLanguagePackString language_pack_database_path:string localization_target:string language_pack_id:string key:string = LanguagePackStringValue; -//@description Converts a JSON-serialized string to corresponding JsonValue object. This is an offline method. Can be called before authorization. Can be called synchronously @json The JSON-serialized string +//@description Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously @json The JSON-serialized string getJsonValue json:string = JsonValue; -//@description Converts a JsonValue object to corresponding JSON-serialized string. This is an offline method. Can be called before authorization. Can be called synchronously @json_value The JsonValue object +//@description Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously @json_value The JsonValue object getJsonString json_value:JsonValue = Text; @@ -3443,6 +3939,10 @@ getPollVoters chat_id:int53 message_id:int53 option_id:int32 offset:int32 limit: stopPoll chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Ok; +//@description Hides a suggested action @action Suggested action to hide +hideSuggestedAction action:SuggestedAction = Ok; + + //@description Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the 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 getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int32 = LoginUrlInfo; @@ -3498,8 +3998,8 @@ getInlineGameHighScores inline_message_id:string user_id:int32 = GameHighScores; deleteChatReplyMarkup chat_id:int53 message_id:int53 = Ok; -//@description Sends a notification about user activity in a chat @chat_id Chat identifier @action The action description -sendChatAction chat_id:int53 action:ChatAction = Ok; +//@description Sends a notification about user activity in a chat @chat_id Chat identifier @message_thread_id If not 0, a message thread identifier in which the action was performed @action The action description +sendChatAction chat_id:int53 message_thread_id:int53 action:ChatAction = Ok; //@description Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are received only for opened chats) @chat_id Chat identifier @@ -3508,9 +4008,12 @@ openChat chat_id:int53 = Ok; //@description Informs TDLib that the chat is closed by the user. Many useful activities depend on the chat being opened or closed @chat_id Chat identifier closeChat chat_id:int53 = Ok; -//@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) @chat_id Chat identifier @message_ids The identifiers of the messages being viewed -//@force_read True, if messages in closed chats should be marked as read -viewMessages chat_id:int53 message_ids:vector force_read:Bool = Ok; +//@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) +//@chat_id Chat identifier +//@message_thread_id If not 0, a message thread identifier in which the messages are being viewed +//@message_ids The identifiers of the messages being viewed +//@force_read True, if messages in closed chats should be marked as read by the request +viewMessages chat_id:int53 message_thread_id:int53 message_ids: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 openMessageContent chat_id:int53 message_id:int53 = Ok; @@ -3545,45 +4048,68 @@ createNewSecretChat user_id:int32 = Chat; upgradeBasicGroupChatToSupergroupChat chat_id:int53 = Chat; -//@description Moves a chat to a different chat list. Current chat list of the chat must ne non-null @chat_id Chat identifier @chat_list New chat list of the chat -setChatChatList chat_id:int53 chat_list:ChatList = Ok; +//@description Returns chat lists to which the chat can be added. This is an offline request @chat_id Chat identifier +getChatListsToAddChat chat_id:int53 = ChatLists; -//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The title will not be changed until the request to the server has been completed +//@description Adds a chat to a chat list. A chat can't be simultaneously in Main and Archive chat lists, so it is automatically removed from another one if needed +//@chat_id Chat identifier @chat_list The chat list. Use getChatListsToAddChat to get suitable chat lists +addChatToList chat_id:int53 chat_list:ChatList = Ok; + +//@description Returns information about a chat filter by its identifier @chat_filter_id Chat filter identifier +getChatFilter chat_filter_id:int32 = ChatFilter; + +//@description Creates new chat filter. Returns information about the created chat filter @filter Chat filter +createChatFilter filter:chatFilter = ChatFilterInfo; + +//@description Edits existing chat filter. Returns information about the edited chat filter @chat_filter_id Chat filter identifier @filter The edited chat filter +editChatFilter chat_filter_id:int32 filter:chatFilter = ChatFilterInfo; + +//@description Deletes existing chat filter @chat_filter_id Chat filter identifier +deleteChatFilter chat_filter_id:int32 = Ok; + +//@description Changes the order of chat filters @chat_filter_ids Identifiers of chat filters in the new correct order +reorderChatFilters chat_filter_ids:vector = Ok; + +//@description Returns recommended chat filters for the current user +getRecommendedChatFilters = RecommendedChatFilters; + +//@description Returns default icon name for a filter. Can be called synchronously @filter Chat filter +getChatFilterDefaultIconName filter:chatFilter = Text; + + +//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights //@chat_id Chat identifier @title New title of the chat; 1-128 characters setChatTitle chat_id:int53 title:string = Ok; -//@description Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The photo will not be changed before request to the server has been completed -//@chat_id Chat identifier @photo New chat photo. You can use a zero InputFileId to delete the chat photo. Files that are accessible only by HTTP URL are not acceptable -setChatPhoto chat_id:int53 photo:InputFile = Ok; +//@description Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info rights +//@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 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 setChatPermissions chat_id:int53 permissions:chatPermissions = Ok; -//@description Changes the draft message in a chat @chat_id Chat identifier @draft_message New draft message; may be null -setChatDraftMessage chat_id:int53 draft_message:draftMessage = Ok; +//@description Changes the draft message in a chat @chat_id Chat identifier @message_thread_id If not 0, a message thread identifier in which the draft was changed @draft_message New draft message; may be null +setChatDraftMessage chat_id:int53 message_thread_id:int53 draft_message:draftMessage = Ok; //@description Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed //@chat_id Chat identifier @notification_settings New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever setChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Ok; -//@description Changes the pinned state of a chat. You can pin up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") non-secret chats and the same number of secret chats in the main/archive chat list @chat_id Chat identifier @is_pinned New value of is_pinned -toggleChatIsPinned chat_id:int53 is_pinned: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 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 client data associated with a chat @chat_id Chat identifier @client_data New value of client_data +//@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; //@description Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info rights @chat_id Identifier of the chat @param_description New chat description; 0-255 characters setChatDescription chat_id:int53 description:string = Ok; //@description Changes the discussion group of a channel chat; requires can_change_info rights in the channel if it is specified @chat_id Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup) @discussion_chat_id Identifier of a new channel's discussion group. Use 0 to remove the discussion group. -//-Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats needs to be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable needs to be used first to change that +//-Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats must be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable must be used first to change that setChatDiscussionGroup chat_id:int53 discussion_chat_id:int53 = Ok; //@description Changes the location of a chat. Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the method is allowed to use @chat_id Chat identifier @location New location for the chat; must be valid and not null @@ -3592,11 +4118,18 @@ setChatLocation chat_id:int53 location:chatLocation = Ok; //@description Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights @chat_id Chat identifier @slow_mode_delay New slow mode delay for the chat; must be one of 0, 10, 30, 60, 300, 900, 3600 setChatSlowModeDelay chat_id:int53 slow_mode_delay:int32 = Ok; -//@description Pins a message in a chat; requires can_pin_messages rights @chat_id Identifier of the chat @message_id Identifier of the new pinned message @disable_notification True, if there should be no notification about the pinned message -pinChatMessage chat_id:int53 message_id:int53 disable_notification:Bool = 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 should 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 the pinned message from a chat; requires can_pin_messages rights in the group or channel @chat_id Identifier of the chat -unpinChatMessage chat_id:int53 = 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 +unpinChatMessage chat_id:int53 message_id:int53 = Ok; + +//@description Removes all pinned messages 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 +unpinAllChatMessages chat_id:int53 = Ok; //@description Adds current user as a new member to a chat. Private and secret chats can't be joined using this method @chat_id Chat identifier @@ -3651,6 +4184,10 @@ setScopeNotificationSettings scope:NotificationSettingsScope notification_settin 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 +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; @@ -3677,7 +4214,7 @@ uploadFile file:InputFile file_type:FileType priority:int32 = File; //@description Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined @file_id Identifier of the file to stop uploading cancelUploadFile file_id:int32 = Ok; -//@description Writes a part of a generated file. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file +//@description Writes a part of a generated file. 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 write to the destination file //@generation_id The identifier of the generation process @offset The offset from which to write the data to the file @data The data to write writeGeneratedFilePart generation_id:int64 offset:int32 data:bytes = Ok; @@ -3692,7 +4229,7 @@ setFileGenerationProgress generation_id:int64 expected_size:int32 local_prefix_s //@error If set, means that file generation has failed and should be terminated finishFileGeneration generation_id:int64 error:error = Ok; -//@description 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 client has no direct access to TDLib's file system, because it is usually slower than a direct read from the file +//@description 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 //@file_id Identifier of the file. The file must be located in the TDLib file cache //@offset The offset from which to read the file //@count 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 @@ -3713,14 +4250,17 @@ checkChatInviteLink invite_link:string = ChatInviteLinkInfo; joinChatByInviteLink invite_link:string = Chat; -//@description Creates a new call @user_id Identifier of the user to be called @protocol Description of the call protocols supported by the client -createCall user_id:int32 protocol:callProtocol = CallId; +//@description Creates a new call @user_id Identifier of the user to be called @protocol Description of the call protocols supported by the application @is_video True, if a video call needs to be created +createCall user_id:int32 protocol:callProtocol is_video:Bool = CallId; -//@description Accepts an incoming call @call_id Call identifier @protocol Description of the call protocols supported by the client +//@description Accepts an incoming call @call_id Call identifier @protocol Description of the call protocols supported by the application acceptCall call_id:int32 protocol:callProtocol = Ok; -//@description Discards a call @call_id Call identifier @is_disconnected True, if the user was disconnected @duration The call duration, in seconds @connection_id Identifier of the connection used during the call -discardCall call_id:int32 is_disconnected:Bool duration:int32 connection_id:int64 = 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 +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 sendCallRating call_id:int32 rating:int32 comment:string problems:vector = Ok; @@ -3729,15 +4269,18 @@ sendCallRating call_id:int32 rating:int32 comment:string problems:vector = Emojis; //@description Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation @language_code Language code for which the emoji replacements will be suggested getEmojiSuggestionsUrl language_code:string = HttpUrl; @@ -3876,21 +4421,24 @@ getWebPagePreview text:formattedText = WebPage; getWebPageInstantView url:string force_full:Bool = WebPageInstantView; -//@description Uploads a new profile photo for the current user. If something changes, updateUser will be sent @photo Profile photo to set. inputFileId and inputFileRemote may still be unsupported -setProfilePhoto photo:InputFile = Ok; +//@description Changes a profile photo for the current user @photo Profile photo to set +setProfilePhoto photo:InputChatPhoto = Ok; -//@description Deletes a profile photo. If something changes, updateUser will be sent @profile_photo_id Identifier of the profile photo to delete +//@description Deletes a profile photo @profile_photo_id Identifier of the profile photo to delete deleteProfilePhoto profile_photo_id:int64 = Ok; -//@description Changes the first and last name of the current user. If something changes, updateUser will be sent @first_name The new value of the first name for the user; 1-64 characters @last_name The new value of the optional last name for the user; 0-64 characters +//@description Changes the first and last name of the current user @first_name The new value of the first name for the user; 1-64 characters @last_name The new value of the optional last name for the user; 0-64 characters setName first_name:string last_name:string = Ok; //@description Changes the bio of the current user @bio The new value of the user bio; 0-70 characters without line feeds setBio bio:string = Ok; -//@description Changes the username of the current user. If something changes, updateUser will be sent @username The new value of the username. Use an empty string to remove the username +//@description Changes the username of the current user @username The new value of the username. Use an empty string to remove the username setUsername username:string = Ok; +//@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 @location The new location of the user +setLocation location:location = Ok; + //@description Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code //@phone_number The new phone number of the user in international format @settings Settings for the authentication of the user's phone number changePhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; @@ -3901,6 +4449,9 @@ resendChangePhoneNumberCode = AuthenticationCodeInfo; //@description Checks the authentication code sent to confirm a new phone number of the user @code Verification code received by SMS, phone call or flash call checkChangePhoneNumberCode code:string = Ok; +//@description Sets the list of commands supported by the bot; for bots only @commands List of the bot's commands +setCommands commands:vector = Ok; + //@description Returns all active sessions of the current user getActiveSessions = Sessions; @@ -3938,7 +4489,7 @@ toggleSupergroupIsAllHistoryAvailable supergroup_id:int32 is_all_history_availab reportSupergroupSpam supergroup_id:int32 user_id:int32 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 -//@filter The type of users to return. By default, supergroupMembersRecent @offset Number of users to skip @limit The maximum number of users be returned; up to 200 +//@filter The type of users to return. By default, supergroupMembersFilterRecent @offset Number of users to skip @limit The maximum number of users be returned; up to 200 getSupergroupMembers supergroup_id:int32 filter:SupergroupMembersFilter offset:int32 limit:int32 = ChatMembers; //@description Deletes a supergroup or channel along with all messages in the corresponding chat. This will release the supergroup or channel username and remove all members; requires owner privileges in the supergroup or channel. Chats with more than 1000 members can't be deleted using this method @supergroup_id Identifier of the supergroup or channel @@ -3982,7 +4533,7 @@ deleteSavedCredentials = Ok; getSupportUser = User; -//@description Returns backgrounds installed by the user @for_dark_theme True, if the backgrounds needs to be ordered for 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 @@ -4013,7 +4564,7 @@ getLanguagePackInfo language_pack_id:string = LanguagePackInfo; //@description Returns strings from a language pack in the current localization target by their keys. Can be called before authorization @language_pack_id Language pack identifier of the strings to be returned @keys Language pack keys of the strings to be returned; leave empty to request all available strings getLanguagePackStrings language_pack_id:string keys:vector = LanguagePackStrings; -//@description Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization @language_pack_id Language pack identifier +//@description Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method shouldn't be called explicitly for the current used/base language packs. Can be called before authorization @language_pack_id Language pack identifier synchronizeLanguagePack language_pack_id:string = Ok; //@description Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization @language_pack_id Identifier of a language pack to be added; may be different from a name that is used in an "https://t.me/setlanguage/" link @@ -4032,14 +4583,14 @@ setCustomLanguagePackString language_pack_id:string new_string:languagePackStrin deleteLanguagePack language_pack_id:string = Ok; -//@description Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription @device_token Device token @other_user_ids List of user identifiers of other users currently using the client +//@description Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription @device_token Device token @other_user_ids List of user identifiers of other users currently using the application registerDevice device_token:DeviceToken other_user_ids:vector = PushReceiverId; //@description Handles a push notification. Returns error with code 406 if the push notification is not supported and connection to the server is required to fetch new data. Can be called before authorization //@payload JSON-encoded push notification payload with all fields sent by the server, and "google.sent_time" and "google.notification.sound" fields added processPushNotification payload:string = Ok; -//@description Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. This is an offline method. Can be called before authorization. Can be called synchronously @payload JSON-encoded push notification payload +//@description Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. Can be called synchronously @payload JSON-encoded push notification payload getPushReceiverId payload:string = PushReceiverId; @@ -4076,13 +4627,22 @@ 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. Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by moderators, or when the report is done from the chat action bar @chat_id Chat identifier @reason The reason for reporting the chat @message_ids Identifiers of reported messages, if any +//@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 chats 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 @reason The reason for reporting the chat @message_ids Identifiers of reported messages, if any reportChat chat_id:int53 reason:ChatReportReason message_ids:vector = Ok; -//@description Returns an HTTP URL with the chat statistics. Currently this method can be used only for channels. Can be used only if SupergroupFullInfo.can_view_statistics == true @chat_id Chat identifier @parameters Parameters from "tg://statsrefresh?params=******" link @is_dark Pass true if a URL with the dark theme must be returned +//@description Returns an HTTP URL with the chat statistics. Currently this method of getting the statistics are disabled and can be deleted in the future @chat_id Chat identifier @parameters Parameters from "tg://statsrefresh?params=******" link @is_dark Pass true if a URL with the dark theme must be returned getChatStatisticsUrl chat_id:int53 parameters:string is_dark:Bool = HttpUrl; +//@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 +getMessageStatistics chat_id:int53 message_id:int53 is_dark:Bool = MessageStatistics; + +//@description Loads an asynchronous or a zoomed in statistical graph @chat_id Chat identifier @token The token for graph loading @x X-value for zoomed in graph or 0 otherwise +getStatisticalGraph chat_id:int53 token:string x:int53 = StatisticalGraph; + //@description Returns storage usage statistics. Can be called before authorization @chat_limit The maximum number of chats with the largest storage usage for which separate statistics should be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0 getStorageStatistics chat_limit:int32 = StorageStatistics; @@ -4101,8 +4661,9 @@ getDatabaseStatistics = DatabaseStatistics; //@file_types If not empty, only files with the given type(s) are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted //@chat_ids If not 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) //@exclude_chat_ids If not empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos) +//@return_deleted_file_statistics Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics //@chat_limit Same as in getStorageStatistics. Affects only returned statistics -optimizeStorage size:int53 ttl:int32 count:int32 immunity_delay:int32 file_types:vector chat_ids:vector exclude_chat_ids:vector chat_limit:int32 = StorageStatistics; +optimizeStorage size:int53 ttl:int32 count:int32 immunity_delay:int32 file_types:vector chat_ids:vector exclude_chat_ids:vector return_deleted_file_statistics:Bool chat_limit:int32 = StorageStatistics; //@description Sets the current network type. Can be called before authorization. Calling this method forces all network connections to reopen, mitigating the delay in switching between different networks, so it should be called whenever the network is changed, even if the network type remains the same. @@ -4118,13 +4679,17 @@ addNetworkStatistics entry:NetworkStatisticsEntry = Ok; //@description Resets all network data usage statistics to zero. Can be called before authorization resetNetworkStatistics = Ok; -//@description Returns auto-download settings presets for the currently logged in user +//@description Returns auto-download settings presets for the current user getAutoDownloadSettingsPresets = AutoDownloadSettingsPresets; //@description Sets auto-download settings @settings New user auto-download settings @type Type of the network for which the new settings are applied setAutoDownloadSettings settings:autoDownloadSettings type:NetworkType = Ok; +//@description Returns information about a bank card @bank_card_number The bank card number +getBankCardInfo bank_card_number:string = BankCardInfo; + + //@description Returns one of the available Telegram Passport elements @type Telegram Passport element type @password Password of the current user getPassportElement type:PassportElementType password:string = PassportElement; @@ -4172,7 +4737,7 @@ getPassportAuthorizationForm bot_user_id:int32 scope:string public_key:string no //@description Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form @autorization_form_id Authorization form identifier @password Password of the current user getPassportAuthorizationFormAvailableElements autorization_form_id:int32 password:string = PassportElementsWithErrors; -//@description Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements need to be used +//@description Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements are going to be reused //@autorization_form_id Authorization form identifier @types Types of Telegram Passport elements chosen by user to complete the authorization form sendPassportAuthorizationForm autorization_form_id:int32 types:vector = Ok; @@ -4192,17 +4757,29 @@ checkPhoneNumberConfirmationCode code:string = Ok; setBotUpdatesStatus pending_update_count:int32 error_message:string = Ok; -//@description Uploads a PNG image with a sticker; for bots only; returns the uploaded file @user_id Sticker file owner @png_sticker PNG image with the sticker; must be up to 512 kB in size and fit in 512x512 square +//@description Uploads a PNG image with a sticker; for bots only; returns the uploaded file +//@user_id Sticker file owner @png_sticker PNG image with the sticker; must be up to 512 KB in size and fit in 512x512 square uploadStickerFile user_id:int32 png_sticker:InputFile = File; -//@description Creates a new sticker set; for bots only. Returns the newly created sticker set @user_id Sticker set owner @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); 1-64 characters -//@is_masks True, if stickers are masks @stickers List of stickers to be added to the set -createNewStickerSet user_id:int32 title:string name:string is_masks:Bool stickers:vector = StickerSet; +//@description Creates a new sticker set; for bots only. Returns the newly created sticker set +//@user_id Sticker set owner +//@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); 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 +createNewStickerSet user_id:int32 title:string name:string is_masks:Bool stickers:vector = 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:int32 name:string sticker:inputSticker = 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:int32 name:string sticker:InputSticker = 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 @sticker Sticker @position New position of the sticker in the set, zero-based +//@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. Animated thumbnail must be set for animated sticker sets and only for them. Pass a zero InputFileId to delete the thumbnail +setStickerSetThumbnail user_id:int32 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 +//@sticker Sticker @position New position of the sticker in the set, zero-based setStickerPositionInSet sticker:InputFile position:int32 = Ok; //@description Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot @sticker Sticker @@ -4224,13 +4801,19 @@ sendCustomRequest method:string parameters:string = CustomRequestResult; answerCustomQuery custom_query_id:int64 data:string = Ok; -//@description Succeeds after a specified amount of time has passed. Can be called before authorization. Can be called before initialization @seconds Number of seconds before the function returns +//@description Succeeds after a specified amount of time has passed. Can be called before initialization @seconds Number of seconds before the function returns setAlarm seconds:double = Ok; -//@description Uses current user IP to found their country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization +//@description Returns information about existing countries. Can be called before authorization +getCountries = Countries; + +//@description Uses current user IP address to find their country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization getCountryCode = Text; +//@description Returns information about a phone number by its prefix. Can be called before authorization @phone_number_prefix The phone number prefix +getPhoneNumberInfo phone_number_prefix:string = PhoneNumberInfo; + //@description Returns the default text for invitation messages to be used as a placeholder when the current user invites friends to Telegram getInviteText = Text; @@ -4270,30 +4853,30 @@ getProxyLink proxy_id:int32 = Text; pingProxy proxy_id:int32 = Seconds; -//@description Sets new log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously @log_stream New log stream +//@description Sets new log stream for internal logging of TDLib. Can be called synchronously @log_stream New log stream setLogStream log_stream:LogStream = Ok; -//@description Returns information about currently used log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously +//@description Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously getLogStream = LogStream; -//@description Sets the verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously +//@description Sets the verbosity level of the internal logging of TDLib. Can be called synchronously //@new_verbosity_level New value of the verbosity level for logging. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings, value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1023 can be used to enable even more logging setLogVerbosityLevel new_verbosity_level:int32 = Ok; -//@description Returns current verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously +//@description Returns current verbosity level of the internal logging of TDLib. Can be called synchronously getLogVerbosityLevel = LogVerbosityLevel; -//@description Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. This is an offline method. Can be called before authorization. Can be called synchronously +//@description Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously getLogTags = LogTags; -//@description Sets the verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously +//@description Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously //@tag Logging tag to change verbosity level @new_verbosity_level New verbosity level; 1-1024 setLogTagVerbosityLevel tag:string new_verbosity_level:int32 = Ok; -//@description Returns current verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously @tag Logging tag to change verbosity level +//@description Returns current verbosity level for a specified TDLib internal log tag. Can be called synchronously @tag Logging tag to change verbosity level getLogTagVerbosityLevel tag:string = LogVerbosityLevel; -//@description Adds a message to TDLib internal log. This is an offline method. Can be called before authorization. Can be called synchronously +//@description Adds a message to TDLib internal log. Can be called synchronously //@verbosity_level The minimum verbosity level needed for the message to be logged, 0-1023 @text Text of a message to log addLogMessage verbosity_level:int32 text:string = Ok; @@ -4323,5 +4906,5 @@ testProxy server:string port:int32 type:ProxyType dc_id:int32 timeout:double = O testGetDifference = Ok; //@description Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization testUseUpdate = Update; -//@description Returns the specified error and ensures that the Error object is used; for testing only. This is an offline method. Can be called before authorization. Can be called synchronously @error The error to be returned +//@description Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously @error The error to be returned testReturnError error:error = Error;