diff --git a/Makefile b/Makefile index 419729c..8d6428e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := v1.7.0 +TAG := v1.8.0 schema-update: curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl diff --git a/README.md b/README.md index de9f9e3..9cf7ce2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # go-tdlib -Go wrapper for [TDLib (Telegram Database Library)](https://github.com/tdlib/td) with full support of TDLib v1.7.0 +Go wrapper for [TDLib (Telegram Database Library)](https://github.com/tdlib/td) with full support of TDLib v1.8.0 ## TDLib installation diff --git a/client/function.go b/client/function.go index 050253a..927f3da 100755 --- a/client/function.go +++ b/client/function.go @@ -62,7 +62,7 @@ func (client *Client) GetAuthorizationState() (AuthorizationState, error) { } type SetTdlibParametersRequest struct { - // Parameters + // Parameters for TDLib initialization Parameters *TdlibParameters `json:"parameters"` } @@ -116,7 +116,7 @@ func (client *Client) CheckDatabaseEncryptionKey(req *CheckDatabaseEncryptionKey type SetAuthenticationPhoneNumberRequest struct { // The phone number of the user, in international format PhoneNumber string `json:"phone_number"` - // Settings for the authentication of the user's phone number + // Settings for the authentication of the user's phone number; pass null to use default settings Settings *PhoneNumberAuthenticationSettings `json:"settings"` } @@ -142,7 +142,7 @@ func (client *Client) SetAuthenticationPhoneNumber(req *SetAuthenticationPhoneNu return UnmarshalOk(result.Data) } -// Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode and the next_code_type of the result is not null +// Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed func (client *Client) ResendAuthenticationCode() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -162,7 +162,7 @@ func (client *Client) ResendAuthenticationCode() (*Ok, error) { } type CheckAuthenticationCodeRequest struct { - // The verification code received via SMS, Telegram message, phone call, or flash call + // Authentication code to check Code string `json:"code"` } @@ -189,7 +189,7 @@ func (client *Client) CheckAuthenticationCode(req *CheckAuthenticationCodeReques type RequestQrCodeAuthenticationRequest struct { // List of user identifiers of other users currently using the application - OtherUserIds []int32 `json:"other_user_ids"` + OtherUserIds []int64 `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, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword @@ -287,9 +287,39 @@ func (client *Client) RequestAuthenticationPasswordRecovery() (*Ok, error) { return UnmarshalOk(result.Data) } +type CheckAuthenticationPasswordRecoveryCodeRequest struct { + // Recovery code to check + RecoveryCode string `json:"recovery_code"` +} + +// Checks whether a password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword +func (client *Client) CheckAuthenticationPasswordRecoveryCode(req *CheckAuthenticationPasswordRecoveryCodeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkAuthenticationPasswordRecoveryCode", + }, + Data: map[string]interface{}{ + "recovery_code": req.RecoveryCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type RecoverAuthenticationPasswordRequest struct { // Recovery code to check RecoveryCode string `json:"recovery_code"` + // New password of the user; may be empty to remove the password + NewPassword string `json:"new_password"` + // New password hint; may be empty + NewHint string `json:"new_hint"` } // Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword @@ -300,6 +330,8 @@ func (client *Client) RecoverAuthenticationPassword(req *RecoverAuthenticationPa }, Data: map[string]interface{}{ "recovery_code": req.RecoveryCode, + "new_password": req.NewPassword, + "new_hint": req.NewHint, }, }) if err != nil { @@ -493,13 +525,13 @@ type SetPasswordRequest struct { NewPassword string `json:"new_password"` // New password hint; may be empty NewHint string `json:"new_hint"` - // Pass true if the recovery email address should be changed + // Pass true if the recovery email address must be changed SetRecoveryEmailAddress bool `json:"set_recovery_email_address"` // New recovery email address; may be empty NewRecoveryEmailAddress string `json:"new_recovery_email_address"` } -// Changes the password for the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed +// Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed func (client *Client) SetPassword(req *SetPasswordRequest) (*PasswordState, error) { result, err := client.Send(Request{ meta: meta{ @@ -580,7 +612,7 @@ func (client *Client) SetRecoveryEmailAddress(req *SetRecoveryEmailAddressReques } type CheckRecoveryEmailAddressCodeRequest struct { - // Verification code + // Verification code to check Code string `json:"code"` } @@ -624,7 +656,7 @@ func (client *Client) ResendRecoveryEmailAddressCode() (*PasswordState, error) { return UnmarshalPasswordState(result.Data) } -// Requests to send a password recovery code to an email address that was previously set up +// Requests to send a 2-step verification password recovery code to an email address that was previously set up func (client *Client) RequestPasswordRecovery() (*EmailAddressAuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -643,16 +675,16 @@ func (client *Client) RequestPasswordRecovery() (*EmailAddressAuthenticationCode return UnmarshalEmailAddressAuthenticationCodeInfo(result.Data) } -type RecoverPasswordRequest struct { +type CheckPasswordRecoveryCodeRequest struct { // Recovery code to check RecoveryCode string `json:"recovery_code"` } -// Recovers the password using a recovery code sent to an email address that was previously set up -func (client *Client) RecoverPassword(req *RecoverPasswordRequest) (*PasswordState, error) { +// Checks whether a 2-step verification password recovery code sent to an email address is valid +func (client *Client) CheckPasswordRecoveryCode(req *CheckPasswordRecoveryCodeRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "recoverPassword", + Type: "checkPasswordRecoveryCode", }, Data: map[string]interface{}{ "recovery_code": req.RecoveryCode, @@ -666,13 +698,95 @@ func (client *Client) RecoverPassword(req *RecoverPasswordRequest) (*PasswordSta return nil, buildResponseError(result.Data) } + return UnmarshalOk(result.Data) +} + +type RecoverPasswordRequest struct { + // Recovery code to check + RecoveryCode string `json:"recovery_code"` + // New password of the user; may be empty to remove the password + NewPassword string `json:"new_password"` + // New password hint; may be empty + NewHint string `json:"new_hint"` +} + +// Recovers the 2-step verification password using a recovery code sent to an email address that was previously set up +func (client *Client) RecoverPassword(req *RecoverPasswordRequest) (*PasswordState, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "recoverPassword", + }, + Data: map[string]interface{}{ + "recovery_code": req.RecoveryCode, + "new_password": req.NewPassword, + "new_hint": req.NewHint, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + return UnmarshalPasswordState(result.Data) } +// Removes 2-step verification password without previous password and access to recovery email address. The password can't be reset immediately and the request needs to be repeated after the specified time +func (client *Client) ResetPassword() (ResetPasswordResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "resetPassword", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeResetPasswordResultOk: + return UnmarshalResetPasswordResultOk(result.Data) + + case TypeResetPasswordResultPending: + return UnmarshalResetPasswordResultPending(result.Data) + + case TypeResetPasswordResultDeclined: + return UnmarshalResetPasswordResultDeclined(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +// Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date > 0 +func (client *Client) CancelPasswordReset() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "cancelPasswordReset", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CreateTemporaryPasswordRequest struct { // Persistent user password Password string `json:"password"` - // Time during which the temporary password will be valid, in seconds; should be between 60 and 86400 + // Time during which the temporary password will be valid, in seconds; must be between 60 and 86400 ValidFor int32 `json:"valid_for"` } @@ -738,7 +852,7 @@ func (client *Client) GetMe() (*User, error) { type GetUserRequest struct { // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } // Returns information about a user by their identifier. This is an offline request if the current user is not a bot @@ -764,7 +878,7 @@ func (client *Client) GetUser(req *GetUserRequest) (*User, error) { type GetUserFullInfoRequest struct { // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } // Returns full information about a user by their identifier @@ -790,7 +904,7 @@ func (client *Client) GetUserFullInfo(req *GetUserFullInfoRequest) (*UserFullInf type GetBasicGroupRequest struct { // Basic group identifier - BasicGroupId int32 `json:"basic_group_id"` + BasicGroupId int64 `json:"basic_group_id"` } // Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot @@ -816,7 +930,7 @@ func (client *Client) GetBasicGroup(req *GetBasicGroupRequest) (*BasicGroup, err type GetBasicGroupFullInfoRequest struct { // Basic group identifier - BasicGroupId int32 `json:"basic_group_id"` + BasicGroupId int64 `json:"basic_group_id"` } // Returns full information about a basic group by its identifier @@ -842,7 +956,7 @@ func (client *Client) GetBasicGroupFullInfo(req *GetBasicGroupFullInfoRequest) ( type GetSupergroupRequest struct { // Supergroup or channel identifier - SupergroupId int32 `json:"supergroup_id"` + SupergroupId int64 `json:"supergroup_id"` } // Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot @@ -868,7 +982,7 @@ func (client *Client) GetSupergroup(req *GetSupergroupRequest) (*Supergroup, err type GetSupergroupFullInfoRequest struct { // Supergroup or channel identifier - SupergroupId int32 `json:"supergroup_id"` + SupergroupId int64 `json:"supergroup_id"` } // Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute @@ -1005,7 +1119,7 @@ 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 to get + // Identifier of the reply message MessageId int64 `json:"message_id"` } @@ -1147,6 +1261,35 @@ func (client *Client) GetMessageThread(req *GetMessageThreadRequest) (*MessageTh return UnmarshalMessageThreadInfo(result.Data) } +type GetMessageViewersRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +// Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true +func (client *Client) GetMessageViewers(req *GetMessageViewersRequest) (*Users, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageViewers", + }, + 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 UnmarshalUsers(result.Data) +} + type GetFileRequest struct { // Identifier of the file to get FileId int32 `json:"file_id"` @@ -1176,7 +1319,7 @@ func (client *Client) GetFile(req *GetFileRequest) (*File, error) { type GetRemoteFileRequest struct { // Remote identifier of the file to get RemoteFileId string `json:"remote_file_id"` - // File type, if known + // File type; pass null if unknown FileType FileType `json:"file_type"` } @@ -1202,28 +1345,51 @@ func (client *Client) GetRemoteFile(req *GetRemoteFileRequest) (*File, error) { return UnmarshalFile(result.Data) } -type GetChatsRequest struct { - // The chat list in which to return chats +type LoadChatsRequest struct { + // The chat list in which to load chats; pass null to load chats from the main chat list ChatList ChatList `json:"chat_list"` - // Chat order to return chats from - OffsetOrder JsonInt64 `json:"offset_order"` - // Chat identifier to return chats from - OffsetChatId int64 `json:"offset_chat_id"` - // The maximum number of chats to be returned. It is possible that fewer chats than the limit are returned even if the end of the list is not reached + // The maximum number of chats to be loaded. For optimal performance, the number of loaded chats is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached Limit int32 `json:"limit"` } -// 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 +// Loads more chats from a chat list. The loaded chats and their positions in the chat list will be sent through updates. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. Returns a 404 error if all chats have been loaded +func (client *Client) LoadChats(req *LoadChatsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadChats", + }, + Data: map[string]interface{}{ + "chat_list": req.ChatList, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetChatsRequest struct { + // The chat list in which to return chats; pass null to get chats from the main chat list + ChatList ChatList `json:"chat_list"` + // The maximum number of chats to be returned + Limit int32 `json:"limit"` +} + +// Returns an ordered list of chats from the beginning of a chat list. For informational purposes only. Use loadChats and updates processing instead to maintain chat lists in a consistent state func (client *Client) GetChats(req *GetChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ Type: "getChats", }, Data: map[string]interface{}{ - "chat_list": req.ChatList, - "offset_order": req.OffsetOrder, - "offset_chat_id": req.OffsetChatId, - "limit": req.Limit, + "chat_list": req.ChatList, + "limit": req.Limit, }, }) if err != nil { @@ -1242,7 +1408,7 @@ type SearchPublicChatRequest struct { Username string `json:"username"` } -// Searches a public chat by its username. Currently only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned +// Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned func (client *Client) SearchPublicChat(req *SearchPublicChatRequest) (*Chat, error) { result, err := client.Send(Request{ meta: meta{ @@ -1268,7 +1434,7 @@ type SearchPublicChatsRequest struct { Query string `json:"query"` } -// Searches public chats by looking for specified query in their username and title. Currently only private chats, supergroups and channels can be public. Returns a meaningful number of results. 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 +// Searches public chats by looking for specified query in their username and title. Currently, only private chats, supergroups and channels can be public. Returns a meaningful number of results. Excludes private chats with contacts and chats from the chat list from the results func (client *Client) SearchPublicChats(req *SearchPublicChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1290,7 +1456,7 @@ func (client *Client) SearchPublicChats(req *SearchPublicChatsRequest) (*Chats, } type SearchChatsRequest struct { - // Query to search for. If the query is empty, returns up to 20 recently found chats + // Query to search for. If the query is empty, returns up to 50 recently found chats Query string `json:"query"` // The maximum number of chats to be returned Limit int32 `json:"limit"` @@ -1352,7 +1518,7 @@ type SearchChatsNearbyRequest struct { Location *Location `json:"location"` } -// 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 +// 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 must be sent again every 25 seconds with adjusted location to not miss new chats func (client *Client) SearchChatsNearby(req *SearchChatsNearbyRequest) (*ChatsNearby, error) { result, err := client.Send(Request{ meta: meta{ @@ -1502,8 +1668,34 @@ func (client *Client) ClearRecentlyFoundChats() (*Ok, error) { return UnmarshalOk(result.Data) } +type GetRecentlyOpenedChatsRequest struct { + // The maximum number of chats to be returned + Limit int32 `json:"limit"` +} + +// Returns recently opened chats, this is an offline request. Returns chats in the order of last opening +func (client *Client) GetRecentlyOpenedChats(req *GetRecentlyOpenedChatsRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getRecentlyOpenedChats", + }, + Data: map[string]interface{}{ + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + type CheckChatUsernameRequest struct { - // Chat identifier; should be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if chat is being created + // Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created ChatId int64 `json:"chat_id"` // Username to be checked Username string `json:"username"` @@ -1641,7 +1833,7 @@ func (client *Client) GetInactiveSupergroupChats() (*Chats, error) { type GetGroupsInCommonRequest struct { // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // Chat identifier starting from which to return chats; use 0 for the first request OffsetChatId int64 `json:"offset_chat_id"` // The maximum number of chats to be returned; up to 100 @@ -1678,13 +1870,13 @@ 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 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 + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` // If true, returns only messages that are available locally without sending network requests OnlyLocal bool `json:"only_local"` } -// Returns messages in a chat. 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. This is an offline request if only_local is true +// Returns messages in a chat. 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 TDLib. This is an offline request if only_local is true func (client *Client) GetChatHistory(req *GetChatHistoryRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -1718,11 +1910,11 @@ type GetMessageThreadHistoryRequest 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 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 + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` } -// 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 +// 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 TDLib func (client *Client) GetMessageThreadHistory(req *GetMessageThreadHistoryRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -1750,13 +1942,13 @@ func (client *Client) GetMessageThreadHistory(req *GetMessageThreadHistoryReques type DeleteChatHistoryRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Pass true if the chat should be removed from the chat list + // Pass true if the chat needs to be removed from the chat list RemoveFromChatList bool `json:"remove_from_chat_list"` - // Pass true to try to delete chat history for all users + // Pass true to delete chat history for all users Revoke bool `json:"revoke"` } -// 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 +// 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 func (client *Client) DeleteChatHistory(req *DeleteChatHistoryRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -1779,26 +1971,52 @@ func (client *Client) DeleteChatHistory(req *DeleteChatHistoryRequest) (*Ok, err return UnmarshalOk(result.Data) } +type DeleteChatRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method +func (client *Client) DeleteChat(req *DeleteChatRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SearchChatMessagesRequest struct { // Identifier of the chat in which to search messages ChatId int64 `json:"chat_id"` // Query to search for Query string `json:"query"` - // 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 sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats + SenderId MessageSender `json:"sender_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 to get the specified message and 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 -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 -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // Filter for message content in the search results + // Additional filter for messages to search; pass null to search for all messages 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 +// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -1807,7 +2025,7 @@ func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Messa Data: map[string]interface{}{ "chat_id": req.ChatId, "query": req.Query, - "sender": req.Sender, + "sender_id": req.SenderId, "from_message_id": req.FromMessageId, "offset": req.Offset, "limit": req.Limit, @@ -1827,19 +2045,19 @@ func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Messa } type SearchMessagesRequest struct { - // Chat list in which to search messages; pass null to search in all chats regardless of their chat list + // Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported ChatList ChatList `json:"chat_list"` // Query to search for Query string `json:"query"` - // 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 + // The date of the message starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last message OffsetDate int32 `json:"offset_date"` // The chat identifier of the last found message, or 0 for the first request OffsetChatId int64 `json:"offset_chat_id"` // The message identifier of the last found message, or 0 for the first request OffsetMessageId int64 `json:"offset_message_id"` - // 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. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // Filter for message content in the search results; searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function + // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, 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"` @@ -1847,7 +2065,7 @@ type SearchMessagesRequest struct { MaxDate int32 `json:"max_date"` } -// Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance the number of returned messages is chosen by the library +// Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit func (client *Client) SearchMessages(req *SearchMessagesRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -1879,17 +2097,17 @@ func (client *Client) SearchMessages(req *SearchMessagesRequest) (*Messages, err type SearchSecretMessagesRequest struct { // Identifier of the chat in which to search. Specify 0 to search in all secret chats ChatId int64 `json:"chat_id"` - // Query to search for. If empty, searchChatMessages should be used instead + // Query to search for. If empty, searchChatMessages must be used instead Query string `json:"query"` // Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results Offset 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 + // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // A filter for message content in the search results + // Additional filter for messages to search; pass null to search for all messages Filter SearchMessagesFilter `json:"filter"` } -// 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 +// Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib func (client *Client) SearchSecretMessages(req *SearchSecretMessagesRequest) (*FoundMessages, error) { result, err := client.Send(Request{ meta: meta{ @@ -1917,13 +2135,13 @@ func (client *Client) SearchSecretMessages(req *SearchSecretMessagesRequest) (*F type SearchCallMessagesRequest struct { // Identifier of the message from which to search; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` - // 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. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // If true, returns only messages with missed calls + // If true, returns only messages with missed/declined calls OnlyMissed bool `json:"only_missed"` } -// Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library +// Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -1946,6 +2164,32 @@ func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*Messa return UnmarshalMessages(result.Data) } +type DeleteAllCallMessagesRequest struct { + // Pass true to delete the messages for all users + Revoke bool `json:"revoke"` +} + +// Deletes all call messages +func (client *Client) DeleteAllCallMessages(req *DeleteAllCallMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteAllCallMessages", + }, + Data: map[string]interface{}{ + "revoke": req.Revoke, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SearchChatRecentLocationMessagesRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -1975,7 +2219,7 @@ func (client *Client) SearchChatRecentLocationMessages(req *SearchChatRecentLoca return UnmarshalMessages(result.Data) } -// 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 +// Returns all active live locations that need to 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{ @@ -2023,6 +2267,73 @@ func (client *Client) GetChatMessageByDate(req *GetChatMessageByDateRequest) (*M return UnmarshalMessage(result.Data) } +type GetChatSparseMessagePositionsRequest struct { + // Identifier of the chat in which to return information about message positions + ChatId int64 `json:"chat_id"` + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function + Filter SearchMessagesFilter `json:"filter"` + // The message identifier from which to return information about message positions + FromMessageId int64 `json:"from_message_id"` + // The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages + Limit int32 `json:"limit"` +} + +// Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database +func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePositionsRequest) (*MessagePositions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatSparseMessagePositions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "filter": req.Filter, + "from_message_id": req.FromMessageId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessagePositions(result.Data) +} + +type GetChatMessageCalendarRequest struct { + // Identifier of the chat in which to return information about messages + ChatId int64 `json:"chat_id"` + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function + Filter SearchMessagesFilter `json:"filter"` + // The message identifier from which to return information about messages; use 0 to get results from the last message + FromMessageId int64 `json:"from_message_id"` +} + +// Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" +func (client *Client) GetChatMessageCalendar(req *GetChatMessageCalendarRequest) (*MessageCalendar, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatMessageCalendar", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "filter": req.Filter, + "from_message_id": req.FromMessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageCalendar(result.Data) +} + type GetChatMessageCountRequest struct { // Identifier of the chat in which to count messages ChatId int64 `json:"chat_id"` @@ -2088,11 +2399,11 @@ type GetMessagePublicForwardsRequest struct { 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 + // The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` } -// Returns forwarded copies of a channel message to different public channels. For optimal performance the number of returned messages is chosen by the library +// Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*FoundMessages, error) { result, err := client.Send(Request{ meta: meta{ @@ -2116,6 +2427,32 @@ func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequ return UnmarshalFoundMessages(result.Data) } +type GetChatSponsoredMessageRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` +} + +// Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat +func (client *Client) GetChatSponsoredMessage(req *GetChatSponsoredMessageRequest) (*SponsoredMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatSponsoredMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalSponsoredMessage(result.Data) +} + type RemoveNotificationRequest struct { // Identifier of notification group to which the notification belongs NotificationGroupId int32 `json:"notification_group_id"` @@ -2179,23 +2516,26 @@ type GetMessageLinkRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` + // If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview + MediaTimestamp int32 `json:"media_timestamp"` // Pass true to create a link for the whole media album ForAlbum bool `json:"for_album"` // Pass true to create a link to the message as a channel post comment, or from a message thread ForComment bool `json:"for_comment"` } -// 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 +// Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request 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, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "media_timestamp": req.MediaTimestamp, + "for_album": req.ForAlbum, + "for_comment": req.ForComment, }, }) if err != nil { @@ -2242,11 +2582,11 @@ func (client *Client) GetMessageEmbeddingCode(req *GetMessageEmbeddingCodeReques } type GetMessageLinkInfoRequest struct { - // The message link in the format "https://t.me/c/...", or "tg://privatepost?...", or "https://t.me/username/...", or "tg://resolve?..." + // The message link Url string `json:"url"` } -// Returns information about a public or private message link +// Returns information about a public or private message link. Can be called for any internal link of the type internalLinkTypeMessage func (client *Client) GetMessageLinkInfo(req *GetMessageLinkInfoRequest) (*MessageLinkInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -2267,6 +2607,61 @@ func (client *Client) GetMessageLinkInfo(req *GetMessageLinkInfoRequest) (*Messa return UnmarshalMessageLinkInfo(result.Data) } +type GetChatAvailableMessageSendersRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns list of message sender identifiers, which can be used to send messages in a chat +func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessageSendersRequest) (*MessageSenders, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatAvailableMessageSenders", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageSenders(result.Data) +} + +type SetChatMessageSenderRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New message sender for the chat + MessageSenderId MessageSender `json:"message_sender_id"` +} + +// Selects a message sender to send messages in a chat +func (client *Client) SetChatMessageSender(req *SetChatMessageSenderRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatMessageSender", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_sender_id": req.MessageSenderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SendMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` @@ -2274,9 +2669,9 @@ type SendMessageRequest struct { 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 to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` - // Markup for replying to the message; for bots only + // Markup for replying to the message; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` // The content of the message to be sent InputMessageContent InputMessageContent `json:"input_message_content"` @@ -2315,13 +2710,13 @@ type SendMessageAlbumRequest struct { 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 to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` - // Contents of messages to be sent + // Contents of messages to be sent. At most 10 messages can be added to an album InputMessageContents []InputMessageContent `json:"input_message_contents"` } -// 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 +// Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -2348,7 +2743,7 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, type SendBotStartMessageRequest struct { // Identifier of the bot - BotUserId int32 `json:"bot_user_id"` + BotUserId int64 `json:"bot_user_id"` // Identifier of the target chat ChatId int64 `json:"chat_id"` // A hidden parameter sent to the bot for deep linking purposes (https://core.telegram.org/bots#deep-linking) @@ -2385,7 +2780,7 @@ type SendInlineQueryResultMessageRequest struct { 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 to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` // Identifier of the inline query QueryId JsonInt64 `json:"query_id"` @@ -2427,14 +2822,16 @@ 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. Message identifiers must be in a strictly increasing order + // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously MessageIds []int64 `json:"message_ids"` - // Options to be used to send the messages + // Options to be used to send the messages; pass null to use default options 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 + // If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local SendCopy bool `json:"send_copy"` - // True, if media caption of message copies needs to be removed. Ignored if send_copy is false + // If true, media caption of message copies will be removed. Ignored if send_copy is false RemoveCaption bool `json:"remove_caption"` + // If true, messages will not be forwarded and instead fake messages will be returned + OnlyPreview bool `json:"only_preview"` } // 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 @@ -2450,6 +2847,7 @@ func (client *Client) ForwardMessages(req *ForwardMessagesRequest) (*Messages, e "options": req.Options, "send_copy": req.SendCopy, "remove_caption": req.RemoveCaption, + "only_preview": req.OnlyPreview, }, }) if err != nil { @@ -2492,35 +2890,6 @@ func (client *Client) ResendMessages(req *ResendMessagesRequest) (*Messages, err return UnmarshalMessages(result.Data) } -type SendChatSetTtlMessageRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // New TTL value, in seconds - Ttl int32 `json:"ttl"` -} - -// Changes the current TTL setting (sets a new self-destruct timer) in a secret chat and sends the corresponding message -func (client *Client) SendChatSetTtlMessage(req *SendChatSetTtlMessageRequest) (*Message, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "sendChatSetTtlMessage", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "ttl": req.Ttl, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalMessage(result.Data) -} - type SendChatScreenshotTakenNotificationRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -2550,8 +2919,8 @@ func (client *Client) SendChatScreenshotTakenNotification(req *SendChatScreensho type AddLocalMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // The sender sender of the message - Sender MessageSender `json:"sender"` + // Identifier of the sender of the message + SenderId MessageSender `json:"sender_id"` // Identifier of the message to reply to or 0 ReplyToMessageId int64 `json:"reply_to_message_id"` // Pass true to disable notification for the message @@ -2568,7 +2937,7 @@ func (client *Client) AddLocalMessage(req *AddLocalMessageRequest) (*Message, er }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "sender": req.Sender, + "sender_id": req.SenderId, "reply_to_message_id": req.ReplyToMessageId, "disable_notification": req.DisableNotification, "input_message_content": req.InputMessageContent, @@ -2590,7 +2959,7 @@ type DeleteMessagesRequest struct { ChatId int64 `json:"chat_id"` // Identifiers of the messages to be deleted MessageIds []int64 `json:"message_ids"` - // Pass true to try to delete messages for all chat members. Always true for supergroups, channels and secret chats + // Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats Revoke bool `json:"revoke"` } @@ -2617,22 +2986,57 @@ func (client *Client) DeleteMessages(req *DeleteMessagesRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type DeleteChatMessagesFromUserRequest struct { +type DeleteChatMessagesBySenderRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // User identifier - UserId int32 `json:"user_id"` + // Identifier of the sender of messages to delete + SenderId MessageSender `json:"sender_id"` } -// Deletes all messages sent by the specified user to a chat. Supported only for supergroups; requires can_delete_messages administrator privileges -func (client *Client) DeleteChatMessagesFromUser(req *DeleteChatMessagesFromUserRequest) (*Ok, error) { +// Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges +func (client *Client) DeleteChatMessagesBySender(req *DeleteChatMessagesBySenderRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "deleteChatMessagesFromUser", + Type: "deleteChatMessagesBySender", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "user_id": req.UserId, + "chat_id": req.ChatId, + "sender_id": req.SenderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteChatMessagesByDateRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The minimum date of the messages to delete + MinDate int32 `json:"min_date"` + // The maximum date of the messages to delete + MaxDate int32 `json:"max_date"` + // Pass true to delete chat messages for all users; private chats only + Revoke bool `json:"revoke"` +} + +// Deletes all messages between the specified dates in a chat. Supported only for private chats and basic groups. Messages sent in the last 30 seconds will not be deleted +func (client *Client) DeleteChatMessagesByDate(req *DeleteChatMessagesByDateRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteChatMessagesByDate", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "min_date": req.MinDate, + "max_date": req.MaxDate, + "revoke": req.Revoke, }, }) if err != nil { @@ -2651,9 +3055,9 @@ type EditMessageTextRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // The new message reply markup; for bots only + // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New text content of the message. Should be of type InputMessageText + // New text content of the message. Must be of type inputMessageText InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -2686,9 +3090,9 @@ type EditMessageLiveLocationRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // The new message reply markup; for bots only + // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New location content of the message; may be null. Pass null to stop sharing the live location + // New location content of the message; 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"` @@ -2727,13 +3131,13 @@ type EditMessageMediaRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // The new message reply markup; for bots only + // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New content of the message. Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePhoto or InputMessageVideo + // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo InputMessageContent InputMessageContent `json:"input_message_content"` } -// 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 +// Edits the content of a message with an animation, an audio, a document, a photo or a video, including message caption. If only the caption needs to be edited, use editMessageCaption instead. The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. Returns the edited message after the edit is completed on the server side func (client *Client) EditMessageMedia(req *EditMessageMediaRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -2762,9 +3166,9 @@ type EditMessageCaptionRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // The new message reply markup; for bots only + // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New message content caption; 0-GetOption("message_caption_length_max") characters + // New message content caption; 0-GetOption("message_caption_length_max") characters; pass null to remove caption Caption *FormattedText `json:"caption"` } @@ -2797,7 +3201,7 @@ type EditMessageReplyMarkupRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // The new message reply markup + // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` } @@ -2827,9 +3231,9 @@ func (client *Client) EditMessageReplyMarkup(req *EditMessageReplyMarkupRequest) type EditInlineMessageTextRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` - // The new message reply markup + // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New text content of the message. Should be of type InputMessageText + // New text content of the message. Must be of type inputMessageText InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -2859,9 +3263,9 @@ func (client *Client) EditInlineMessageText(req *EditInlineMessageTextRequest) ( type EditInlineMessageLiveLocationRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` - // The new message reply markup + // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New location content of the message; may be null. Pass null to stop sharing the live location + // New location content of the message; 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"` @@ -2897,9 +3301,9 @@ func (client *Client) EditInlineMessageLiveLocation(req *EditInlineMessageLiveLo type EditInlineMessageMediaRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` - // The new message reply markup; for bots only + // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New content of the message. Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePhoto or InputMessageVideo + // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -2929,9 +3333,9 @@ func (client *Client) EditInlineMessageMedia(req *EditInlineMessageMediaRequest) type EditInlineMessageCaptionRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` - // The new message reply markup + // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New message content caption; 0-GetOption("message_caption_length_max") characters + // New message content caption; pass null to remove caption; 0-GetOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -2961,7 +3365,7 @@ func (client *Client) EditInlineMessageCaption(req *EditInlineMessageCaptionRequ type EditInlineMessageReplyMarkupRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` - // The new message reply markup + // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` } @@ -2992,7 +3396,7 @@ type EditMessageSchedulingStateRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // The new message scheduling state. Pass null to send the message immediately + // The new message scheduling state; pass null to send the message immediately SchedulingState MessageSchedulingState `json:"scheduling_state"` } @@ -3365,11 +3769,11 @@ type GetPollVotersRequest struct { OptionId int32 `json:"option_id"` // Number of users to skip in the result; must be non-negative Offset int32 `json:"offset"` - // The maximum number of users to be returned; must be positive and can't be greater than 50. Fewer users may be returned than specified by the limit, even if the end of the voter list has not been reached + // The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached Limit int32 `json:"limit"` } -// Returns users voted for the specified option in a non-anonymous polls. For the optimal performance the number of returned users is chosen by the library +// Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*Users, error) { result, err := client.Send(Request{ meta: meta{ @@ -3399,7 +3803,7 @@ type StopPollRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message containing the poll MessageId int64 `json:"message_id"` - // The new message reply markup; for bots only + // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` } @@ -3458,7 +3862,7 @@ type GetLoginUrlInfoRequest struct { // Message identifier of the message with the button MessageId int64 `json:"message_id"` // Button identifier - ButtonId int32 `json:"button_id"` + ButtonId int64 `json:"button_id"` } // Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button @@ -3499,7 +3903,7 @@ type GetLoginUrlRequest struct { // Message identifier of the message with the button MessageId int64 `json:"message_id"` // Button identifier - ButtonId int32 `json:"button_id"` + ButtonId int64 `json:"button_id"` // True, if the user allowed the bot to send them messages AllowWriteAccess bool `json:"allow_write_access"` } @@ -3530,10 +3934,10 @@ func (client *Client) GetLoginUrl(req *GetLoginUrlRequest) (*HttpUrl, error) { type GetInlineQueryResultsRequest struct { // The identifier of the target bot - BotUserId int32 `json:"bot_user_id"` + BotUserId int64 `json:"bot_user_id"` // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` - // Location of the user, only if needed + // Location of the user; pass null if unknown or the bot doesn't need user's location UserLocation *Location `json:"user_location"` // Text of the query Query string `json:"query"` @@ -3577,7 +3981,7 @@ type AnswerInlineQueryRequest struct { CacheTime int32 `json:"cache_time"` // Offset for the next inline query; pass an empty string if there are no more results NextOffset string `json:"next_offset"` - // If non-empty, this text should be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter + // If non-empty, this text must be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter SwitchPmText string `json:"switch_pm_text"` // The parameter for the bot start message SwitchPmParameter string `json:"switch_pm_parameter"` @@ -3647,7 +4051,7 @@ type AnswerCallbackQueryRequest struct { CallbackQueryId JsonInt64 `json:"callback_query_id"` // Text of the answer Text string `json:"text"` - // If true, an alert should be shown to the user instead of a toast notification + // If true, an alert must be shown to the user instead of a toast notification ShowAlert bool `json:"show_alert"` // URL to be opened Url string `json:"url"` @@ -3746,10 +4150,10 @@ type SetGameScoreRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // True, if the message should be edited + // True, if the message needs to be edited EditMessage bool `json:"edit_message"` // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // The new score Score int32 `json:"score"` // Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table @@ -3785,10 +4189,10 @@ func (client *Client) SetGameScore(req *SetGameScoreRequest) (*Message, error) { type SetInlineGameScoreRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` - // True, if the message should be edited + // True, if the message needs to be edited EditMessage bool `json:"edit_message"` // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // The new score Score int32 `json:"score"` // Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table @@ -3826,7 +4230,7 @@ type GetGameHighScoresRequest struct { // Identifier of the message MessageId int64 `json:"message_id"` // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } // Returns the high scores for a game and some part of the high score table in the range of the specified user; for bots only @@ -3856,7 +4260,7 @@ type GetInlineGameHighScoresRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } // Returns game high scores and some part of the high score table in the range of the specified user; for bots only @@ -3888,7 +4292,7 @@ type DeleteChatReplyMarkupRequest struct { MessageId int64 `json:"message_id"` } -// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup will be changed +// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup is changed func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -3915,7 +4319,7 @@ type SendChatActionRequest struct { 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 + // The action description; pass null to cancel the currently active action Action ChatAction `json:"action"` } @@ -4001,11 +4405,11 @@ type ViewMessagesRequest struct { MessageThreadId int64 `json:"message_thread_id"` // The identifiers of the messages being viewed MessageIds []int64 `json:"message_ids"` - // True, if messages in closed chats should be marked as read by the request + // True, if messages in closed chats must be marked as read by the request ForceRead bool `json:"force_read"` } -// Informs TDLib that messages are being viewed by the user. Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels) +// Informs TDLib that messages are being viewed by the user. Sponsored messages must be marked as viewed only when the entire text of the message is shown on the screen (excluding the button). Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels) func (client *Client) ViewMessages(req *ViewMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4058,6 +4462,200 @@ func (client *Client) OpenMessageContent(req *OpenMessageContentRequest) (*Ok, e return UnmarshalOk(result.Data) } +type ClickAnimatedEmojiMessageRequest struct { + // Chat identifier of the message + ChatId int64 `json:"chat_id"` + // Identifier of the clicked message + MessageId int64 `json:"message_id"` +} + +// Informs TDLib that a message with an animated emoji was clicked by the user. Returns a big animated sticker to be played or a 404 error if usual animation needs to be played +func (client *Client) ClickAnimatedEmojiMessage(req *ClickAnimatedEmojiMessageRequest) (*Sticker, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clickAnimatedEmojiMessage", + }, + 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 UnmarshalSticker(result.Data) +} + +type GetInternalLinkTypeRequest struct { + // The link + Link string `json:"link"` +} + +// Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization +func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (InternalLinkType, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getInternalLinkType", + }, + Data: map[string]interface{}{ + "link": req.Link, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeInternalLinkTypeActiveSessions: + return UnmarshalInternalLinkTypeActiveSessions(result.Data) + + case TypeInternalLinkTypeAuthenticationCode: + return UnmarshalInternalLinkTypeAuthenticationCode(result.Data) + + case TypeInternalLinkTypeBackground: + return UnmarshalInternalLinkTypeBackground(result.Data) + + case TypeInternalLinkTypeBotStart: + return UnmarshalInternalLinkTypeBotStart(result.Data) + + case TypeInternalLinkTypeBotStartInGroup: + return UnmarshalInternalLinkTypeBotStartInGroup(result.Data) + + case TypeInternalLinkTypeChangePhoneNumber: + return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) + + case TypeInternalLinkTypeChatInvite: + return UnmarshalInternalLinkTypeChatInvite(result.Data) + + case TypeInternalLinkTypeFilterSettings: + return UnmarshalInternalLinkTypeFilterSettings(result.Data) + + case TypeInternalLinkTypeGame: + return UnmarshalInternalLinkTypeGame(result.Data) + + case TypeInternalLinkTypeLanguagePack: + return UnmarshalInternalLinkTypeLanguagePack(result.Data) + + case TypeInternalLinkTypeMessage: + return UnmarshalInternalLinkTypeMessage(result.Data) + + case TypeInternalLinkTypeMessageDraft: + return UnmarshalInternalLinkTypeMessageDraft(result.Data) + + case TypeInternalLinkTypePassportDataRequest: + return UnmarshalInternalLinkTypePassportDataRequest(result.Data) + + case TypeInternalLinkTypePhoneNumberConfirmation: + return UnmarshalInternalLinkTypePhoneNumberConfirmation(result.Data) + + case TypeInternalLinkTypeProxy: + return UnmarshalInternalLinkTypeProxy(result.Data) + + case TypeInternalLinkTypePublicChat: + return UnmarshalInternalLinkTypePublicChat(result.Data) + + case TypeInternalLinkTypeQrCodeAuthentication: + return UnmarshalInternalLinkTypeQrCodeAuthentication(result.Data) + + case TypeInternalLinkTypeSettings: + return UnmarshalInternalLinkTypeSettings(result.Data) + + case TypeInternalLinkTypeStickerSet: + return UnmarshalInternalLinkTypeStickerSet(result.Data) + + case TypeInternalLinkTypeTheme: + return UnmarshalInternalLinkTypeTheme(result.Data) + + case TypeInternalLinkTypeThemeSettings: + return UnmarshalInternalLinkTypeThemeSettings(result.Data) + + case TypeInternalLinkTypeUnknownDeepLink: + return UnmarshalInternalLinkTypeUnknownDeepLink(result.Data) + + case TypeInternalLinkTypeUnsupportedProxy: + return UnmarshalInternalLinkTypeUnsupportedProxy(result.Data) + + case TypeInternalLinkTypeVideoChat: + return UnmarshalInternalLinkTypeVideoChat(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +type GetExternalLinkInfoRequest struct { + // The link + Link string `json:"link"` +} + +// Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if web page preview is disabled in secret chats +func (client *Client) GetExternalLinkInfo(req *GetExternalLinkInfoRequest) (LoginUrlInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getExternalLinkInfo", + }, + Data: map[string]interface{}{ + "link": req.Link, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeLoginUrlInfoOpen: + return UnmarshalLoginUrlInfoOpen(result.Data) + + case TypeLoginUrlInfoRequestConfirmation: + return UnmarshalLoginUrlInfoRequestConfirmation(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +type GetExternalLinkRequest struct { + // The HTTP link + Link string `json:"link"` + // True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages + AllowWriteAccess bool `json:"allow_write_access"` +} + +// Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed +func (client *Client) GetExternalLink(req *GetExternalLinkRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getExternalLink", + }, + Data: map[string]interface{}{ + "link": req.Link, + "allow_write_access": req.AllowWriteAccess, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + type ReadAllChatMentionsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -4086,7 +4684,7 @@ func (client *Client) ReadAllChatMentions(req *ReadAllChatMentionsRequest) (*Ok, type CreatePrivateChatRequest struct { // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4115,7 +4713,7 @@ func (client *Client) CreatePrivateChat(req *CreatePrivateChatRequest) (*Chat, e type CreateBasicGroupChatRequest struct { // Basic group identifier - BasicGroupId int32 `json:"basic_group_id"` + BasicGroupId int64 `json:"basic_group_id"` // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4144,7 +4742,7 @@ func (client *Client) CreateBasicGroupChat(req *CreateBasicGroupChatRequest) (*C type CreateSupergroupChatRequest struct { // Supergroup or channel identifier - SupergroupId int32 `json:"supergroup_id"` + SupergroupId int64 `json:"supergroup_id"` // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4199,7 +4797,7 @@ func (client *Client) CreateSecretChat(req *CreateSecretChatRequest) (*Chat, err type CreateNewBasicGroupChatRequest struct { // Identifiers of users to be added to the basic group - UserIds []int32 `json:"user_ids"` + UserIds []int64 `json:"user_ids"` // Title of the new basic group; 1-128 characters Title string `json:"title"` } @@ -4229,12 +4827,14 @@ func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatReques type CreateNewSupergroupChatRequest struct { // Title of the new chat; 1-128 characters Title string `json:"title"` - // True, if a channel chat should be created + // True, if a channel chat needs to be created IsChannel bool `json:"is_channel"` // Chat description; 0-255 characters Description string `json:"description"` - // Chat location if a location-based supergroup is being created + // Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat Location *ChatLocation `json:"location"` + // True, if the supergroup is created for importing messages using importMessage + ForImport bool `json:"for_import"` } // Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat @@ -4248,6 +4848,7 @@ func (client *Client) CreateNewSupergroupChat(req *CreateNewSupergroupChatReques "is_channel": req.IsChannel, "description": req.Description, "location": req.Location, + "for_import": req.ForImport, }, }) if err != nil { @@ -4263,7 +4864,7 @@ func (client *Client) CreateNewSupergroupChat(req *CreateNewSupergroupChatReques type CreateNewSecretChatRequest struct { // Identifier of the target user - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } // Creates a new secret chat. Returns the newly created chat @@ -4553,7 +5154,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 +// Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right func (client *Client) SetChatTitle(req *SetChatTitleRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4578,11 +5179,11 @@ func (client *Client) SetChatTitle(req *SetChatTitleRequest) (*Ok, error) { type SetChatPhotoRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New chat photo. Pass null to delete the chat 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 +// Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4604,6 +5205,35 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SetChatMessageTtlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret + Ttl int32 `json:"ttl"` +} + +// Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram) +func (client *Client) SetChatMessageTtl(req *SetChatMessageTtlRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatMessageTtl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "ttl": req.Ttl, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatPermissionsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -4633,12 +5263,41 @@ func (client *Client) SetChatPermissions(req *SetChatPermissionsRequest) (*Ok, e return UnmarshalOk(result.Data) } +type SetChatThemeRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Name of the new chat theme; pass an empty string to return the default theme + ThemeName string `json:"theme_name"` +} + +// Changes the chat theme. Supported only in private and secret chats +func (client *Client) SetChatTheme(req *SetChatThemeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatTheme", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "theme_name": req.ThemeName, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + 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 + // New draft message; pass null to remove the draft DraftMessage *DraftMessage `json:"draft_message"` } @@ -4694,6 +5353,35 @@ func (client *Client) SetChatNotificationSettings(req *SetChatNotificationSettin return UnmarshalOk(result.Data) } +type ToggleChatHasProtectedContentRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // True, if chat content can't be saved locally, forwarded, or copied + HasProtectedContent bool `json:"has_protected_content"` +} + +// Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges +func (client *Client) ToggleChatHasProtectedContent(req *ToggleChatHasProtectedContentRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleChatHasProtectedContent", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "has_protected_content": req.HasProtectedContent, + }, + }) + 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"` @@ -4788,7 +5476,7 @@ type SetChatDescriptionRequest struct { Description string `json:"description"` } -// Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info rights +// Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right func (client *Client) SetChatDescription(req *SetChatDescriptionRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4817,7 +5505,7 @@ type SetChatDiscussionGroupRequest struct { DiscussionChatId int64 `json:"discussion_chat_id"` } -// Changes the discussion group of a channel chat; requires can_change_info rights in the channel if it is specified +// Changes the discussion group of a channel chat; requires can_change_info administrator right in the channel if it is specified func (client *Client) SetChatDiscussionGroup(req *SetChatDiscussionGroupRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4871,7 +5559,7 @@ func (client *Client) SetChatLocation(req *SetChatLocationRequest) (*Ok, error) type SetChatSlowModeDelayRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New slow mode delay for the chat; must be one of 0, 10, 30, 60, 300, 900, 3600 + // New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600 SlowModeDelay int32 `json:"slow_mode_delay"` } @@ -4902,7 +5590,7 @@ 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. Notifications are always disabled in channels and private chats + // True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats DisableNotification bool `json:"disable_notification"` // True, if the message needs to be pinned for one side only; private chats only OnlyForSelf bool `json:"only_for_self"` @@ -4992,7 +5680,7 @@ type JoinChatRequest struct { ChatId int64 `json:"chat_id"` } -// Adds current user as a new member to a chat. Private and secret chats can't be joined using this method +// Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method func (client *Client) JoinChat(req *JoinChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5018,7 +5706,7 @@ type LeaveChatRequest struct { ChatId int64 `json:"chat_id"` } -// Removes current user from chat members. Private and secret chats can't be left using this method +// Removes the current user from chat members. Private and secret chats can't be left using this method func (client *Client) LeaveChat(req *LeaveChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5043,12 +5731,12 @@ type AddChatMemberRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` // Identifier of the user - UserId int32 `json:"user_id"` - // The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels + UserId int64 `json:"user_id"` + // The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot ForwardLimit int32 `json:"forward_limit"` } -// Adds a new member to a chat. Members can't be added to private or secret chats. Members will not be added until the chat state has been synchronized with the server +// Adds a new member to a chat. Members can't be added to private or secret chats func (client *Client) AddChatMember(req *AddChatMemberRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5074,11 +5762,11 @@ func (client *Client) AddChatMember(req *AddChatMemberRequest) (*Ok, error) { type AddChatMembersRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifiers of the users to be added to the chat - UserIds []int32 `json:"user_ids"` + // Identifiers of the users to be added to the chat. The maximum number of added users is 20 for supergroups and 100 for channels + UserIds []int64 `json:"user_ids"` } -// Adds multiple new members to a chat. Currently this option is only available for supergroups and channels. This option can't be used to join a chat. Members can't be added to a channel if it has more than 200 members. Members will not be added until the chat state has been synchronized with the server +// Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members func (client *Client) AddChatMembers(req *AddChatMembersRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5103,22 +5791,57 @@ func (client *Client) AddChatMembers(req *AddChatMembersRequest) (*Ok, error) { type SetChatMemberStatusRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // User identifier - UserId int32 `json:"user_id"` + // Member identifier. Chats can be only banned and unbanned in supergroups and channels + MemberId MessageSender `json:"member_id"` // The new status of the member in the chat Status ChatMemberStatus `json:"status"` } -// Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for adding new members to the chat and transferring chat ownership; instead, use addChatMember or transferChatOwnership. The chat member status will not be changed until it has been synchronized with the server +// Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed func (client *Client) SetChatMemberStatus(req *SetChatMemberStatusRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "setChatMemberStatus", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "user_id": req.UserId, - "status": req.Status, + "chat_id": req.ChatId, + "member_id": req.MemberId, + "status": req.Status, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type BanChatMemberRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Member identifier + MemberId MessageSender `json:"member_id"` + // Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned + BannedUntilDate int32 `json:"banned_until_date"` + // Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels + RevokeMessages bool `json:"revoke_messages"` +} + +// Bans a member in a chat. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first +func (client *Client) BanChatMember(req *BanChatMemberRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "banChatMember", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "member_id": req.MemberId, + "banned_until_date": req.BannedUntilDate, + "revoke_messages": req.RevokeMessages, }, }) if err != nil { @@ -5170,7 +5893,7 @@ type TransferChatOwnershipRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` // Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // The password of the current user Password string `json:"password"` } @@ -5201,8 +5924,8 @@ func (client *Client) TransferChatOwnership(req *TransferChatOwnershipRequest) ( type GetChatMemberRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // User identifier - UserId int32 `json:"user_id"` + // Member identifier + MemberId MessageSender `json:"member_id"` } // Returns information about a single member of a chat @@ -5212,8 +5935,8 @@ func (client *Client) GetChatMember(req *GetChatMemberRequest) (*ChatMember, err Type: "getChatMember", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "user_id": req.UserId, + "chat_id": req.ChatId, + "member_id": req.MemberId, }, }) if err != nil { @@ -5232,9 +5955,9 @@ type SearchChatMembersRequest struct { ChatId int64 `json:"chat_id"` // Query to search for Query string `json:"query"` - // The maximum number of users to be returned + // The maximum number of users to be returned; up to 200 Limit int32 `json:"limit"` - // The type of users to return. By default, chatMembersFilterMembers + // The type of users to search for; pass null to search among all chat members Filter ChatMembersFilter `json:"filter"` } @@ -5315,7 +6038,7 @@ func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) ( } type GetChatNotificationSettingsExceptionsRequest struct { - // If specified, only chats from the specified scope will be returned + // If specified, only chats from the scope will be returned; pass null to return chats from all scopes Scope NotificationSettingsScope `json:"scope"` // If true, also chats with non-default sound will be returned CompareSound bool `json:"compare_sound"` @@ -5483,11 +6206,11 @@ type DownloadFileRequest struct { FileId int32 `json:"file_id"` // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first Priority int32 `json:"priority"` - // The starting position from which the file should be downloaded + // The starting position from which the file needs to be downloaded Offset int32 `json:"offset"` - // Number of bytes which should be downloaded starting from the "offset" position before the download will be automatically cancelled; use 0 to download without a limit + // Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit Limit int32 `json:"limit"` - // If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been cancelled or a new downloadFile request with different offset/limit parameters was sent + // If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent Synchronous bool `json:"synchronous"` } @@ -5519,11 +6242,11 @@ func (client *Client) DownloadFile(req *DownloadFileRequest) (*File, error) { type GetFileDownloadedPrefixSizeRequest struct { // Identifier of the file FileId int32 `json:"file_id"` - // Offset from which downloaded prefix size should be calculated + // Offset from which downloaded prefix size needs to be calculated Offset int32 `json:"offset"` } -// Returns file downloaded prefix size from a given offset +// Returns file downloaded prefix size from a given offset, in bytes func (client *Client) GetFileDownloadedPrefixSize(req *GetFileDownloadedPrefixSizeRequest) (*Count, error) { result, err := client.Send(Request{ meta: meta{ @@ -5574,10 +6297,39 @@ func (client *Client) CancelDownloadFile(req *CancelDownloadFileRequest) (*Ok, e return UnmarshalOk(result.Data) } +type GetSuggestedFileNameRequest struct { + // Identifier of the file + FileId int32 `json:"file_id"` + // Directory in which the file is supposed to be saved + Directory string `json:"directory"` +} + +// Returns suggested name for saving a file in a given directory +func (client *Client) GetSuggestedFileName(req *GetSuggestedFileNameRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSuggestedFileName", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "directory": req.Directory, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type UploadFileRequest struct { // File to upload File InputFile `json:"file"` - // File type + // File type; pass null if unknown FileType FileType `json:"file_type"` // Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded first Priority int32 `json:"priority"` @@ -5699,7 +6451,7 @@ func (client *Client) SetFileGenerationProgress(req *SetFileGenerationProgressRe type FinishFileGenerationRequest struct { // The identifier of the generation process GenerationId JsonInt64 `json:"generation_id"` - // If set, means that file generation has failed and should be terminated + // If passed, the file generation has failed and must be terminated; pass null if the file generation succeeded Error *Error `json:"error"` } @@ -5783,16 +6535,112 @@ func (client *Client) DeleteFile(req *DeleteFileRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GenerateChatInviteLinkRequest struct { +type GetMessageFileTypeRequest struct { + // Beginning of the message file; up to 100 first lines + MessageFileHead string `json:"message_file_head"` +} + +// Returns information about a file with messages exported from another app +func (client *Client) GetMessageFileType(req *GetMessageFileTypeRequest) (MessageFileType, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageFileType", + }, + Data: map[string]interface{}{ + "message_file_head": req.MessageFileHead, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeMessageFileTypePrivate: + return UnmarshalMessageFileTypePrivate(result.Data) + + case TypeMessageFileTypeGroup: + return UnmarshalMessageFileTypeGroup(result.Data) + + case TypeMessageFileTypeUnknown: + return UnmarshalMessageFileTypeUnknown(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +type GetMessageImportConfirmationTextRequest struct { + // Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right + ChatId int64 `json:"chat_id"` +} + +// Returns a confirmation text to be shown to the user before starting message import +func (client *Client) GetMessageImportConfirmationText(req *GetMessageImportConfirmationTextRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageImportConfirmationText", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type ImportMessagesRequest struct { + // Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right + ChatId int64 `json:"chat_id"` + // File with messages to import. Only inputFileLocal and inputFileGenerated are supported. The file must not be previously uploaded + MessageFile InputFile `json:"message_file"` + // Files used in the imported messages. Only inputFileLocal and inputFileGenerated are supported. The files must not be previously uploaded + AttachedFiles []InputFile `json:"attached_files"` +} + +// Imports messages exported from another app +func (client *Client) ImportMessages(req *ImportMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "importMessages", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_file": req.MessageFile, + "attached_files": req.AttachedFiles, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReplacePrimaryChatInviteLinkRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` } -// Generates a new invite link for a chat; the previously generated link is revoked. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right -func (client *Client) GenerateChatInviteLink(req *GenerateChatInviteLinkRequest) (*ChatInviteLink, error) { +// Replaces current primary invite link for a chat with a new primary invite link. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right +func (client *Client) ReplacePrimaryChatInviteLink(req *ReplacePrimaryChatInviteLinkRequest) (*ChatInviteLink, error) { result, err := client.Send(Request{ meta: meta{ - Type: "generateChatInviteLink", + Type: "replacePrimaryChatInviteLink", }, Data: map[string]interface{}{ "chat_id": req.ChatId, @@ -5809,8 +6657,305 @@ func (client *Client) GenerateChatInviteLink(req *GenerateChatInviteLinkRequest) return UnmarshalChatInviteLink(result.Data) } +type CreateChatInviteLinkRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Invite link name; 0-32 characters + Name string `json:"name"` + // Point in time (Unix timestamp) when the link will expire; pass 0 if never + ExpirationDate int32 `json:"expiration_date"` + // The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited + MemberLimit int32 `json:"member_limit"` + // True, if the link only creates join request. If true, member_limit must not be specified + CreatesJoinRequest bool `json:"creates_join_request"` +} + +// Creates a new invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat +func (client *Client) CreateChatInviteLink(req *CreateChatInviteLinkRequest) (*ChatInviteLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createChatInviteLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "name": req.Name, + "expiration_date": req.ExpirationDate, + "member_limit": req.MemberLimit, + "creates_join_request": req.CreatesJoinRequest, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatInviteLink(result.Data) +} + +type EditChatInviteLinkRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Invite link to be edited + InviteLink string `json:"invite_link"` + // Invite link name; 0-32 characters + Name string `json:"name"` + // Point in time (Unix timestamp) when the link will expire; pass 0 if never + ExpirationDate int32 `json:"expiration_date"` + // The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited + MemberLimit int32 `json:"member_limit"` + // True, if the link only creates join request. If true, member_limit must not be specified + CreatesJoinRequest bool `json:"creates_join_request"` +} + +// Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +func (client *Client) EditChatInviteLink(req *EditChatInviteLinkRequest) (*ChatInviteLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editChatInviteLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "invite_link": req.InviteLink, + "name": req.Name, + "expiration_date": req.ExpirationDate, + "member_limit": req.MemberLimit, + "creates_join_request": req.CreatesJoinRequest, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatInviteLink(result.Data) +} + +type GetChatInviteLinkRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Invite link to get + InviteLink string `json:"invite_link"` +} + +// Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links +func (client *Client) GetChatInviteLink(req *GetChatInviteLinkRequest) (*ChatInviteLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatInviteLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "invite_link": req.InviteLink, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatInviteLink(result.Data) +} + +type GetChatInviteLinkCountsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns list of chat administrators with number of their invite links. Requires owner privileges in the chat +func (client *Client) GetChatInviteLinkCounts(req *GetChatInviteLinkCountsRequest) (*ChatInviteLinkCounts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatInviteLinkCounts", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatInviteLinkCounts(result.Data) +} + +type GetChatInviteLinksRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // User identifier of a chat administrator. Must be an identifier of the current user for non-owner + CreatorUserId int64 `json:"creator_user_id"` + // Pass true if revoked links needs to be returned instead of active or expired + IsRevoked bool `json:"is_revoked"` + // Creation date of an invite link starting after which to return invite links; use 0 to get results from the beginning + OffsetDate int32 `json:"offset_date"` + // Invite link starting after which to return invite links; use empty string to get results from the beginning + OffsetInviteLink string `json:"offset_invite_link"` + // The maximum number of invite links to return; up to 100 + Limit int32 `json:"limit"` +} + +// Returns invite links for a chat created by specified administrator. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links +func (client *Client) GetChatInviteLinks(req *GetChatInviteLinksRequest) (*ChatInviteLinks, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatInviteLinks", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "creator_user_id": req.CreatorUserId, + "is_revoked": req.IsRevoked, + "offset_date": req.OffsetDate, + "offset_invite_link": req.OffsetInviteLink, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatInviteLinks(result.Data) +} + +type GetChatInviteLinkMembersRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Invite link for which to return chat members + InviteLink string `json:"invite_link"` + // A chat member from which to return next chat members; pass null to get results from the beginning + OffsetMember *ChatInviteLinkMember `json:"offset_member"` + // The maximum number of chat members to return; up to 100 + Limit int32 `json:"limit"` +} + +// Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +func (client *Client) GetChatInviteLinkMembers(req *GetChatInviteLinkMembersRequest) (*ChatInviteLinkMembers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatInviteLinkMembers", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "invite_link": req.InviteLink, + "offset_member": req.OffsetMember, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatInviteLinkMembers(result.Data) +} + +type RevokeChatInviteLinkRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Invite link to be revoked + InviteLink string `json:"invite_link"` +} + +// Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links. If a primary link is revoked, then additionally to the revoked link returns new primary link +func (client *Client) RevokeChatInviteLink(req *RevokeChatInviteLinkRequest) (*ChatInviteLinks, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "revokeChatInviteLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "invite_link": req.InviteLink, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatInviteLinks(result.Data) +} + +type DeleteRevokedChatInviteLinkRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Invite link to revoke + InviteLink string `json:"invite_link"` +} + +// Deletes revoked chat invite links. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +func (client *Client) DeleteRevokedChatInviteLink(req *DeleteRevokedChatInviteLinkRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteRevokedChatInviteLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "invite_link": req.InviteLink, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteAllRevokedChatInviteLinksRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // User identifier of a chat administrator, which links will be deleted. Must be an identifier of the current user for non-owner + CreatorUserId int64 `json:"creator_user_id"` +} + +// Deletes all revoked chat invite links created by a given chat administrator. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +func (client *Client) DeleteAllRevokedChatInviteLinks(req *DeleteAllRevokedChatInviteLinksRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteAllRevokedChatInviteLinks", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "creator_user_id": req.CreatorUserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CheckChatInviteLinkRequest struct { - // Invite link to be checked; should begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/" + // Invite link to be checked InviteLink string `json:"invite_link"` } @@ -5836,11 +6981,11 @@ func (client *Client) CheckChatInviteLink(req *CheckChatInviteLinkRequest) (*Cha } type JoinChatByInviteLinkRequest struct { - // Invite link to import; should begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/" + // Invite link to use InviteLink string `json:"invite_link"` } -// Uses an invite link to add the current user to the chat if possible. The new member will not be added until the chat state has been synchronized with the server +// Uses an invite link to add the current user to the chat if possible func (client *Client) JoinChatByInviteLink(req *JoinChatByInviteLinkRequest) (*Chat, error) { result, err := client.Send(Request{ meta: meta{ @@ -5861,10 +7006,112 @@ func (client *Client) JoinChatByInviteLink(req *JoinChatByInviteLinkRequest) (*C return UnmarshalChat(result.Data) } +type GetChatJoinRequestsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Invite link for which to return join requests. If empty, all join requests will be returned. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links + InviteLink string `json:"invite_link"` + // A query to search for in the first names, last names and usernames of the users to return + Query string `json:"query"` + // A chat join request from which to return next requests; pass null to get results from the beginning + OffsetRequest *ChatJoinRequest `json:"offset_request"` + // The maximum number of requests to join the chat to return + Limit int32 `json:"limit"` +} + +// Returns pending join requests in a chat +func (client *Client) GetChatJoinRequests(req *GetChatJoinRequestsRequest) (*ChatJoinRequests, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatJoinRequests", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "invite_link": req.InviteLink, + "query": req.Query, + "offset_request": req.OffsetRequest, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatJoinRequests(result.Data) +} + +type ProcessChatJoinRequestRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the user that sent the request + UserId int64 `json:"user_id"` + // True, if the request is approved. Otherwise the request is declived + Approve bool `json:"approve"` +} + +// Handles a pending join request in a chat +func (client *Client) ProcessChatJoinRequest(req *ProcessChatJoinRequestRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "processChatJoinRequest", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "user_id": req.UserId, + "approve": req.Approve, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ProcessChatJoinRequestsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links + InviteLink string `json:"invite_link"` + // True, if the requests are approved. Otherwise the requests are declived + Approve bool `json:"approve"` +} + +// Handles all pending join requests for a given link in a chat +func (client *Client) ProcessChatJoinRequests(req *ProcessChatJoinRequestsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "processChatJoinRequests", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "invite_link": req.InviteLink, + "approve": req.Approve, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CreateCallRequest struct { // Identifier of the user to be called - UserId int32 `json:"user_id"` - // Description of the call protocols supported by the application + UserId int64 `json:"user_id"` + // The call protocols supported by the application Protocol *CallProtocol `json:"protocol"` // True, if a video call needs to be created IsVideo bool `json:"is_video"` @@ -5896,7 +7143,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 application + // The call protocols supported by the application Protocol *CallProtocol `json:"protocol"` } @@ -6053,9 +7300,816 @@ func (client *Client) SendCallDebugInformation(req *SendCallDebugInformationRequ return UnmarshalOk(result.Data) } +type GetVideoChatAvailableParticipantsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined +func (client *Client) GetVideoChatAvailableParticipants(req *GetVideoChatAvailableParticipantsRequest) (*MessageSenders, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getVideoChatAvailableParticipants", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageSenders(result.Data) +} + +type SetVideoChatDefaultParticipantRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Default group call participant identifier to join the video chats + DefaultParticipantId MessageSender `json:"default_participant_id"` +} + +// Changes default participant identifier, on whose behalf a video chat in the chat will be joined +func (client *Client) SetVideoChatDefaultParticipant(req *SetVideoChatDefaultParticipantRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setVideoChatDefaultParticipant", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "default_participant_id": req.DefaultParticipantId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CreateVideoChatRequest struct { + // Chat identifier, in which the video chat will be created + ChatId int64 `json:"chat_id"` + // Group call title; if empty, chat title will be used + Title string `json:"title"` + // Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future + StartDate int32 `json:"start_date"` +} + +// Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights +func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createVideoChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "title": req.Title, + "start_date": req.StartDate, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGroupCallId(result.Data) +} + +type GetGroupCallRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Returns information about a group call +func (client *Client) GetGroupCall(req *GetGroupCallRequest) (*GroupCall, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGroupCall", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGroupCall(result.Data) +} + +type StartScheduledGroupCallRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Starts a scheduled group call +func (client *Client) StartScheduledGroupCall(req *StartScheduledGroupCallRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "startScheduledGroupCall", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleGroupCallEnabledStartNotificationRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // New value of the enabled_start_notification setting + EnabledStartNotification bool `json:"enabled_start_notification"` +} + +// Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only +func (client *Client) ToggleGroupCallEnabledStartNotification(req *ToggleGroupCallEnabledStartNotificationRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleGroupCallEnabledStartNotification", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "enabled_start_notification": req.EnabledStartNotification, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type JoinGroupCallRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Identifier of a group call participant, which will be used to join the call; pass null to join as self; video chats only + ParticipantId MessageSender `json:"participant_id"` + // Caller audio channel synchronization source identifier; received from tgcalls + AudioSourceId int32 `json:"audio_source_id"` + // Group call join payload; received from tgcalls + Payload string `json:"payload"` + // True, if the user's microphone is muted + IsMuted bool `json:"is_muted"` + // True, if the user's video is enabled + IsMyVideoEnabled bool `json:"is_my_video_enabled"` + // If non-empty, invite hash to be used to join the group call without being muted by administrators + InviteHash string `json:"invite_hash"` +} + +// Joins an active group call. Returns join response payload for tgcalls +func (client *Client) JoinGroupCall(req *JoinGroupCallRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "joinGroupCall", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "participant_id": req.ParticipantId, + "audio_source_id": req.AudioSourceId, + "payload": req.Payload, + "is_muted": req.IsMuted, + "is_my_video_enabled": req.IsMyVideoEnabled, + "invite_hash": req.InviteHash, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type StartGroupCallScreenSharingRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Screen sharing audio channel synchronization source identifier; received from tgcalls + AudioSourceId int32 `json:"audio_source_id"` + // Group call join payload; received from tgcalls + Payload string `json:"payload"` +} + +// Starts screen sharing in a joined group call. Returns join response payload for tgcalls +func (client *Client) StartGroupCallScreenSharing(req *StartGroupCallScreenSharingRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "startGroupCallScreenSharing", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "audio_source_id": req.AudioSourceId, + "payload": req.Payload, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type ToggleGroupCallScreenSharingIsPausedRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // True if screen sharing is paused + IsPaused bool `json:"is_paused"` +} + +// Pauses or unpauses screen sharing in a joined group call +func (client *Client) ToggleGroupCallScreenSharingIsPaused(req *ToggleGroupCallScreenSharingIsPausedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleGroupCallScreenSharingIsPaused", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "is_paused": req.IsPaused, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type EndGroupCallScreenSharingRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Ends screen sharing in a joined group call +func (client *Client) EndGroupCallScreenSharing(req *EndGroupCallScreenSharingRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "endGroupCallScreenSharing", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetGroupCallTitleRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // New group call title; 1-64 characters + Title string `json:"title"` +} + +// Sets group call title. Requires groupCall.can_be_managed group call flag +func (client *Client) SetGroupCallTitle(req *SetGroupCallTitleRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setGroupCallTitle", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "title": req.Title, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleGroupCallMuteNewParticipantsRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // New value of the mute_new_participants setting + MuteNewParticipants bool `json:"mute_new_participants"` +} + +// Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires groupCall.can_toggle_mute_new_participants group call flag +func (client *Client) ToggleGroupCallMuteNewParticipants(req *ToggleGroupCallMuteNewParticipantsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleGroupCallMuteNewParticipants", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "mute_new_participants": req.MuteNewParticipants, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type InviteGroupCallParticipantsRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // User identifiers. At most 10 users can be invited simultaneously + UserIds []int64 `json:"user_ids"` +} + +// Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats +func (client *Client) InviteGroupCallParticipants(req *InviteGroupCallParticipantsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "inviteGroupCallParticipants", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "user_ids": req.UserIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetGroupCallInviteLinkRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Pass true if the invite link needs to contain an invite hash, passing which to joinGroupCall would allow the invited user to unmute themselves. Requires groupCall.can_be_managed group call flag + CanSelfUnmute bool `json:"can_self_unmute"` +} + +// Returns invite link to a video chat in a public chat +func (client *Client) GetGroupCallInviteLink(req *GetGroupCallInviteLinkRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGroupCallInviteLink", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "can_self_unmute": req.CanSelfUnmute, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + +type RevokeGroupCallInviteLinkRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag +func (client *Client) RevokeGroupCallInviteLink(req *RevokeGroupCallInviteLinkRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "revokeGroupCallInviteLink", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type StartGroupCallRecordingRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Group call recording title; 0-64 characters + Title string `json:"title"` + // Pass true to record a video file instead of an audio file + RecordVideo bool `json:"record_video"` + // Pass true to use portrait orientation for video instead of landscape one + UsePortraitOrientation bool `json:"use_portrait_orientation"` +} + +// Starts recording of an active group call. Requires groupCall.can_be_managed group call flag +func (client *Client) StartGroupCallRecording(req *StartGroupCallRecordingRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "startGroupCallRecording", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "title": req.Title, + "record_video": req.RecordVideo, + "use_portrait_orientation": req.UsePortraitOrientation, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type EndGroupCallRecordingRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Ends recording of an active group call. Requires groupCall.can_be_managed group call flag +func (client *Client) EndGroupCallRecording(req *EndGroupCallRecordingRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "endGroupCallRecording", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleGroupCallIsMyVideoPausedRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Pass true if the current user's video is paused + IsMyVideoPaused bool `json:"is_my_video_paused"` +} + +// Toggles whether current user's video is paused +func (client *Client) ToggleGroupCallIsMyVideoPaused(req *ToggleGroupCallIsMyVideoPausedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleGroupCallIsMyVideoPaused", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "is_my_video_paused": req.IsMyVideoPaused, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleGroupCallIsMyVideoEnabledRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Pass true if the current user's video is enabled + IsMyVideoEnabled bool `json:"is_my_video_enabled"` +} + +// Toggles whether current user's video is enabled +func (client *Client) ToggleGroupCallIsMyVideoEnabled(req *ToggleGroupCallIsMyVideoEnabledRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleGroupCallIsMyVideoEnabled", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "is_my_video_enabled": req.IsMyVideoEnabled, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetGroupCallParticipantIsSpeakingRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Group call participant's synchronization audio source identifier, or 0 for the current user + AudioSource int32 `json:"audio_source"` + // True, if the user is speaking + IsSpeaking bool `json:"is_speaking"` +} + +// Informs TDLib that speaking state of a participant of an active group has changed +func (client *Client) SetGroupCallParticipantIsSpeaking(req *SetGroupCallParticipantIsSpeakingRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setGroupCallParticipantIsSpeaking", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "audio_source": req.AudioSource, + "is_speaking": req.IsSpeaking, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleGroupCallParticipantIsMutedRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Participant identifier + ParticipantId MessageSender `json:"participant_id"` + // Pass true if the user must be muted and false otherwise + IsMuted bool `json:"is_muted"` +} + +// Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves +func (client *Client) ToggleGroupCallParticipantIsMuted(req *ToggleGroupCallParticipantIsMutedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleGroupCallParticipantIsMuted", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "participant_id": req.ParticipantId, + "is_muted": req.IsMuted, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetGroupCallParticipantVolumeLevelRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Participant identifier + ParticipantId MessageSender `json:"participant_id"` + // New participant's volume level; 1-20000 in hundreds of percents + VolumeLevel int32 `json:"volume_level"` +} + +// Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level +func (client *Client) SetGroupCallParticipantVolumeLevel(req *SetGroupCallParticipantVolumeLevelRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setGroupCallParticipantVolumeLevel", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "participant_id": req.ParticipantId, + "volume_level": req.VolumeLevel, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleGroupCallParticipantIsHandRaisedRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Participant identifier + ParticipantId MessageSender `json:"participant_id"` + // Pass true if the user's hand needs to be raised. Only self hand can be raised. Requires groupCall.can_be_managed group call flag to lower other's hand + IsHandRaised bool `json:"is_hand_raised"` +} + +// Toggles whether a group call participant hand is rased +func (client *Client) ToggleGroupCallParticipantIsHandRaised(req *ToggleGroupCallParticipantIsHandRaisedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleGroupCallParticipantIsHandRaised", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "participant_id": req.ParticipantId, + "is_hand_raised": req.IsHandRaised, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type LoadGroupCallParticipantsRequest struct { + // Group call identifier. The group call must be previously received through getGroupCall and must be joined or being joined + GroupCallId int32 `json:"group_call_id"` + // The maximum number of participants to load; up to 100 + Limit int32 `json:"limit"` +} + +// Loads more participants of a group call. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded +func (client *Client) LoadGroupCallParticipants(req *LoadGroupCallParticipantsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadGroupCallParticipants", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type LeaveGroupCallRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Leaves a group call +func (client *Client) LeaveGroupCall(req *LeaveGroupCallRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "leaveGroupCall", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type EndGroupCallRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Ends a group call. Requires groupCall.can_be_managed +func (client *Client) EndGroupCall(req *EndGroupCallRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "endGroupCall", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetGroupCallStreamSegmentRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Point in time when the stream segment begins; Unix timestamp in milliseconds + TimeOffset int64 `json:"time_offset"` + // Segment duration scale; 0-1. Segment's duration is 1000/(2**scale) milliseconds + Scale int32 `json:"scale"` + // Identifier of an audio/video channel to get as received from tgcalls + ChannelId int32 `json:"channel_id"` + // Video quality as received from tgcalls; pass null to get the worst available quality + VideoQuality GroupCallVideoQuality `json:"video_quality"` +} + +// Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video +func (client *Client) GetGroupCallStreamSegment(req *GetGroupCallStreamSegmentRequest) (*FilePart, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGroupCallStreamSegment", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "time_offset": req.TimeOffset, + "scale": req.Scale, + "channel_id": req.ChannelId, + "video_quality": req.VideoQuality, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFilePart(result.Data) +} + type ToggleMessageSenderIsBlockedRequest struct { - // Message Sender - Sender MessageSender `json:"sender"` + // Identifier of a message sender to block/unblock + SenderId MessageSender `json:"sender_id"` // New value of is_blocked IsBlocked bool `json:"is_blocked"` } @@ -6067,7 +8121,7 @@ func (client *Client) ToggleMessageSenderIsBlocked(req *ToggleMessageSenderIsBlo Type: "toggleMessageSenderIsBlocked", }, Data: map[string]interface{}{ - "sender": req.Sender, + "sender_id": req.SenderId, "is_blocked": req.IsBlocked, }, }) @@ -6149,7 +8203,7 @@ func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequ type AddContactRequest struct { // The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored Contact *Contact `json:"contact"` - // True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field UserFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number + // True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number SharePhoneNumber bool `json:"share_phone_number"` } @@ -6251,7 +8305,7 @@ func (client *Client) SearchContacts(req *SearchContactsRequest) (*Users, error) type RemoveContactsRequest struct { // Identifiers of users to be deleted - UserIds []int32 `json:"user_ids"` + UserIds []int64 `json:"user_ids"` } // Removes users from the contact list @@ -6299,7 +8353,7 @@ type ChangeImportedContactsRequest struct { Contacts []*Contact `json:"contacts"` } -// Changes imported contacts using the list of current user contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. Query result depends on the result of the previous query, so only one query is possible at the same time +// Changes imported contacts using the list of contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. Query result depends on the result of the previous query, so only one query is possible at the same time func (client *Client) ChangeImportedContacts(req *ChangeImportedContactsRequest) (*ImportedContacts, error) { result, err := client.Send(Request{ meta: meta{ @@ -6341,7 +8395,7 @@ func (client *Client) ClearImportedContacts() (*Ok, error) { type SharePhoneNumberRequest struct { // Identifier of the user with whom to share the phone number. The user must be a mutual contact - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } // Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber @@ -6367,7 +8421,7 @@ func (client *Client) SharePhoneNumber(req *SharePhoneNumberRequest) (*Ok, error type GetUserProfilePhotosRequest struct { // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // The number of photos to skip; must be non-negative Offset int32 `json:"offset"` // The maximum number of photos to be returned; up to 100 @@ -6404,7 +8458,7 @@ type GetStickersRequest struct { Limit int32 `json:"limit"` } -// Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is not empty, favorite and recently used stickers may also be returned +// Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, favorite and recently used stickers may also be returned func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ @@ -6486,7 +8540,7 @@ type GetArchivedStickerSetsRequest struct { IsMasks bool `json:"is_masks"` // Identifier of the sticker set from which to return the result OffsetStickerSetId JsonInt64 `json:"offset_sticker_set_id"` - // The maximum number of sticker sets to return + // The maximum number of sticker sets to return; up to 100 Limit int32 `json:"limit"` } @@ -6516,11 +8570,11 @@ func (client *Client) GetArchivedStickerSets(req *GetArchivedStickerSetsRequest) 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 + // The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached 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 +// Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib func (client *Client) GetTrendingStickerSets(req *GetTrendingStickerSetsRequest) (*StickerSets, error) { result, err := client.Send(Request{ meta: meta{ @@ -6547,7 +8601,7 @@ type GetAttachedStickerSetsRequest struct { FileId int32 `json:"file_id"` } -// Returns a list of sticker sets attached to a file. Currently only photos and videos can have attached sticker sets +// Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets func (client *Client) GetAttachedStickerSets(req *GetAttachedStickerSetsRequest) (*StickerSets, error) { result, err := client.Send(Request{ meta: meta{ @@ -7004,6 +9058,32 @@ func (client *Client) SearchEmojis(req *SearchEmojisRequest) (*Emojis, error) { return UnmarshalEmojis(result.Data) } +type GetAnimatedEmojiRequest struct { + // The emoji + Emoji string `json:"emoji"` +} + +// Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji +func (client *Client) GetAnimatedEmoji(req *GetAnimatedEmojiRequest) (*AnimatedEmoji, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAnimatedEmoji", + }, + Data: map[string]interface{}{ + "emoji": req.Emoji, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAnimatedEmoji(result.Data) +} + type GetEmojiSuggestionsUrlRequest struct { // Language code for which the emoji replacements will be suggested LanguageCode string `json:"language_code"` @@ -7050,7 +9130,7 @@ func (client *Client) GetSavedAnimations() (*Animations, error) { } type AddSavedAnimationRequest struct { - // The animation file to be added. Only animations known to the server (i.e. successfully sent via a message) can be added to the list + // The animation file to be added. Only animations known to the server (i.e., successfully sent via a message) can be added to the list Animation InputFile `json:"animation"` } @@ -7283,9 +9363,9 @@ func (client *Client) DeleteProfilePhoto(req *DeleteProfilePhotoRequest) (*Ok, e } type SetNameRequest struct { - // The new value of the first name for the user; 1-64 characters + // The new value of the first name for the current user; 1-64 characters FirstName string `json:"first_name"` - // The new value of the optional last name for the user; 0-64 characters + // The new value of the optional last name for the current user; 0-64 characters LastName string `json:"last_name"` } @@ -7392,7 +9472,7 @@ func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) { type ChangePhoneNumberRequest struct { // The new phone number of the user in international format PhoneNumber string `json:"phone_number"` - // Settings for the authentication of the user's phone number + // Settings for the authentication of the user's phone number; pass null to use default settings Settings *PhoneNumberAuthenticationSettings `json:"settings"` } @@ -7418,7 +9498,7 @@ func (client *Client) ChangePhoneNumber(req *ChangePhoneNumberRequest) (*Authent return UnmarshalAuthenticationCodeInfo(result.Data) } -// Re-sends the authentication code sent to confirm a new phone number for the user. Works only if the previously received authenticationCodeInfo next_code_type was not null +// Re-sends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed func (client *Client) ResendChangePhoneNumberCode() (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -7438,7 +9518,7 @@ func (client *Client) ResendChangePhoneNumberCode() (*AuthenticationCodeInfo, er } type CheckChangePhoneNumberCodeRequest struct { - // Verification code received by SMS, phone call or flash call + // Authentication code to check Code string `json:"code"` } @@ -7464,18 +9544,24 @@ func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCode } type SetCommandsRequest struct { + // The scope to which the commands are relevant; pass null to change commands in the default bot command scope + Scope BotCommandScope `json:"scope"` + // A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands + LanguageCode string `json:"language_code"` // List of the bot's commands Commands []*BotCommand `json:"commands"` } -// Sets the list of commands supported by the bot; for bots only +// Sets the list of commands supported by the bot for the given user scope and language; 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, + "scope": req.Scope, + "language_code": req.LanguageCode, + "commands": req.Commands, }, }) if err != nil { @@ -7489,6 +9575,64 @@ func (client *Client) SetCommands(req *SetCommandsRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type DeleteCommandsRequest struct { + // The scope to which the commands are relevant; pass null to delete commands in the default bot command scope + Scope BotCommandScope `json:"scope"` + // A two-letter ISO 639-1 country code or an empty string + LanguageCode string `json:"language_code"` +} + +// Deletes commands supported by the bot for the given user scope and language; for bots only +func (client *Client) DeleteCommands(req *DeleteCommandsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteCommands", + }, + Data: map[string]interface{}{ + "scope": req.Scope, + "language_code": req.LanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetCommandsRequest struct { + // The scope to which the commands are relevant; pass null to get commands in the default bot command scope + Scope BotCommandScope `json:"scope"` + // A two-letter ISO 639-1 country code or an empty string + LanguageCode string `json:"language_code"` +} + +// Returns the list of commands supported by the bot for the given user scope and language; for bots only +func (client *Client) GetCommands(req *GetCommandsRequest) (*BotCommands, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCommands", + }, + Data: map[string]interface{}{ + "scope": req.Scope, + "language_code": req.LanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBotCommands(result.Data) +} + // Returns all active sessions of the current user func (client *Client) GetActiveSessions() (*Sessions, error) { result, err := client.Send(Request{ @@ -7553,6 +9697,90 @@ func (client *Client) TerminateAllOtherSessions() (*Ok, error) { return UnmarshalOk(result.Data) } +type ToggleSessionCanAcceptCallsRequest struct { + // Session identifier + SessionId JsonInt64 `json:"session_id"` + // True, if incoming calls can be accepted by the session + CanAcceptCalls bool `json:"can_accept_calls"` +} + +// Toggles whether a session can accept incoming calls +func (client *Client) ToggleSessionCanAcceptCalls(req *ToggleSessionCanAcceptCallsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSessionCanAcceptCalls", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + "can_accept_calls": req.CanAcceptCalls, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleSessionCanAcceptSecretChatsRequest struct { + // Session identifier + SessionId JsonInt64 `json:"session_id"` + // True, if incoming secret chats can be accepted by the session + CanAcceptSecretChats bool `json:"can_accept_secret_chats"` +} + +// Toggles whether a session can accept incoming secret chats +func (client *Client) ToggleSessionCanAcceptSecretChats(req *ToggleSessionCanAcceptSecretChatsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSessionCanAcceptSecretChats", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + "can_accept_secret_chats": req.CanAcceptSecretChats, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetInactiveSessionTtlRequest struct { + // New number of days of inactivity before sessions will be automatically terminated; 1-366 days + InactiveSessionTtlDays int32 `json:"inactive_session_ttl_days"` +} + +// Changes the period of inactivity after which sessions will automatically be terminated +func (client *Client) SetInactiveSessionTtl(req *SetInactiveSessionTtlRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setInactiveSessionTtl", + }, + Data: map[string]interface{}{ + "inactive_session_ttl_days": req.InactiveSessionTtlDays, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + // Returns all website where the current user used Telegram to log in func (client *Client) GetConnectedWebsites() (*ConnectedWebsites, error) { result, err := client.Send(Request{ @@ -7619,7 +9847,7 @@ func (client *Client) DisconnectAllWebsites() (*Ok, error) { type SetSupergroupUsernameRequest struct { // Identifier of the supergroup or channel - SupergroupId int32 `json:"supergroup_id"` + SupergroupId int64 `json:"supergroup_id"` // New value of the username. Use an empty string to remove the username Username string `json:"username"` } @@ -7648,12 +9876,12 @@ func (client *Client) SetSupergroupUsername(req *SetSupergroupUsernameRequest) ( type SetSupergroupStickerSetRequest struct { // Identifier of the supergroup - SupergroupId int32 `json:"supergroup_id"` + SupergroupId int64 `json:"supergroup_id"` // New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set StickerSetId JsonInt64 `json:"sticker_set_id"` } -// Changes the sticker set of a supergroup; requires can_change_info rights +// Changes the sticker set of a supergroup; requires can_change_info administrator right func (client *Client) SetSupergroupStickerSet(req *SetSupergroupStickerSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7677,12 +9905,12 @@ func (client *Client) SetSupergroupStickerSet(req *SetSupergroupStickerSetReques type ToggleSupergroupSignMessagesRequest struct { // Identifier of the channel - SupergroupId int32 `json:"supergroup_id"` + SupergroupId int64 `json:"supergroup_id"` // New value of sign_messages SignMessages bool `json:"sign_messages"` } -// Toggles sender signatures messages sent in a channel; requires can_change_info rights +// Toggles whether sender signature is added to sent messages in a channel; requires can_change_info administrator right func (client *Client) ToggleSupergroupSignMessages(req *ToggleSupergroupSignMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7706,12 +9934,12 @@ func (client *Client) ToggleSupergroupSignMessages(req *ToggleSupergroupSignMess type ToggleSupergroupIsAllHistoryAvailableRequest struct { // The identifier of the supergroup - SupergroupId int32 `json:"supergroup_id"` + SupergroupId int64 `json:"supergroup_id"` // The new value of is_all_history_available IsAllHistoryAvailable bool `json:"is_all_history_available"` } -// Toggles whether the message history of a supergroup is available to new members; requires can_change_info rights +// Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right func (client *Client) ToggleSupergroupIsAllHistoryAvailable(req *ToggleSupergroupIsAllHistoryAvailableRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7733,16 +9961,40 @@ func (client *Client) ToggleSupergroupIsAllHistoryAvailable(req *ToggleSupergrou return UnmarshalOk(result.Data) } +type ToggleSupergroupIsBroadcastGroupRequest struct { + // Identifier of the supergroup + SupergroupId int64 `json:"supergroup_id"` +} + +// Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup +func (client *Client) ToggleSupergroupIsBroadcastGroup(req *ToggleSupergroupIsBroadcastGroupRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupIsBroadcastGroup", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ReportSupergroupSpamRequest struct { // Supergroup identifier - SupergroupId int32 `json:"supergroup_id"` - // User identifier - UserId int32 `json:"user_id"` - // Identifiers of messages sent in the supergroup by the user. This list must be non-empty + SupergroupId int64 `json:"supergroup_id"` + // Identifiers of messages to report MessageIds []int64 `json:"message_ids"` } -// Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup +// Reports messages in a supergroup as spam; requires administrator rights in the supergroup func (client *Client) ReportSupergroupSpam(req *ReportSupergroupSpamRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7750,7 +10002,6 @@ func (client *Client) ReportSupergroupSpam(req *ReportSupergroupSpamRequest) (*O }, Data: map[string]interface{}{ "supergroup_id": req.SupergroupId, - "user_id": req.UserId, "message_ids": req.MessageIds, }, }) @@ -7767,8 +10018,8 @@ 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, supergroupMembersFilterRecent + SupergroupId int64 `json:"supergroup_id"` + // The type of users to return; pass null to use supergroupMembersFilterRecent Filter SupergroupMembersFilter `json:"filter"` // Number of users to skip Offset int32 `json:"offset"` @@ -7776,7 +10027,7 @@ type GetSupergroupMembersRequest struct { Limit int32 `json:"limit"` } -// 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 +// 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 func (client *Client) GetSupergroupMembers(req *GetSupergroupMembersRequest) (*ChatMembers, error) { result, err := client.Send(Request{ meta: meta{ @@ -7800,32 +10051,6 @@ func (client *Client) GetSupergroupMembers(req *GetSupergroupMembersRequest) (*C return UnmarshalChatMembers(result.Data) } -type DeleteSupergroupRequest struct { - // Identifier of the supergroup or channel - SupergroupId int32 `json:"supergroup_id"` -} - -// 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 -func (client *Client) DeleteSupergroup(req *DeleteSupergroupRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "deleteSupergroup", - }, - Data: map[string]interface{}{ - "supergroup_id": req.SupergroupId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type CloseSecretChatRequest struct { // Secret chat identifier SecretChatId int32 `json:"secret_chat_id"` @@ -7861,10 +10086,10 @@ type GetChatEventLogRequest struct { FromEventId JsonInt64 `json:"from_event_id"` // The maximum number of events to return; up to 100 Limit int32 `json:"limit"` - // The types of events to return. By default, all types will be returned + // The types of events to return; pass null to get chat events of all types Filters *ChatEventLogFilters `json:"filters"` // User identifiers by which to filter events. By default, events relating to all users will be returned - UserIds []int32 `json:"user_ids"` + UserIds []int64 `json:"user_ids"` } // Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id) @@ -7898,9 +10123,11 @@ type GetPaymentFormRequest struct { ChatId int64 `json:"chat_id"` // Message identifier MessageId int64 `json:"message_id"` + // Preferred payment form theme; pass null to use the default theme + Theme *PaymentFormTheme `json:"theme"` } -// Returns an invoice payment form. This method should be called when the user presses inlineKeyboardButtonBuy +// Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy func (client *Client) GetPaymentForm(req *GetPaymentFormRequest) (*PaymentForm, error) { result, err := client.Send(Request{ meta: meta{ @@ -7909,6 +10136,7 @@ func (client *Client) GetPaymentForm(req *GetPaymentFormRequest) (*PaymentForm, Data: map[string]interface{}{ "chat_id": req.ChatId, "message_id": req.MessageId, + "theme": req.Theme, }, }) if err != nil { @@ -7927,7 +10155,7 @@ type ValidateOrderInfoRequest struct { ChatId int64 `json:"chat_id"` // Message identifier MessageId int64 `json:"message_id"` - // The order information, provided by the user + // The order information, provided by the user; pass null if empty OrderInfo *OrderInfo `json:"order_info"` // True, if the order information can be saved AllowSave bool `json:"allow_save"` @@ -7962,12 +10190,16 @@ type SendPaymentFormRequest struct { ChatId int64 `json:"chat_id"` // Message identifier MessageId int64 `json:"message_id"` - // Identifier returned by ValidateOrderInfo, or an empty string + // Payment form identifier returned by getPaymentForm + PaymentFormId JsonInt64 `json:"payment_form_id"` + // Identifier returned by validateOrderInfo, or an empty string OrderInfoId string `json:"order_info_id"` // Identifier of a chosen shipping option, if applicable ShippingOptionId string `json:"shipping_option_id"` // The credentials chosen by user for payment Credentials InputCredentials `json:"credentials"` + // Chosen by the user amount of tip in the smallest units of the currency + TipAmount int64 `json:"tip_amount"` } // Sends a filled-out payment form to the bot for final verification @@ -7979,9 +10211,11 @@ func (client *Client) SendPaymentForm(req *SendPaymentFormRequest) (*PaymentResu Data: map[string]interface{}{ "chat_id": req.ChatId, "message_id": req.MessageId, + "payment_form_id": req.PaymentFormId, "order_info_id": req.OrderInfoId, "shipping_option_id": req.ShippingOptionId, "credentials": req.Credentials, + "tip_amount": req.TipAmount, }, }) if err != nil { @@ -8182,9 +10416,9 @@ func (client *Client) SearchBackground(req *SearchBackgroundRequest) (*Backgroun } type SetBackgroundRequest struct { - // The input background to use, null for filled backgrounds + // The input background to use; pass null to create a new filled backgrounds or to remove the current background Background InputBackground `json:"background"` - // Background type; null for default background. The method will return error 404 if type is null + // Background type; pass null to use the default type of the remote background or to remove the current background Type BackgroundType `json:"type"` // True, if the background is chosen for dark theme ForDarkTheme bool `json:"for_dark_theme"` @@ -8344,7 +10578,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 shouldn't 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 doesn't need to 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{ @@ -8505,7 +10739,7 @@ type RegisterDeviceRequest struct { // Device token DeviceToken DeviceToken `json:"device_token"` // List of user identifiers of other users currently using the application - OtherUserIds []int32 `json:"other_user_ids"` + OtherUserIds []int64 `json:"other_user_ids"` } // Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription @@ -8707,7 +10941,7 @@ func (client *Client) GetOption(req *GetOptionRequest) (OptionValue, error) { type SetOptionRequest struct { // The name of the option Name string `json:"name"` - // The new value of the option + // The new value of the option; pass null to reset option value to a default value Value OptionValue `json:"value"` } @@ -8833,13 +11067,15 @@ func (client *Client) RemoveChatActionBar(req *RemoveChatActionBarRequest) (*Ok, type ReportChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // The reason for reporting the chat - Reason ChatReportReason `json:"reason"` // Identifiers of reported messages, if any MessageIds []int64 `json:"message_ids"` + // The reason for reporting the chat + Reason ChatReportReason `json:"reason"` + // Additional report details; 0-1024 characters + Text string `json:"text"` } -// Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if this is a private 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 +// Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported func (client *Client) ReportChat(req *ReportChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -8847,8 +11083,9 @@ func (client *Client) ReportChat(req *ReportChatRequest) (*Ok, error) { }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "reason": req.Reason, "message_ids": req.MessageIds, + "reason": req.Reason, + "text": req.Text, }, }) if err != nil { @@ -8862,25 +11099,28 @@ func (client *Client) ReportChat(req *ReportChatRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GetChatStatisticsUrlRequest struct { +type ReportChatPhotoRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Parameters from "tg://statsrefresh?params=******" link - Parameters string `json:"parameters"` - // Pass true if a URL with the dark theme must be returned - IsDark bool `json:"is_dark"` + // Identifier of the photo to report. Only full photos from chatPhoto can be reported + FileId int32 `json:"file_id"` + // The reason for reporting the chat photo + Reason ChatReportReason `json:"reason"` + // Additional report details; 0-1024 characters + Text string `json:"text"` } -// 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) { +// Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported +func (client *Client) ReportChatPhoto(req *ReportChatPhotoRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getChatStatisticsUrl", + Type: "reportChatPhoto", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "parameters": req.Parameters, - "is_dark": req.IsDark, + "chat_id": req.ChatId, + "file_id": req.FileId, + "reason": req.Reason, + "text": req.Text, }, }) if err != nil { @@ -8891,7 +11131,7 @@ func (client *Client) GetChatStatisticsUrl(req *GetChatStatisticsUrlRequest) (*H return nil, buildResponseError(result.Data) } - return UnmarshalHttpUrl(result.Data) + return UnmarshalOk(result.Data) } type GetChatStatisticsRequest struct { @@ -8901,7 +11141,7 @@ type GetChatStatisticsRequest struct { IsDark bool `json:"is_dark"` } -// Returns detailed statistics about a chat. Currently this method can be used only for supergroups and channels. Can be used only if SupergroupFullInfo.can_get_statistics == true +// Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true func (client *Client) GetChatStatistics(req *GetChatStatisticsRequest) (ChatStatistics, error) { result, err := client.Send(Request{ meta: meta{ @@ -8941,7 +11181,7 @@ type GetMessageStatisticsRequest struct { IsDark bool `json:"is_dark"` } -// Returns detailed statistics about a message. Can be used only if Message.can_get_statistics == true +// 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{ @@ -9009,7 +11249,7 @@ func (client *Client) GetStatisticalGraph(req *GetStatisticalGraphRequest) (Stat } 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 + // The maximum number of chats with the largest storage usage for which separate statistics need to 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"` } @@ -9073,7 +11313,7 @@ func (client *Client) GetDatabaseStatistics() (*DatabaseStatistics, error) { } type OptimizeStorageRequest struct { - // Limit on the total size of files after deletion. Pass -1 to use the default limit + // Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit Size int64 `json:"size"` // Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit Ttl int32 `json:"ttl"` @@ -9081,11 +11321,11 @@ type OptimizeStorageRequest struct { Count int32 `json:"count"` // The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value ImmunityDelay int32 `json:"immunity_delay"` - // 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 + // If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted FileTypes []FileType `json:"file_types"` - // 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) + // If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos) 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) + // If non-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"` @@ -9123,11 +11363,11 @@ func (client *Client) OptimizeStorage(req *OptimizeStorageRequest) (*StorageStat } type SetNetworkTypeRequest struct { - // The new network type. By default, networkTypeOther + // The new network type; pass null to set network type to networkTypeOther Type NetworkType `json:"type"` } -// 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. Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics +// 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 must be called whenever the network is changed, even if the network type remains the same. Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics func (client *Client) SetNetworkType(req *SetNetworkTypeRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9241,7 +11481,7 @@ func (client *Client) GetAutoDownloadSettingsPresets() (*AutoDownloadSettingsPre type SetAutoDownloadSettingsRequest struct { // New user auto-download settings Settings *AutoDownloadSettings `json:"settings"` - // Type of the network for which the new settings are applied + // Type of the network for which the new settings are relevant Type NetworkType `json:"type"` } @@ -9489,7 +11729,7 @@ func (client *Client) DeletePassportElement(req *DeletePassportElementRequest) ( type SetPassportElementErrorsRequest struct { // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // The errors Errors []*InputPassportElementError `json:"errors"` } @@ -9521,7 +11761,7 @@ type GetPreferredCountryLanguageRequest struct { CountryCode string `json:"country_code"` } -// Returns an IETF language tag of the language preferred in the country, which should be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown +// Returns an IETF language tag of the language preferred in the country, which must be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown func (client *Client) GetPreferredCountryLanguage(req *GetPreferredCountryLanguageRequest) (*Text, error) { result, err := client.Send(Request{ meta: meta{ @@ -9545,7 +11785,7 @@ func (client *Client) GetPreferredCountryLanguage(req *GetPreferredCountryLangua type SendPhoneNumberVerificationCodeRequest struct { // The phone number of the user, in international format PhoneNumber string `json:"phone_number"` - // Settings for the authentication of the user's phone number + // Settings for the authentication of the user's phone number; pass null to use default settings Settings *PhoneNumberAuthenticationSettings `json:"settings"` } @@ -9591,7 +11831,7 @@ func (client *Client) ResendPhoneNumberVerificationCode() (*AuthenticationCodeIn } type CheckPhoneNumberVerificationCodeRequest struct { - // Verification code + // Verification code to check Code string `json:"code"` } @@ -9662,7 +11902,7 @@ func (client *Client) ResendEmailAddressVerificationCode() (*EmailAddressAuthent } type CheckEmailAddressVerificationCodeRequest struct { - // Verification code + // Verification code to check Code string `json:"code"` } @@ -9689,12 +11929,12 @@ func (client *Client) CheckEmailAddressVerificationCode(req *CheckEmailAddressVe type GetPassportAuthorizationFormRequest struct { // User identifier of the service's bot - BotUserId int32 `json:"bot_user_id"` + BotUserId int64 `json:"bot_user_id"` // Telegram Passport element types requested by the service Scope string `json:"scope"` - // Service's public_key + // Service's public key PublicKey string `json:"public_key"` - // Authorization form nonce provided by the service + // Unique request identifier provided by the service Nonce string `json:"nonce"` } @@ -9781,15 +12021,15 @@ func (client *Client) SendPassportAuthorizationForm(req *SendPassportAuthorizati } type SendPhoneNumberConfirmationCodeRequest struct { - // Value of the "hash" parameter from the link + // Hash value from the link Hash string `json:"hash"` - // Value of the "phone" parameter from the link + // Phone number value from the link PhoneNumber string `json:"phone_number"` - // Settings for the authentication of the user's phone number + // Settings for the authentication of the user's phone number; pass null to use default settings Settings *PhoneNumberAuthenticationSettings `json:"settings"` } -// Sends phone number confirmation code. Should be called when user presses "https://t.me/confirmphone?phone=*******&hash=**********" or "tg://confirmphone?phone=*******&hash=**********" link +// Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation func (client *Client) SendPhoneNumberConfirmationCode(req *SendPhoneNumberConfirmationCodeRequest) (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -9832,7 +12072,7 @@ func (client *Client) ResendPhoneNumberConfirmationCode() (*AuthenticationCodeIn } type CheckPhoneNumberConfirmationCodeRequest struct { - // The phone number confirmation code + // Confirmation code to check Code string `json:"code"` } @@ -9887,21 +12127,21 @@ 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 - PngSticker InputFile `json:"png_sticker"` + // Sticker file owner; ignored for regular users + UserId int64 `json:"user_id"` + // Sticker file to upload + Sticker InputSticker `json:"sticker"` } -// Uploads a PNG image with a sticker; for bots only; returns the uploaded file +// Uploads a file with a sticker; returns the uploaded file func (client *Client) UploadStickerFile(req *UploadStickerFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ Type: "uploadStickerFile", }, Data: map[string]interface{}{ - "user_id": req.UserId, - "png_sticker": req.PngSticker, + "user_id": req.UserId, + "sticker": req.Sticker, }, }) if err != nil { @@ -9915,20 +12155,86 @@ func (client *Client) UploadStickerFile(req *UploadStickerFileRequest) (*File, e return UnmarshalFile(result.Data) } -type CreateNewStickerSetRequest struct { - // Sticker set owner - UserId int32 `json:"user_id"` +type GetSuggestedStickerSetNameRequest struct { // Sticker set title; 1-64 characters 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 +} + +// Returns a suggested name for a new sticker set with a given title +func (client *Client) GetSuggestedStickerSetName(req *GetSuggestedStickerSetNameRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSuggestedStickerSetName", + }, + Data: map[string]interface{}{ + "title": req.Title, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type CheckStickerSetNameRequest struct { + // Name to be checked + Name string `json:"name"` +} + +// Checks whether a name can be used for a new sticker set +func (client *Client) CheckStickerSetName(req *CheckStickerSetNameRequest) (CheckStickerSetNameResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkStickerSetName", + }, + Data: map[string]interface{}{ + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeCheckStickerSetNameResultOk: + return UnmarshalCheckStickerSetNameResultOk(result.Data) + + case TypeCheckStickerSetNameResultNameInvalid: + return UnmarshalCheckStickerSetNameResultNameInvalid(result.Data) + + case TypeCheckStickerSetNameResultNameOccupied: + return UnmarshalCheckStickerSetNameResultNameOccupied(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +type CreateNewStickerSetRequest struct { + // Sticker set owner; ignored for regular users + UserId int64 `json:"user_id"` + // Sticker set title; 1-64 characters + Title string `json:"title"` + // Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters Name string `json:"name"` // True, if stickers are masks. Animated stickers can't be masks IsMasks bool `json:"is_masks"` - // List of stickers to be added to the set; must be non-empty. All stickers must be of the same type + // List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown Stickers []InputSticker `json:"stickers"` + // Source of the sticker set; may be empty if unknown + Source string `json:"source"` } -// Creates a new sticker set; for bots only. Returns the newly created sticker set +// Creates a new sticker set. Returns the newly created sticker set func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*StickerSet, error) { result, err := client.Send(Request{ meta: meta{ @@ -9940,6 +12246,7 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti "name": req.Name, "is_masks": req.IsMasks, "stickers": req.Stickers, + "source": req.Source, }, }) if err != nil { @@ -9955,7 +12262,7 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti type AddStickerToSetRequest struct { // Sticker set owner - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // Sticker set name Name string `json:"name"` // Sticker to add to the set @@ -9987,10 +12294,10 @@ func (client *Client) AddStickerToSet(req *AddStickerToSetRequest) (*StickerSet, type SetStickerSetThumbnailRequest struct { // Sticker set owner - UserId int32 `json:"user_id"` + UserId int64 `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 to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them Thumbnail InputFile `json:"thumbnail"` } @@ -10242,7 +12549,7 @@ func (client *Client) GetCountries() (*Countries, error) { 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 +// Uses the current IP address to find the current country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization func (client *Client) GetCountryCode() (*Text, error) { result, err := client.Send(Request{ meta: meta{ @@ -10287,11 +12594,40 @@ func (client *Client) GetPhoneNumberInfo(req *GetPhoneNumberInfoRequest) (*Phone 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) { +type GetPhoneNumberInfoSyncRequest struct { + // A two-letter ISO 639-1 country code for country information localization + LanguageCode string `json:"language_code"` + // The phone number prefix + PhoneNumberPrefix string `json:"phone_number_prefix"` +} + +// Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after changing localization to the specified language if properly localized country information is expected. Can be called synchronously +func (client *Client) GetPhoneNumberInfoSync(req *GetPhoneNumberInfoSyncRequest) (*PhoneNumberInfo, error) { + result, err := client.jsonClient.Execute(Request{ + meta: meta{ + Type: "getPhoneNumberInfoSync", + }, + Data: map[string]interface{}{ + "language_code": req.LanguageCode, + "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 link for downloading official Telegram application to be used when the current user invites friends to Telegram +func (client *Client) GetApplicationDownloadLink() (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getInviteText", + Type: "getApplicationDownloadLink", }, Data: map[string]interface{}{}, }) @@ -10303,7 +12639,7 @@ func (client *Client) GetInviteText() (*Text, error) { return nil, buildResponseError(result.Data) } - return UnmarshalText(result.Data) + return UnmarshalHttpUrl(result.Data) } type GetDeepLinkInfoRequest struct { @@ -10409,7 +12745,7 @@ type AddProxyRequest struct { Server string `json:"server"` // Proxy server port Port int32 `json:"port"` - // True, if the proxy should be enabled + // True, if the proxy needs to be enabled Enable bool `json:"enable"` // Proxy type Type ProxyType `json:"type"` @@ -10446,7 +12782,7 @@ type EditProxyRequest struct { Server string `json:"server"` // Proxy server port Port int32 `json:"port"` - // True, if the proxy should be enabled + // True, if the proxy needs to be enabled Enable bool `json:"enable"` // Proxy type Type ProxyType `json:"type"` @@ -10573,7 +12909,7 @@ type GetProxyLinkRequest struct { } // Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization -func (client *Client) GetProxyLink(req *GetProxyLinkRequest) (*Text, error) { +func (client *Client) GetProxyLink(req *GetProxyLinkRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ Type: "getProxyLink", @@ -10590,7 +12926,7 @@ func (client *Client) GetProxyLink(req *GetProxyLinkRequest) (*Text, error) { return nil, buildResponseError(result.Data) } - return UnmarshalText(result.Data) + return UnmarshalHttpUrl(result.Data) } type PingProxyRequest struct { @@ -10796,7 +13132,7 @@ func (client *Client) GetLogTagVerbosityLevel(req *GetLogTagVerbosityLevelReques } type AddLogMessageRequest struct { - // The minimum verbosity level needed for the message to be logged, 0-1023 + // The minimum verbosity level needed for the message to be logged; 0-1023 VerbosityLevel int32 `json:"verbosity_level"` // Text of a message to log Text string `json:"text"` @@ -11172,41 +13508,56 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatPosition: return UnmarshalUpdateChatPosition(result.Data) - case TypeUpdateChatIsMarkedAsUnread: - return UnmarshalUpdateChatIsMarkedAsUnread(result.Data) - - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(result.Data) - - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(result.Data) - - case TypeUpdateChatDefaultDisableNotification: - return UnmarshalUpdateChatDefaultDisableNotification(result.Data) - case TypeUpdateChatReadInbox: return UnmarshalUpdateChatReadInbox(result.Data) case TypeUpdateChatReadOutbox: return UnmarshalUpdateChatReadOutbox(result.Data) - case TypeUpdateChatUnreadMentionCount: - return UnmarshalUpdateChatUnreadMentionCount(result.Data) + case TypeUpdateChatActionBar: + return UnmarshalUpdateChatActionBar(result.Data) + + case TypeUpdateChatDraftMessage: + return UnmarshalUpdateChatDraftMessage(result.Data) + + case TypeUpdateChatMessageSender: + return UnmarshalUpdateChatMessageSender(result.Data) + + case TypeUpdateChatMessageTtl: + return UnmarshalUpdateChatMessageTtl(result.Data) case TypeUpdateChatNotificationSettings: return UnmarshalUpdateChatNotificationSettings(result.Data) - case TypeUpdateScopeNotificationSettings: - return UnmarshalUpdateScopeNotificationSettings(result.Data) - - case TypeUpdateChatActionBar: - return UnmarshalUpdateChatActionBar(result.Data) + case TypeUpdateChatPendingJoinRequests: + return UnmarshalUpdateChatPendingJoinRequests(result.Data) case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(result.Data) - case TypeUpdateChatDraftMessage: - return UnmarshalUpdateChatDraftMessage(result.Data) + case TypeUpdateChatTheme: + return UnmarshalUpdateChatTheme(result.Data) + + case TypeUpdateChatUnreadMentionCount: + return UnmarshalUpdateChatUnreadMentionCount(result.Data) + + case TypeUpdateChatVideoChat: + return UnmarshalUpdateChatVideoChat(result.Data) + + case TypeUpdateChatDefaultDisableNotification: + return UnmarshalUpdateChatDefaultDisableNotification(result.Data) + + case TypeUpdateChatHasProtectedContent: + return UnmarshalUpdateChatHasProtectedContent(result.Data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(result.Data) + + case TypeUpdateChatIsBlocked: + return UnmarshalUpdateChatIsBlocked(result.Data) + + case TypeUpdateChatIsMarkedAsUnread: + return UnmarshalUpdateChatIsMarkedAsUnread(result.Data) case TypeUpdateChatFilters: return UnmarshalUpdateChatFilters(result.Data) @@ -11214,6 +13565,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(result.Data) + case TypeUpdateScopeNotificationSettings: + return UnmarshalUpdateScopeNotificationSettings(result.Data) + case TypeUpdateNotification: return UnmarshalUpdateNotification(result.Data) @@ -11229,8 +13583,8 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateDeleteMessages: return UnmarshalUpdateDeleteMessages(result.Data) - case TypeUpdateUserChatAction: - return UnmarshalUpdateUserChatAction(result.Data) + case TypeUpdateChatAction: + return UnmarshalUpdateChatAction(result.Data) case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(result.Data) @@ -11271,6 +13625,12 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateCall: return UnmarshalUpdateCall(result.Data) + case TypeUpdateGroupCall: + return UnmarshalUpdateGroupCall(result.Data) + + case TypeUpdateGroupCallParticipant: + return UnmarshalUpdateGroupCallParticipant(result.Data) + case TypeUpdateNewCallSignalingData: return UnmarshalUpdateNewCallSignalingData(result.Data) @@ -11307,6 +13667,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(result.Data) + case TypeUpdateChatThemes: + return UnmarshalUpdateChatThemes(result.Data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(result.Data) @@ -11322,6 +13685,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(result.Data) + case TypeUpdateAnimatedEmojiMessageClicked: + return UnmarshalUpdateAnimatedEmojiMessageClicked(result.Data) + case TypeUpdateAnimationSearchParameters: return UnmarshalUpdateAnimationSearchParameters(result.Data) @@ -11358,6 +13724,12 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdatePollAnswer: return UnmarshalUpdatePollAnswer(result.Data) + case TypeUpdateChatMember: + return UnmarshalUpdateChatMember(result.Data) + + case TypeUpdateNewChatJoinRequest: + return UnmarshalUpdateNewChatJoinRequest(result.Data) + default: return nil, errors.New("invalid type") } diff --git a/client/puller/supergroup.go b/client/puller/supergroup.go index 89a2693..2456dfa 100644 --- a/client/puller/supergroup.go +++ b/client/puller/supergroup.go @@ -4,7 +4,7 @@ import ( "github.com/zelenin/go-tdlib/client" ) -func SupergroupMembers(tdlibClient *client.Client, supergroupId int32) (chan *client.ChatMember, chan error) { +func SupergroupMembers(tdlibClient *client.Client, supergroupId int64) (chan *client.ChatMember, chan error) { chatMemberChan := make(chan *client.ChatMember, 10) errChan := make(chan error, 1) @@ -17,7 +17,7 @@ func SupergroupMembers(tdlibClient *client.Client, supergroupId int32) (chan *cl return chatMemberChan, errChan } -func supergroupMembers(tdlibClient *client.Client, chatMemberChan chan *client.ChatMember, errChan chan error, supergroupId int32, filter client.SupergroupMembersFilter, offset int32, limit int32) { +func supergroupMembers(tdlibClient *client.Client, chatMemberChan chan *client.ChatMember, errChan chan error, supergroupId int64, filter client.SupergroupMembersFilter, offset int32, limit int32) { defer func() { close(chatMemberChan) close(errChan) diff --git a/client/tdjson.go b/client/tdjson.go index a91488e..a2860a9 100644 --- a/client/tdjson.go +++ b/client/tdjson.go @@ -1,3 +1,4 @@ +//go:build darwin // +build darwin package client diff --git a/client/tdjson_dynamic.go b/client/tdjson_dynamic.go index 84aaeac..4a88485 100644 --- a/client/tdjson_dynamic.go +++ b/client/tdjson_dynamic.go @@ -1,3 +1,4 @@ +//go:build libtdjson && (linux || darwin || windows) // +build libtdjson // +build linux darwin windows diff --git a/client/tdjson_static.go b/client/tdjson_static.go index dcbb662..a486de9 100644 --- a/client/tdjson_static.go +++ b/client/tdjson_static.go @@ -1,3 +1,4 @@ +//go:build !libtdjson && (linux || darwin) // +build !libtdjson // +build linux darwin diff --git a/client/type.go b/client/type.go index 996e97a..0022c59 100755 --- a/client/type.go +++ b/client/type.go @@ -52,6 +52,7 @@ const ( ClassCallDiscardReason = "CallDiscardReason" ClassCallServerType = "CallServerType" ClassCallState = "CallState" + ClassGroupCallVideoQuality = "GroupCallVideoQuality" ClassCallProblem = "CallProblem" ClassDiceStickers = "DiceStickers" ClassInputInlineQueryResult = "InputInlineQueryResult" @@ -65,6 +66,9 @@ const ( ClassInputBackground = "InputBackground" ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" ClassCheckChatUsernameResult = "CheckChatUsernameResult" + ClassCheckStickerSetNameResult = "CheckStickerSetNameResult" + ClassResetPasswordResult = "ResetPasswordResult" + ClassMessageFileType = "MessageFileType" ClassPushMessageContent = "PushMessageContent" ClassNotificationType = "NotificationType" ClassNotificationGroupType = "NotificationGroupType" @@ -73,6 +77,7 @@ const ( ClassUserPrivacySettingRule = "UserPrivacySettingRule" ClassUserPrivacySetting = "UserPrivacySetting" ClassChatReportReason = "ChatReportReason" + ClassInternalLinkType = "InternalLinkType" ClassFileType = "FileType" ClassNetworkType = "NetworkType" ClassNetworkStatisticsEntry = "NetworkStatisticsEntry" @@ -85,6 +90,8 @@ const ( ClassInputSticker = "InputSticker" ClassStatisticalGraph = "StatisticalGraph" ClassChatStatistics = "ChatStatistics" + ClassVectorPathCommand = "VectorPathCommand" + ClassBotCommandScope = "BotCommandScope" ClassUpdate = "Update" ClassLogStream = "LogStream" ClassError = "Error" @@ -106,6 +113,7 @@ const ( ClassMinithumbnail = "Minithumbnail" ClassThumbnail = "Thumbnail" ClassMaskPosition = "MaskPosition" + ClassClosedVectorPath = "ClosedVectorPath" ClassPollOption = "PollOption" ClassAnimation = "Animation" ClassAudio = "Audio" @@ -115,6 +123,7 @@ const ( ClassVideo = "Video" ClassVideoNote = "VideoNote" ClassVoiceNote = "VoiceNote" + ClassAnimatedEmoji = "AnimatedEmoji" ClassContact = "Contact" ClassLocation = "Location" ClassVenue = "Venue" @@ -123,7 +132,7 @@ const ( ClassProfilePhoto = "ProfilePhoto" ClassChatPhotoInfo = "ChatPhotoInfo" ClassBotCommand = "BotCommand" - ClassBotInfo = "BotInfo" + ClassBotCommands = "BotCommands" ClassChatLocation = "ChatLocation" ClassAnimatedChatPhoto = "AnimatedChatPhoto" ClassChatPhoto = "ChatPhoto" @@ -136,6 +145,16 @@ const ( ClassChatPermissions = "ChatPermissions" ClassChatMember = "ChatMember" ClassChatMembers = "ChatMembers" + ClassChatInviteLink = "ChatInviteLink" + ClassChatInviteLinks = "ChatInviteLinks" + ClassChatInviteLinkCount = "ChatInviteLinkCount" + ClassChatInviteLinkCounts = "ChatInviteLinkCounts" + ClassChatInviteLinkMember = "ChatInviteLinkMember" + ClassChatInviteLinkMembers = "ChatInviteLinkMembers" + ClassChatInviteLinkInfo = "ChatInviteLinkInfo" + ClassChatJoinRequest = "ChatJoinRequest" + ClassChatJoinRequests = "ChatJoinRequests" + ClassChatJoinRequestsInfo = "ChatJoinRequestsInfo" ClassBasicGroup = "BasicGroup" ClassBasicGroupFullInfo = "BasicGroupFullInfo" ClassSupergroup = "Supergroup" @@ -148,6 +167,11 @@ const ( ClassMessage = "Message" ClassMessages = "Messages" ClassFoundMessages = "FoundMessages" + ClassMessagePosition = "MessagePosition" + ClassMessagePositions = "MessagePositions" + ClassMessageCalendarDay = "MessageCalendarDay" + ClassMessageCalendar = "MessageCalendar" + ClassSponsoredMessage = "SponsoredMessage" ClassChatNotificationSettings = "ChatNotificationSettings" ClassScopeNotificationSettings = "ScopeNotificationSettings" ClassDraftMessage = "DraftMessage" @@ -157,12 +181,11 @@ const ( ClassRecommendedChatFilters = "RecommendedChatFilters" ClassChatLists = "ChatLists" ClassChatPosition = "ChatPosition" + ClassVideoChat = "VideoChat" ClassChat = "Chat" ClassChats = "Chats" ClassChatNearby = "ChatNearby" ClassChatsNearby = "ChatsNearby" - ClassChatInviteLink = "ChatInviteLink" - ClassChatInviteLinkInfo = "ChatInviteLinkInfo" ClassKeyboardButton = "KeyboardButton" ClassInlineKeyboardButton = "InlineKeyboardButton" ClassMessageThreadInfo = "MessageThreadInfo" @@ -184,6 +207,7 @@ const ( ClassShippingOption = "ShippingOption" ClassSavedCredentials = "SavedCredentials" ClassPaymentsProviderStripe = "PaymentsProviderStripe" + ClassPaymentFormTheme = "PaymentFormTheme" ClassPaymentForm = "PaymentForm" ClassValidatedOrderInfo = "ValidatedOrderInfo" ClassPaymentResult = "PaymentResult" @@ -215,6 +239,12 @@ const ( ClassCallProtocol = "CallProtocol" ClassCallServer = "CallServer" ClassCallId = "CallId" + ClassGroupCallId = "GroupCallId" + ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker" + ClassGroupCall = "GroupCall" + ClassGroupCallVideoSourceGroup = "GroupCallVideoSourceGroup" + ClassGroupCallParticipantVideoInfo = "GroupCallParticipantVideoInfo" + ClassGroupCallParticipant = "GroupCallParticipant" ClassCall = "Call" ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" ClassAnimations = "Animations" @@ -235,6 +265,8 @@ const ( ClassPushReceiverId = "PushReceiverId" ClassBackground = "Background" ClassBackgrounds = "Backgrounds" + ClassThemeSettings = "ThemeSettings" + ClassChatTheme = "ChatTheme" ClassHashtags = "Hashtags" ClassNotification = "Notification" ClassNotificationGroup = "NotificationGroup" @@ -271,6 +303,7 @@ const ( ClassChatStatisticsAdministratorActionsInfo = "ChatStatisticsAdministratorActionsInfo" ClassChatStatisticsInviterInfo = "ChatStatisticsInviterInfo" ClassMessageStatistics = "MessageStatistics" + ClassPoint = "Point" ClassUpdates = "Updates" ClassLogVerbosityLevel = "LogVerbosityLevel" ClassLogTags = "LogTags" @@ -291,6 +324,7 @@ const ( TypeAuthenticationCodeTypeSms = "authenticationCodeTypeSms" TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall" TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall" + TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall" TypeAuthenticationCodeInfo = "authenticationCodeInfo" TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo" TypeTextEntity = "textEntity" @@ -332,6 +366,7 @@ const ( TypeMaskPointMouth = "maskPointMouth" TypeMaskPointChin = "maskPointChin" TypeMaskPosition = "maskPosition" + TypeClosedVectorPath = "closedVectorPath" TypePollOption = "pollOption" TypePollTypeRegular = "pollTypeRegular" TypePollTypeQuiz = "pollTypeQuiz" @@ -343,6 +378,7 @@ const ( TypeVideo = "video" TypeVideoNote = "videoNote" TypeVoiceNote = "voiceNote" + TypeAnimatedEmoji = "animatedEmoji" TypeContact = "contact" TypeLocation = "location" TypeVenue = "venue" @@ -355,7 +391,7 @@ const ( TypeUserTypeBot = "userTypeBot" TypeUserTypeUnknown = "userTypeUnknown" TypeBotCommand = "botCommand" - TypeBotInfo = "botInfo" + TypeBotCommands = "botCommands" TypeChatLocation = "chatLocation" TypeAnimatedChatPhoto = "animatedChatPhoto" TypeChatPhoto = "chatPhoto" @@ -392,6 +428,16 @@ const ( TypeSupergroupMembersFilterBanned = "supergroupMembersFilterBanned" TypeSupergroupMembersFilterMention = "supergroupMembersFilterMention" TypeSupergroupMembersFilterBots = "supergroupMembersFilterBots" + TypeChatInviteLink = "chatInviteLink" + TypeChatInviteLinks = "chatInviteLinks" + TypeChatInviteLinkCount = "chatInviteLinkCount" + TypeChatInviteLinkCounts = "chatInviteLinkCounts" + TypeChatInviteLinkMember = "chatInviteLinkMember" + TypeChatInviteLinkMembers = "chatInviteLinkMembers" + TypeChatInviteLinkInfo = "chatInviteLinkInfo" + TypeChatJoinRequest = "chatJoinRequest" + TypeChatJoinRequests = "chatJoinRequests" + TypeChatJoinRequestsInfo = "chatJoinRequestsInfo" TypeBasicGroup = "basicGroup" TypeBasicGroupFullInfo = "basicGroupFullInfo" TypeSupergroup = "supergroup" @@ -407,6 +453,7 @@ const ( TypeMessageForwardOriginChat = "messageForwardOriginChat" TypeMessageForwardOriginHiddenUser = "messageForwardOriginHiddenUser" TypeMessageForwardOriginChannel = "messageForwardOriginChannel" + TypeMessageForwardOriginMessageImport = "messageForwardOriginMessageImport" TypeMessageForwardInfo = "messageForwardInfo" TypeMessageReplyInfo = "messageReplyInfo" TypeMessageInteractionInfo = "messageInteractionInfo" @@ -415,6 +462,11 @@ const ( TypeMessage = "message" TypeMessages = "messages" TypeFoundMessages = "foundMessages" + TypeMessagePosition = "messagePosition" + TypeMessagePositions = "messagePositions" + TypeMessageCalendarDay = "messageCalendarDay" + TypeMessageCalendar = "messageCalendar" + TypeSponsoredMessage = "sponsoredMessage" TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats" TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats" TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats" @@ -436,19 +488,20 @@ const ( TypeChatSourceMtprotoProxy = "chatSourceMtprotoProxy" TypeChatSourcePublicServiceAnnouncement = "chatSourcePublicServiceAnnouncement" TypeChatPosition = "chatPosition" + TypeVideoChat = "videoChat" TypeChat = "chat" TypeChats = "chats" TypeChatNearby = "chatNearby" TypeChatsNearby = "chatsNearby" - TypeChatInviteLink = "chatInviteLink" - TypeChatInviteLinkInfo = "chatInviteLinkInfo" TypePublicChatTypeHasUsername = "publicChatTypeHasUsername" TypePublicChatTypeIsLocationBased = "publicChatTypeIsLocationBased" TypeChatActionBarReportSpam = "chatActionBarReportSpam" TypeChatActionBarReportUnrelatedLocation = "chatActionBarReportUnrelatedLocation" + TypeChatActionBarInviteMembers = "chatActionBarInviteMembers" TypeChatActionBarReportAddBlock = "chatActionBarReportAddBlock" TypeChatActionBarAddContact = "chatActionBarAddContact" TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber" + TypeChatActionBarJoinRequest = "chatActionBarJoinRequest" TypeKeyboardButtonTypeText = "keyboardButtonTypeText" TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" @@ -461,6 +514,7 @@ const ( TypeInlineKeyboardButtonTypeCallbackGame = "inlineKeyboardButtonTypeCallbackGame" TypeInlineKeyboardButtonTypeSwitchInline = "inlineKeyboardButtonTypeSwitchInline" TypeInlineKeyboardButtonTypeBuy = "inlineKeyboardButtonTypeBuy" + TypeInlineKeyboardButtonTypeUser = "inlineKeyboardButtonTypeUser" TypeInlineKeyboardButton = "inlineKeyboardButton" TypeReplyMarkupRemoveKeyboard = "replyMarkupRemoveKeyboard" TypeReplyMarkupForceReply = "replyMarkupForceReply" @@ -540,9 +594,10 @@ const ( TypeSavedCredentials = "savedCredentials" TypeInputCredentialsSaved = "inputCredentialsSaved" TypeInputCredentialsNew = "inputCredentialsNew" - TypeInputCredentialsAndroidPay = "inputCredentialsAndroidPay" TypeInputCredentialsApplePay = "inputCredentialsApplePay" + TypeInputCredentialsGooglePay = "inputCredentialsGooglePay" TypePaymentsProviderStripe = "paymentsProviderStripe" + TypePaymentFormTheme = "paymentFormTheme" TypePaymentForm = "paymentForm" TypeValidatedOrderInfo = "validatedOrderInfo" TypePaymentResult = "paymentResult" @@ -634,11 +689,16 @@ const ( TypeMessageLocation = "messageLocation" TypeMessageVenue = "messageVenue" TypeMessageContact = "messageContact" + TypeMessageAnimatedEmoji = "messageAnimatedEmoji" TypeMessageDice = "messageDice" TypeMessageGame = "messageGame" TypeMessagePoll = "messagePoll" TypeMessageInvoice = "messageInvoice" TypeMessageCall = "messageCall" + TypeMessageVideoChatScheduled = "messageVideoChatScheduled" + TypeMessageVideoChatStarted = "messageVideoChatStarted" + TypeMessageVideoChatEnded = "messageVideoChatEnded" + TypeMessageInviteVideoChatParticipants = "messageInviteVideoChatParticipants" TypeMessageBasicGroupChatCreate = "messageBasicGroupChatCreate" TypeMessageSupergroupChatCreate = "messageSupergroupChatCreate" TypeMessageChatChangeTitle = "messageChatChangeTitle" @@ -646,11 +706,13 @@ const ( TypeMessageChatDeletePhoto = "messageChatDeletePhoto" TypeMessageChatAddMembers = "messageChatAddMembers" TypeMessageChatJoinByLink = "messageChatJoinByLink" + TypeMessageChatJoinByRequest = "messageChatJoinByRequest" TypeMessageChatDeleteMember = "messageChatDeleteMember" TypeMessageChatUpgradeTo = "messageChatUpgradeTo" TypeMessageChatUpgradeFrom = "messageChatUpgradeFrom" TypeMessagePinMessage = "messagePinMessage" TypeMessageScreenshotTaken = "messageScreenshotTaken" + TypeMessageChatSetTheme = "messageChatSetTheme" TypeMessageChatSetTtl = "messageChatSetTtl" TypeMessageCustomServiceAction = "messageCustomServiceAction" TypeMessageGameScore = "messageGameScore" @@ -679,6 +741,7 @@ const ( TypeTextEntityTypePreCode = "textEntityTypePreCode" TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl" TypeTextEntityTypeMentionName = "textEntityTypeMentionName" + TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp" TypeInputThumbnail = "inputThumbnail" TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate" TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline" @@ -711,8 +774,6 @@ const ( TypeSearchMessagesFilterPhotoAndVideo = "searchMessagesFilterPhotoAndVideo" TypeSearchMessagesFilterUrl = "searchMessagesFilterUrl" TypeSearchMessagesFilterChatPhoto = "searchMessagesFilterChatPhoto" - TypeSearchMessagesFilterCall = "searchMessagesFilterCall" - TypeSearchMessagesFilterMissedCall = "searchMessagesFilterMissedCall" TypeSearchMessagesFilterVideoNote = "searchMessagesFilterVideoNote" TypeSearchMessagesFilterVoiceAndVideoNote = "searchMessagesFilterVoiceAndVideoNote" TypeSearchMessagesFilterMention = "searchMessagesFilterMention" @@ -726,11 +787,13 @@ const ( TypeChatActionUploadingVoiceNote = "chatActionUploadingVoiceNote" TypeChatActionUploadingPhoto = "chatActionUploadingPhoto" TypeChatActionUploadingDocument = "chatActionUploadingDocument" + TypeChatActionChoosingSticker = "chatActionChoosingSticker" TypeChatActionChoosingLocation = "chatActionChoosingLocation" TypeChatActionChoosingContact = "chatActionChoosingContact" TypeChatActionStartPlayingGame = "chatActionStartPlayingGame" TypeChatActionRecordingVideoNote = "chatActionRecordingVideoNote" TypeChatActionUploadingVideoNote = "chatActionUploadingVideoNote" + TypeChatActionWatchingAnimations = "chatActionWatchingAnimations" TypeChatActionCancel = "chatActionCancel" TypeUserStatusEmpty = "userStatusEmpty" TypeUserStatusOnline = "userStatusOnline" @@ -753,12 +816,21 @@ const ( TypeCallServerTypeWebrtc = "callServerTypeWebrtc" TypeCallServer = "callServer" TypeCallId = "callId" + TypeGroupCallId = "groupCallId" TypeCallStatePending = "callStatePending" TypeCallStateExchangingKeys = "callStateExchangingKeys" TypeCallStateReady = "callStateReady" TypeCallStateHangingUp = "callStateHangingUp" TypeCallStateDiscarded = "callStateDiscarded" TypeCallStateError = "callStateError" + TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" + TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" + TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" + TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker" + TypeGroupCall = "groupCall" + TypeGroupCallVideoSourceGroup = "groupCallVideoSourceGroup" + TypeGroupCallParticipantVideoInfo = "groupCallParticipantVideoInfo" + TypeGroupCallParticipant = "groupCallParticipant" TypeCallProblemEcho = "callProblemEcho" TypeCallProblemNoise = "callProblemNoise" TypeCallProblemInterruptions = "callProblemInterruptions" @@ -813,6 +885,8 @@ const ( TypeChatEventMessagePinned = "chatEventMessagePinned" TypeChatEventMessageUnpinned = "chatEventMessageUnpinned" TypeChatEventMemberJoined = "chatEventMemberJoined" + TypeChatEventMemberJoinedByInviteLink = "chatEventMemberJoinedByInviteLink" + TypeChatEventMemberJoinedByRequest = "chatEventMemberJoinedByRequest" TypeChatEventMemberLeft = "chatEventMemberLeft" TypeChatEventMemberInvited = "chatEventMemberInvited" TypeChatEventMemberPromoted = "chatEventMemberPromoted" @@ -825,10 +899,20 @@ const ( TypeChatEventInvitesToggled = "chatEventInvitesToggled" TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" + TypeChatEventMessageTtlChanged = "chatEventMessageTtlChanged" TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" + TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" TypeChatEventLocationChanged = "chatEventLocationChanged" TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" + TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited" + TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked" + TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted" + TypeChatEventVideoChatCreated = "chatEventVideoChatCreated" + TypeChatEventVideoChatEnded = "chatEventVideoChatEnded" + TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled" + TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged" + TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" TypeChatEvent = "chatEvent" TypeChatEvents = "chatEvents" TypeChatEventLogFilters = "chatEventLogFilters" @@ -853,6 +937,7 @@ const ( TypePushReceiverId = "pushReceiverId" TypeBackgroundFillSolid = "backgroundFillSolid" TypeBackgroundFillGradient = "backgroundFillGradient" + TypeBackgroundFillFreeformGradient = "backgroundFillFreeformGradient" TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper" TypeBackgroundTypePattern = "backgroundTypePattern" TypeBackgroundTypeFill = "backgroundTypeFill" @@ -860,6 +945,8 @@ const ( TypeBackgrounds = "backgrounds" TypeInputBackgroundLocal = "inputBackgroundLocal" TypeInputBackgroundRemote = "inputBackgroundRemote" + TypeThemeSettings = "themeSettings" + TypeChatTheme = "chatTheme" TypeHashtags = "hashtags" TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" @@ -870,6 +957,15 @@ const ( TypeCheckChatUsernameResultUsernameOccupied = "checkChatUsernameResultUsernameOccupied" TypeCheckChatUsernameResultPublicChatsTooMuch = "checkChatUsernameResultPublicChatsTooMuch" TypeCheckChatUsernameResultPublicGroupsUnavailable = "checkChatUsernameResultPublicGroupsUnavailable" + TypeCheckStickerSetNameResultOk = "checkStickerSetNameResultOk" + TypeCheckStickerSetNameResultNameInvalid = "checkStickerSetNameResultNameInvalid" + TypeCheckStickerSetNameResultNameOccupied = "checkStickerSetNameResultNameOccupied" + TypeResetPasswordResultOk = "resetPasswordResultOk" + TypeResetPasswordResultPending = "resetPasswordResultPending" + TypeResetPasswordResultDeclined = "resetPasswordResultDeclined" + TypeMessageFileTypePrivate = "messageFileTypePrivate" + TypeMessageFileTypeGroup = "messageFileTypeGroup" + TypeMessageFileTypeUnknown = "messageFileTypeUnknown" TypePushMessageContentHidden = "pushMessageContentHidden" TypePushMessageContentAnimation = "pushMessageContentAnimation" TypePushMessageContentAudio = "pushMessageContentAudio" @@ -892,8 +988,10 @@ const ( TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers" TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto" TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle" + TypePushMessageContentChatSetTheme = "pushMessageContentChatSetTheme" TypePushMessageContentChatDeleteMember = "pushMessageContentChatDeleteMember" TypePushMessageContentChatJoinByLink = "pushMessageContentChatJoinByLink" + TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest" TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards" TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum" TypeNotificationTypeNewMessage = "notificationTypeNewMessage" @@ -945,7 +1043,32 @@ const ( TypeChatReportReasonChildAbuse = "chatReportReasonChildAbuse" TypeChatReportReasonCopyright = "chatReportReasonCopyright" TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation" + TypeChatReportReasonFake = "chatReportReasonFake" TypeChatReportReasonCustom = "chatReportReasonCustom" + TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" + TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" + TypeInternalLinkTypeBackground = "internalLinkTypeBackground" + TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" + TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" + TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" + TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" + TypeInternalLinkTypeFilterSettings = "internalLinkTypeFilterSettings" + TypeInternalLinkTypeGame = "internalLinkTypeGame" + TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" + TypeInternalLinkTypeMessage = "internalLinkTypeMessage" + TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" + TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" + TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" + TypeInternalLinkTypeProxy = "internalLinkTypeProxy" + TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" + TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" + TypeInternalLinkTypeSettings = "internalLinkTypeSettings" + TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" + TypeInternalLinkTypeTheme = "internalLinkTypeTheme" + TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" + TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" + TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" + TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat" TypeMessageLink = "messageLink" TypeMessageLinkInfo = "messageLinkInfo" TypeFilePart = "filePart" @@ -999,7 +1122,11 @@ const ( TypeTMeUrl = "tMeUrl" TypeTMeUrls = "tMeUrls" TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats" + TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword" TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber" + TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint" + TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup" + TypeSuggestedActionSetPassword = "suggestedActionSetPassword" TypeCount = "count" TypeText = "text" TypeSeconds = "seconds" @@ -1025,6 +1152,16 @@ const ( TypeChatStatisticsSupergroup = "chatStatisticsSupergroup" TypeChatStatisticsChannel = "chatStatisticsChannel" TypeMessageStatistics = "messageStatistics" + TypePoint = "point" + TypeVectorPathCommandLine = "vectorPathCommandLine" + TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" + TypeBotCommandScopeDefault = "botCommandScopeDefault" + TypeBotCommandScopeAllPrivateChats = "botCommandScopeAllPrivateChats" + TypeBotCommandScopeAllGroupChats = "botCommandScopeAllGroupChats" + TypeBotCommandScopeAllChatAdministrators = "botCommandScopeAllChatAdministrators" + TypeBotCommandScopeChat = "botCommandScopeChat" + TypeBotCommandScopeChatAdministrators = "botCommandScopeChatAdministrators" + TypeBotCommandScopeChatMember = "botCommandScopeChatMember" TypeUpdateAuthorizationState = "updateAuthorizationState" TypeUpdateNewMessage = "updateNewMessage" TypeUpdateMessageSendAcknowledged = "updateMessageSendAcknowledged" @@ -1043,26 +1180,32 @@ const ( TypeUpdateChatPermissions = "updateChatPermissions" TypeUpdateChatLastMessage = "updateChatLastMessage" TypeUpdateChatPosition = "updateChatPosition" - TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" - TypeUpdateChatIsBlocked = "updateChatIsBlocked" - TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" - TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" TypeUpdateChatReadInbox = "updateChatReadInbox" TypeUpdateChatReadOutbox = "updateChatReadOutbox" - TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" - TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" - TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" TypeUpdateChatActionBar = "updateChatActionBar" - TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" TypeUpdateChatDraftMessage = "updateChatDraftMessage" + TypeUpdateChatMessageSender = "updateChatMessageSender" + TypeUpdateChatMessageTtl = "updateChatMessageTtl" + TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" + TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests" + TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" + TypeUpdateChatTheme = "updateChatTheme" + TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" + TypeUpdateChatVideoChat = "updateChatVideoChat" + TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" + TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" + TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" + TypeUpdateChatIsBlocked = "updateChatIsBlocked" + TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" TypeUpdateChatFilters = "updateChatFilters" TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" + TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" TypeUpdateNotification = "updateNotification" TypeUpdateNotificationGroup = "updateNotificationGroup" TypeUpdateActiveNotifications = "updateActiveNotifications" TypeUpdateHavePendingNotifications = "updateHavePendingNotifications" TypeUpdateDeleteMessages = "updateDeleteMessages" - TypeUpdateUserChatAction = "updateUserChatAction" + TypeUpdateChatAction = "updateChatAction" TypeUpdateUserStatus = "updateUserStatus" TypeUpdateUser = "updateUser" TypeUpdateBasicGroup = "updateBasicGroup" @@ -1076,6 +1219,8 @@ const ( TypeUpdateFileGenerationStart = "updateFileGenerationStart" TypeUpdateFileGenerationStop = "updateFileGenerationStop" TypeUpdateCall = "updateCall" + TypeUpdateGroupCall = "updateGroupCall" + TypeUpdateGroupCallParticipant = "updateGroupCallParticipant" TypeUpdateNewCallSignalingData = "updateNewCallSignalingData" TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" @@ -1088,11 +1233,13 @@ const ( TypeUpdateFavoriteStickers = "updateFavoriteStickers" TypeUpdateSavedAnimations = "updateSavedAnimations" TypeUpdateSelectedBackground = "updateSelectedBackground" + TypeUpdateChatThemes = "updateChatThemes" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" TypeUpdateTermsOfService = "updateTermsOfService" TypeUpdateUsersNearby = "updateUsersNearby" TypeUpdateDiceEmojis = "updateDiceEmojis" + TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" TypeUpdateSuggestedActions = "updateSuggestedActions" TypeUpdateNewInlineQuery = "updateNewInlineQuery" @@ -1105,6 +1252,8 @@ const ( TypeUpdateNewCustomQuery = "updateNewCustomQuery" TypeUpdatePoll = "updatePoll" TypeUpdatePollAnswer = "updatePollAnswer" + TypeUpdateChatMember = "updateChatMember" + TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest" TypeUpdates = "updates" TypeLogStreamDefault = "logStreamDefault" TypeLogStreamFile = "logStreamFile" @@ -1140,7 +1289,7 @@ type ThumbnailFormat interface { ThumbnailFormatType() string } -// Part of the face, relative to which a mask should be placed +// Part of the face, relative to which a mask is placed type MaskPoint interface { MaskPointType() string } @@ -1195,7 +1344,7 @@ type MessageSendingState interface { MessageSendingStateType() string } -// Describes the types of chats to which notification settings are applied +// Describes the types of chats to which notification settings are relevant type NotificationSettingsScope interface { NotificationSettingsScopeType() string } @@ -1220,7 +1369,7 @@ type PublicChatType interface { PublicChatTypeType() string } -// Describes actions which should be possible to do through a chat action bar +// Describes actions which must be possible to do through a chat action bar type ChatActionBar interface { ChatActionBarType() string } @@ -1345,12 +1494,17 @@ type CallState interface { CallStateType() string } +// Describes the quality of a group call video +type GroupCallVideoQuality interface { + GroupCallVideoQualityType() string +} + // Describes the exact type of a problem with a call type CallProblem interface { CallProblemType() string } -// Contains animated stickers which should be used for dice animation rendering +// Contains animated stickers which must be used for dice animation rendering type DiceStickers interface { DiceStickersType() string } @@ -1410,6 +1564,21 @@ type CheckChatUsernameResult interface { CheckChatUsernameResultType() string } +// Represents result of checking whether a name can be used for a new sticker set +type CheckStickerSetNameResult interface { + CheckStickerSetNameResultType() string +} + +// Represents result of 2-step verification password reset +type ResetPasswordResult interface { + ResetPasswordResultType() string +} + +// Contains information about a file with messages exported from another app +type MessageFileType interface { + MessageFileTypeType() string +} + // Contains content of a push message notification type PushMessageContent interface { PushMessageContentType() string @@ -1450,6 +1619,11 @@ type ChatReportReason interface { ChatReportReasonType() string } +// Describes an internal https://t.me or tg: link, which must be processed by the app in a special way +type InternalLinkType interface { + InternalLinkTypeType() string +} + // Represents the type of a file type FileType interface { FileTypeType() string @@ -1485,7 +1659,7 @@ type SuggestedAction interface { SuggestedActionType() string } -// Describes the way the text should be parsed for TextEntities +// Describes the way the text needs to be parsed for TextEntities type TextParseMode interface { TextParseModeType() string } @@ -1510,6 +1684,16 @@ type ChatStatistics interface { ChatStatisticsType() string } +// Represents a vector path command +type VectorPathCommand interface { + VectorPathCommandType() string +} + +// Represents the scope to which bot commands are relevant +type BotCommandScope interface { + BotCommandScopeType() string +} + // Contains notifications about data changes type Update interface { UpdateType() string @@ -1698,7 +1882,7 @@ func (*AuthenticationCodeTypeCall) AuthenticationCodeTypeType() string { return TypeAuthenticationCodeTypeCall } -// An authentication code is delivered by an immediately cancelled call to the specified phone number. The number from which the call was made is the code +// An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically type AuthenticationCodeTypeFlashCall struct { meta // Pattern of the phone number from which the call will be made @@ -1725,16 +1909,45 @@ func (*AuthenticationCodeTypeFlashCall) AuthenticationCodeTypeType() string { return TypeAuthenticationCodeTypeFlashCall } +// An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user +type AuthenticationCodeTypeMissedCall struct { + meta + // Prefix of the phone number from which the call will be made + PhoneNumberPrefix string `json:"phone_number_prefix"` + // Number of digits in the code, excluding the prefix + Length int32 `json:"length"` +} + +func (entity *AuthenticationCodeTypeMissedCall) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthenticationCodeTypeMissedCall + + return json.Marshal((*stub)(entity)) +} + +func (*AuthenticationCodeTypeMissedCall) GetClass() string { + return ClassAuthenticationCodeType +} + +func (*AuthenticationCodeTypeMissedCall) GetType() string { + return TypeAuthenticationCodeTypeMissedCall +} + +func (*AuthenticationCodeTypeMissedCall) AuthenticationCodeTypeType() string { + return TypeAuthenticationCodeTypeMissedCall +} + // Information about the authentication code that was sent type AuthenticationCodeInfo struct { meta // A phone number that is being authenticated PhoneNumber string `json:"phone_number"` - // Describes the way the code was sent to the user + // The way the code was sent to the user Type AuthenticationCodeType `json:"type"` - // Describes the way the next code will be sent to the user; may be null + // The way the next code will be sent to the user; may be null NextType AuthenticationCodeType `json:"next_type"` - // Timeout before the code should be re-sent, in seconds + // Timeout before the code can be re-sent, in seconds Timeout int32 `json:"timeout"` } @@ -2191,7 +2404,7 @@ func (*AuthorizationStateClosing) AuthorizationStateType() string { return TypeAuthorizationStateClosing } -// TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to with error code 500. To continue working, one should create a new instance of the TDLib client +// TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to with error code 500. To continue working, one must create a new instance of the TDLib client type AuthorizationStateClosed struct { meta } @@ -2229,6 +2442,8 @@ type PasswordState struct { HasPassportData bool `json:"has_passport_data"` // Information about the recovery email address to which the confirmation email was sent; may be null RecoveryEmailAddressCodeInfo *EmailAddressAuthenticationCodeInfo `json:"recovery_email_address_code_info"` + // If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword + PendingResetDate int32 `json:"pending_reset_date"` } func (entity *PasswordState) MarshalJSON() ([]byte, error) { @@ -2300,7 +2515,7 @@ type LocalFile struct { meta // Local path to the locally available file part; may be empty Path string `json:"path"` - // True, if it is possible to try to download or generate the file + // True, if it is possible to download or generate the file CanBeDownloaded bool `json:"can_be_downloaded"` // True, if the file can be deleted CanBeDeleted bool `json:"can_be_deleted"` @@ -2310,9 +2525,9 @@ type LocalFile struct { IsDownloadingCompleted bool `json:"is_downloading_completed"` // Download will be started from this offset. downloaded_prefix_size is calculated from this offset DownloadOffset int32 `json:"download_offset"` - // If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix + // If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes DownloadedPrefixSize int32 `json:"downloaded_prefix_size"` - // Total downloaded file bytes. Should be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage + // Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage DownloadedSize int32 `json:"downloaded_size"` } @@ -2335,7 +2550,7 @@ func (*LocalFile) GetType() string { // Represents a remote file type RemoteFile struct { meta - // Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile 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 + // Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location Id string `json:"id"` // Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time UniqueId string `json:"unique_id"` @@ -2343,7 +2558,7 @@ type RemoteFile struct { IsUploadingActive bool `json:"is_uploading_active"` // True, if a remote copy is fully available IsUploadingCompleted bool `json:"is_uploading_completed"` - // Size of the remote available part of the file; 0 if unknown + // Size of the remote available part of the file, in bytes; 0 if unknown UploadedSize int32 `json:"uploaded_size"` } @@ -2368,9 +2583,9 @@ type File struct { meta // Unique file identifier Id int32 `json:"id"` - // File size; 0 if unknown + // File size, in bytes; 0 if unknown Size int32 `json:"size"` - // Expected file size in case the exact file size is unknown, but an approximate size is known. Can be used to show download/upload progress + // Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress ExpectedSize int32 `json:"expected_size"` // Information about the local copy of the file Local *LocalFile `json:"local"` @@ -2480,9 +2695,9 @@ type InputFileGenerated struct { meta // Local path to a file from which the file is generated; may be empty if there is no such file OriginalPath string `json:"original_path"` - // String specifying the conversion applied to the original file; should be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage + // String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage Conversion string `json:"conversion"` - // Expected size of the generated file; 0 if unknown + // Expected size of the generated file, in bytes; 0 if unknown ExpectedSize int32 `json:"expected_size"` } @@ -2517,7 +2732,7 @@ type PhotoSize struct { Width int32 `json:"width"` // Image height Height int32 `json:"height"` - // Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image + // Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes ProgressiveSizes []int32 `json:"progressive_sizes"` } @@ -2766,7 +2981,7 @@ func (thumbnail *Thumbnail) UnmarshalJSON(data []byte) error { return nil } -// A mask should be placed relatively to the forehead +// The mask is placed relatively to the forehead type MaskPointForehead struct { meta } @@ -2791,7 +3006,7 @@ func (*MaskPointForehead) MaskPointType() string { return TypeMaskPointForehead } -// A mask should be placed relatively to the eyes +// The mask is placed relatively to the eyes type MaskPointEyes struct { meta } @@ -2816,7 +3031,7 @@ func (*MaskPointEyes) MaskPointType() string { return TypeMaskPointEyes } -// A mask should be placed relatively to the mouth +// The mask is placed relatively to the mouth type MaskPointMouth struct { meta } @@ -2841,7 +3056,7 @@ func (*MaskPointMouth) MaskPointType() string { return TypeMaskPointMouth } -// A mask should be placed relatively to the chin +// The mask is placed relatively to the chin type MaskPointChin struct { meta } @@ -2866,10 +3081,10 @@ func (*MaskPointChin) MaskPointType() string { return TypeMaskPointChin } -// Position on a photo where a mask should be placed +// Position on a photo where a mask is placed type MaskPosition struct { meta - // Part of the face, relative to which the mask should be placed + // Part of the face, relative to which the mask is placed Point MaskPoint `json:"point"` // Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position) XShift float64 `json:"x_shift"` @@ -2918,14 +3133,53 @@ func (maskPosition *MaskPosition) UnmarshalJSON(data []byte) error { return nil } +// Represents a closed vector path. The path begins at the end point of the last command +type ClosedVectorPath struct { + meta + // List of vector path commands + Commands []VectorPathCommand `json:"commands"` +} + +func (entity *ClosedVectorPath) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ClosedVectorPath + + return json.Marshal((*stub)(entity)) +} + +func (*ClosedVectorPath) GetClass() string { + return ClassClosedVectorPath +} + +func (*ClosedVectorPath) GetType() string { + return TypeClosedVectorPath +} + +func (closedVectorPath *ClosedVectorPath) UnmarshalJSON(data []byte) error { + var tmp struct { + Commands []json.RawMessage `json:"commands"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldCommands, _ := UnmarshalListOfVectorPathCommand(tmp.Commands) + closedVectorPath.Commands = fieldCommands + + return nil +} + // Describes one answer option of a poll type PollOption struct { meta - // Option text, 1-100 characters + // Option text; 1-100 characters Text string `json:"text"` // Number of voters for this option, available only for closed or voted polls VoterCount int32 `json:"voter_count"` - // The percentage of votes for this option, 0-100 + // The percentage of votes for this option; 0-100 VotePercentage int32 `json:"vote_percentage"` // True, if the option was chosen by the user IsChosen bool `json:"is_chosen"` @@ -2981,7 +3235,7 @@ 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 + // 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"` } @@ -3059,7 +3313,7 @@ type Audio struct { MimeType string `json:"mime_type"` // The minithumbnail of the album cover; may be null AlbumCoverMinithumbnail *Minithumbnail `json:"album_cover_minithumbnail"` - // The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null + // The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null AlbumCoverThumbnail *Thumbnail `json:"album_cover_thumbnail"` // File containing the audio Audio *File `json:"audio"` @@ -3154,8 +3408,10 @@ type Sticker struct { IsAnimated bool `json:"is_animated"` // True, if the sticker is a mask IsMask bool `json:"is_mask"` - // Position where the mask should be placed; may be null + // Position where the mask is placed; may be null MaskPosition *MaskPosition `json:"mask_position"` + // Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner + Outline []*ClosedVectorPath `json:"outline"` // Sticker thumbnail in WEBP or JPEG format; may be null Thumbnail *Thumbnail `json:"thumbnail"` // File containing the sticker @@ -3193,7 +3449,7 @@ type Video struct { MimeType string `json:"mime_type"` // 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 + // True, if the video is supposed to be streamed SupportsStreaming bool `json:"supports_streaming"` // Video minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` @@ -3279,6 +3535,33 @@ func (*VoiceNote) GetType() string { return TypeVoiceNote } +// Describes an animated representation of an emoji +type AnimatedEmoji struct { + meta + // Animated sticker for the emoji + Sticker *Sticker `json:"sticker"` + // Emoji modifier fitzpatrick type; 0-6; 0 if none + FitzpatrickType int32 `json:"fitzpatrick_type"` + // File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container + Sound *File `json:"sound"` +} + +func (entity *AnimatedEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AnimatedEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*AnimatedEmoji) GetClass() string { + return ClassAnimatedEmoji +} + +func (*AnimatedEmoji) GetType() string { + return TypeAnimatedEmoji +} + // Describes a user contact type Contact struct { meta @@ -3291,7 +3574,7 @@ type Contact struct { // Additional data about the user in a form of vCard; 0-2048 bytes in length Vcard string `json:"vcard"` // Identifier of the user, if known; otherwise 0 - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } func (entity *Contact) MarshalJSON() ([]byte, error) { @@ -3346,7 +3629,7 @@ type Venue struct { Title string `json:"title"` // Venue address; as defined by the sender Address string `json:"address"` - // Provider of the venue database; as defined by the sender. Currently only "foursquare" and "gplaces" (Google Places) need to be supported + // Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported Provider string `json:"provider"` // Identifier of the venue in the provider database; as defined by the sender Id string `json:"id"` @@ -3410,21 +3693,21 @@ type Poll struct { meta // Unique poll identifier Id JsonInt64 `json:"id"` - // Poll question, 1-300 characters + // Poll question; 1-300 characters Question string `json:"question"` // List of poll answer options Options []*PollOption `json:"options"` // Total number of voters, participating in the poll TotalVoterCount int32 `json:"total_voter_count"` // User identifiers of recent voters, if the poll is non-anonymous - RecentVoterUserIds []int32 `json:"recent_voter_user_ids"` + RecentVoterUserIds []int64 `json:"recent_voter_user_ids"` // True, if the poll is anonymous 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 + // Point in time (Unix timestamp) when the poll will automatically be closed CloseDate int32 `json:"close_date"` // True, if the poll is closed IsClosed bool `json:"is_closed"` @@ -3452,7 +3735,7 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { Question string `json:"question"` Options []*PollOption `json:"options"` TotalVoterCount int32 `json:"total_voter_count"` - RecentVoterUserIds []int32 `json:"recent_voter_user_ids"` + RecentVoterUserIds []int64 `json:"recent_voter_user_ids"` IsAnonymous bool `json:"is_anonymous"` Type json.RawMessage `json:"type"` OpenPeriod int32 `json:"open_period"` @@ -3490,6 +3773,8 @@ type ProfilePhoto struct { 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"` + // User profile photo minithumbnail; may be null + Minithumbnail *Minithumbnail `json:"minithumbnail"` // True, if the photo has animated variant HasAnimation bool `json:"has_animation"` } @@ -3517,6 +3802,8 @@ type ChatPhotoInfo struct { Small *File `json:"small"` // A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed Big *File `json:"big"` + // Chat photo minithumbnail; may be null + Minithumbnail *Minithumbnail `json:"minithumbnail"` // True, if the photo has animated variant HasAnimation bool `json:"has_animation"` } @@ -3598,7 +3885,7 @@ type UserTypeBot struct { IsInline bool `json:"is_inline"` // 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 + // True, if the location of the user is expected to be sent with every inline query to this bot NeedLocation bool `json:"need_location"` } @@ -3672,29 +3959,29 @@ func (*BotCommand) GetType() string { return TypeBotCommand } -// Provides information about a bot and its supported commands -type BotInfo struct { +// Contains a list of bot commands +type BotCommands struct { meta - // Long description shown on the user info page - Description string `json:"description"` - // A list of commands supported by the bot + // Bot's user identifier + BotUserId int64 `json:"bot_user_id"` + // List of bot commands Commands []*BotCommand `json:"commands"` } -func (entity *BotInfo) MarshalJSON() ([]byte, error) { +func (entity *BotCommands) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub BotInfo + type stub BotCommands return json.Marshal((*stub)(entity)) } -func (*BotInfo) GetClass() string { - return ClassBotInfo +func (*BotCommands) GetClass() string { + return ClassBotCommands } -func (*BotInfo) GetType() string { - return TypeBotInfo +func (*BotCommands) GetType() string { + return TypeBotCommands } // Represents a location to which a chat is connected @@ -3808,7 +4095,7 @@ func (*ChatPhotos) GetType() string { // A previously used profile photo of the current user type InputChatPhotoPrevious struct { meta - // Identifier of the profile photo to reuse + // Identifier of the current user's profile photo to reuse ChatPhotoId JsonInt64 `json:"chat_photo_id"` } @@ -3927,7 +4214,7 @@ func (inputChatPhotoAnimation *InputChatPhotoAnimation) UnmarshalJSON(data []byt type User struct { meta // User identifier - Id int32 `json:"id"` + Id int64 `json:"id"` // First name of the user FirstName string `json:"first_name"` // Last name of the user @@ -3952,6 +4239,8 @@ type User struct { RestrictionReason string `json:"restriction_reason"` // True, if many users reported this user as a scam IsScam bool `json:"is_scam"` + // True, if many users reported this user as a fake account + IsFake bool `json:"is_fake"` // If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser HaveAccess bool `json:"have_access"` // Type of the user @@ -3978,7 +4267,7 @@ func (*User) GetType() string { func (user *User) UnmarshalJSON(data []byte) error { var tmp struct { - Id int32 `json:"id"` + Id int64 `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Username string `json:"username"` @@ -3991,6 +4280,7 @@ func (user *User) UnmarshalJSON(data []byte) error { IsSupport bool `json:"is_support"` RestrictionReason string `json:"restriction_reason"` IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` HaveAccess bool `json:"have_access"` Type json.RawMessage `json:"type"` LanguageCode string `json:"language_code"` @@ -4013,6 +4303,7 @@ func (user *User) UnmarshalJSON(data []byte) error { user.IsSupport = tmp.IsSupport user.RestrictionReason = tmp.RestrictionReason user.IsScam = tmp.IsScam + user.IsFake = tmp.IsFake user.HaveAccess = tmp.HaveAccess user.LanguageCode = tmp.LanguageCode @@ -4038,16 +4329,20 @@ type UserFullInfo struct { 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 user can't be linked in forwarded messages due to their privacy settings + HasPrivateForwards bool `json:"has_private_forwards"` // True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` // A short user bio Bio string `json:"bio"` - // For bots, the text that is included with the link when users share the bot + // For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot ShareText string `json:"share_text"` + // For bots, the text shown in the chat with the bot if the chat is empty + Description string `json:"description"` // Number of group chats where both the other user and the current user are a member; 0 for the current user GroupInCommonCount int32 `json:"group_in_common_count"` - // If the user is a bot, information about the bot; may be null - BotInfo *BotInfo `json:"bot_info"` + // For bots, list of the bot commands + Commands []*BotCommand `json:"commands"` } func (entity *UserFullInfo) MarshalJSON() ([]byte, error) { @@ -4072,7 +4367,7 @@ type Users struct { // Approximate total count of users found TotalCount int32 `json:"total_count"` // A list of user identifiers - UserIds []int32 `json:"user_ids"` + UserIds []int64 `json:"user_ids"` } func (entity *Users) MarshalJSON() ([]byte, error) { @@ -4095,7 +4390,7 @@ func (*Users) GetType() string { type ChatAdministrator struct { meta // User identifier of the administrator - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // Custom title of the administrator CustomTitle string `json:"custom_title"` // True, if the user is the owner of the chat @@ -4178,7 +4473,7 @@ func (*ChatPermissions) GetType() string { return TypeChatPermissions } -// The user is the owner of a chat and has all the administrator privileges +// The user is the owner of the chat and has all the administrator privileges type ChatMemberStatusCreator struct { meta // A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only @@ -4209,13 +4504,15 @@ func (*ChatMemberStatusCreator) ChatMemberStatusType() string { return TypeChatMemberStatusCreator } -// 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 +// The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges type ChatMemberStatusAdministrator struct { meta // A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only CustomTitle string `json:"custom_title"` // True, if the current user can edit the administrator privileges for the called user CanBeEdited bool `json:"can_be_edited"` + // True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only + CanManageChat bool `json:"can_manage_chat"` // True, if the administrator can change the chat title, photo, and other settings CanChangeInfo bool `json:"can_change_info"` // True, if the administrator can create channel posts; applicable to channels only @@ -4226,12 +4523,14 @@ type ChatMemberStatusAdministrator struct { CanDeleteMessages bool `json:"can_delete_messages"` // True, if the administrator can invite new users to the chat CanInviteUsers bool `json:"can_invite_users"` - // True, if the administrator can restrict, ban, or unban chat members + // True, if the administrator can restrict, ban, or unban chat members; always true for channels CanRestrictMembers bool `json:"can_restrict_members"` - // True, if the administrator can pin messages; applicable to groups only + // True, if the administrator can pin messages; applicable to basic groups and supergroups only CanPinMessages bool `json:"can_pin_messages"` // True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them CanPromoteMembers bool `json:"can_promote_members"` + // True, if the administrator can manage video chats + CanManageVideoChats bool `json:"can_manage_video_chats"` // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only IsAnonymous bool `json:"is_anonymous"` } @@ -4256,7 +4555,7 @@ func (*ChatMemberStatusAdministrator) ChatMemberStatusType() string { return TypeChatMemberStatusAdministrator } -// The user is a member of a chat, without any additional privileges or restrictions +// The user is a member of the chat, without any additional privileges or restrictions type ChatMemberStatusMember struct { meta } @@ -4312,7 +4611,7 @@ func (*ChatMemberStatusRestricted) ChatMemberStatusType() string { return TypeChatMemberStatusRestricted } -// The user is not a chat member +// The user or the chat is not a chat member type ChatMemberStatusLeft struct { meta } @@ -4337,10 +4636,10 @@ func (*ChatMemberStatusLeft) ChatMemberStatusType() string { return TypeChatMemberStatusLeft } -// The user was banned (and hence is not a member of the chat). Implies the user can't return to the chat or view messages +// The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat type ChatMemberStatusBanned struct { meta - // Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever + // Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups BannedUntilDate int32 `json:"banned_until_date"` } @@ -4364,19 +4663,17 @@ func (*ChatMemberStatusBanned) ChatMemberStatusType() string { return TypeChatMemberStatusBanned } -// A user with information about joining/leaving a chat +// Describes a user or a chat as a member of another chat type ChatMember struct { meta - // User identifier of the chat member - UserId int32 `json:"user_id"` + // Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels + MemberId MessageSender `json:"member_id"` // Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown - InviterUserId int32 `json:"inviter_user_id"` + InviterUserId int64 `json:"inviter_user_id"` // 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 the chat member - BotInfo *BotInfo `json:"bot_info"` } func (entity *ChatMember) MarshalJSON() ([]byte, error) { @@ -4397,11 +4694,10 @@ func (*ChatMember) GetType() string { func (chatMember *ChatMember) UnmarshalJSON(data []byte) error { var tmp struct { - UserId int32 `json:"user_id"` - InviterUserId int32 `json:"inviter_user_id"` + MemberId json.RawMessage `json:"member_id"` + InviterUserId int64 `json:"inviter_user_id"` JoinedChatDate int32 `json:"joined_chat_date"` Status json.RawMessage `json:"status"` - BotInfo *BotInfo `json:"bot_info"` } err := json.Unmarshal(data, &tmp) @@ -4409,10 +4705,11 @@ func (chatMember *ChatMember) UnmarshalJSON(data []byte) error { return err } - chatMember.UserId = tmp.UserId chatMember.InviterUserId = tmp.InviterUserId chatMember.JoinedChatDate = tmp.JoinedChatDate - chatMember.BotInfo = tmp.BotInfo + + fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId) + chatMember.MemberId = fieldMemberId fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) chatMember.Status = fieldStatus @@ -4834,11 +5131,336 @@ func (*SupergroupMembersFilterBots) SupergroupMembersFilterType() string { return TypeSupergroupMembersFilterBots } +// Contains a chat invite link +type ChatInviteLink struct { + meta + // Chat invite link + InviteLink string `json:"invite_link"` + // Name of the link + Name string `json:"name"` + // User identifier of an administrator created the link + CreatorUserId int64 `json:"creator_user_id"` + // Point in time (Unix timestamp) when the link was created + Date int32 `json:"date"` + // Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown + EditDate int32 `json:"edit_date"` + // Point in time (Unix timestamp) when the link will expire; 0 if never + ExpirationDate int32 `json:"expiration_date"` + // The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval + MemberLimit int32 `json:"member_limit"` + // Number of chat members, which joined the chat using the link + MemberCount int32 `json:"member_count"` + // Number of pending join requests created using this link + PendingJoinRequestCount int32 `json:"pending_join_request_count"` + // True, if the link only creates join request. If true, total number of joining members will be unlimited + CreatesJoinRequest bool `json:"creates_join_request"` + // True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time + IsPrimary bool `json:"is_primary"` + // True, if the link was revoked + IsRevoked bool `json:"is_revoked"` +} + +func (entity *ChatInviteLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLink + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLink) GetClass() string { + return ClassChatInviteLink +} + +func (*ChatInviteLink) GetType() string { + return TypeChatInviteLink +} + +// Contains a list of chat invite links +type ChatInviteLinks struct { + meta + // Approximate total count of chat invite links found + TotalCount int32 `json:"total_count"` + // List of invite links + InviteLinks []*ChatInviteLink `json:"invite_links"` +} + +func (entity *ChatInviteLinks) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinks + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinks) GetClass() string { + return ClassChatInviteLinks +} + +func (*ChatInviteLinks) GetType() string { + return TypeChatInviteLinks +} + +// Describes a chat administrator with a number of active and revoked chat invite links +type ChatInviteLinkCount struct { + meta + // Administrator's user identifier + UserId int64 `json:"user_id"` + // Number of active invite links + InviteLinkCount int32 `json:"invite_link_count"` + // Number of revoked invite links + RevokedInviteLinkCount int32 `json:"revoked_invite_link_count"` +} + +func (entity *ChatInviteLinkCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinkCount + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinkCount) GetClass() string { + return ClassChatInviteLinkCount +} + +func (*ChatInviteLinkCount) GetType() string { + return TypeChatInviteLinkCount +} + +// Contains a list of chat invite link counts +type ChatInviteLinkCounts struct { + meta + // List of invite link counts + InviteLinkCounts []*ChatInviteLinkCount `json:"invite_link_counts"` +} + +func (entity *ChatInviteLinkCounts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinkCounts + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinkCounts) GetClass() string { + return ClassChatInviteLinkCounts +} + +func (*ChatInviteLinkCounts) GetType() string { + return TypeChatInviteLinkCounts +} + +// Describes a chat member joined a chat via an invite link +type ChatInviteLinkMember struct { + meta + // User identifier + UserId int64 `json:"user_id"` + // Point in time (Unix timestamp) when the user joined the chat + JoinedChatDate int32 `json:"joined_chat_date"` + // User identifier of the chat administrator, approved user join request + ApproverUserId int64 `json:"approver_user_id"` +} + +func (entity *ChatInviteLinkMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinkMember + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinkMember) GetClass() string { + return ClassChatInviteLinkMember +} + +func (*ChatInviteLinkMember) GetType() string { + return TypeChatInviteLinkMember +} + +// Contains a list of chat members joined a chat via an invite link +type ChatInviteLinkMembers struct { + meta + // Approximate total count of chat members found + TotalCount int32 `json:"total_count"` + // List of chat members, joined a chat via an invite link + Members []*ChatInviteLinkMember `json:"members"` +} + +func (entity *ChatInviteLinkMembers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinkMembers + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinkMembers) GetClass() string { + return ClassChatInviteLinkMembers +} + +func (*ChatInviteLinkMembers) GetType() string { + return TypeChatInviteLinkMembers +} + +// Contains information about a chat invite link +type ChatInviteLinkInfo struct { + meta + // 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"` + // Type of the chat + Type ChatType `json:"type"` + // Title of the chat + Title string `json:"title"` + // Chat photo; may be null + Photo *ChatPhotoInfo `json:"photo"` + // Chat description + Description string `json:"description"` + // 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 []int64 `json:"member_user_ids"` + // True, if the link only creates join request + CreatesJoinRequest bool `json:"creates_join_request"` + // True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup + IsPublic bool `json:"is_public"` +} + +func (entity *ChatInviteLinkInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinkInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinkInfo) GetClass() string { + return ClassChatInviteLinkInfo +} + +func (*ChatInviteLinkInfo) GetType() string { + return TypeChatInviteLinkInfo +} + +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 *ChatPhotoInfo `json:"photo"` + Description string `json:"description"` + MemberCount int32 `json:"member_count"` + MemberUserIds []int64 `json:"member_user_ids"` + CreatesJoinRequest bool `json:"creates_join_request"` + IsPublic bool `json:"is_public"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatInviteLinkInfo.ChatId = tmp.ChatId + chatInviteLinkInfo.AccessibleFor = tmp.AccessibleFor + chatInviteLinkInfo.Title = tmp.Title + chatInviteLinkInfo.Photo = tmp.Photo + chatInviteLinkInfo.Description = tmp.Description + chatInviteLinkInfo.MemberCount = tmp.MemberCount + chatInviteLinkInfo.MemberUserIds = tmp.MemberUserIds + chatInviteLinkInfo.CreatesJoinRequest = tmp.CreatesJoinRequest + chatInviteLinkInfo.IsPublic = tmp.IsPublic + + fieldType, _ := UnmarshalChatType(tmp.Type) + chatInviteLinkInfo.Type = fieldType + + return nil +} + +// Describes a user that sent a join request and waits for administrator approval +type ChatJoinRequest struct { + meta + // User identifier + UserId int64 `json:"user_id"` + // Point in time (Unix timestamp) when the user sent the join request + Date int32 `json:"date"` + // A short bio of the user + Bio string `json:"bio"` +} + +func (entity *ChatJoinRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinRequest + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinRequest) GetClass() string { + return ClassChatJoinRequest +} + +func (*ChatJoinRequest) GetType() string { + return TypeChatJoinRequest +} + +// Contains a list of requests to join a chat +type ChatJoinRequests struct { + meta + // Approximate total count of requests found + TotalCount int32 `json:"total_count"` + // List of the requests + Requests []*ChatJoinRequest `json:"requests"` +} + +func (entity *ChatJoinRequests) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinRequests + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinRequests) GetClass() string { + return ClassChatJoinRequests +} + +func (*ChatJoinRequests) GetType() string { + return TypeChatJoinRequests +} + +// Contains information about pending join requests for a chat +type ChatJoinRequestsInfo struct { + meta + // Total number of pending join requests + TotalCount int32 `json:"total_count"` + // Identifiers of at most 3 users sent the newest pending join requests + UserIds []int64 `json:"user_ids"` +} + +func (entity *ChatJoinRequestsInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinRequestsInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinRequestsInfo) GetClass() string { + return ClassChatJoinRequestsInfo +} + +func (*ChatJoinRequestsInfo) GetType() string { + return TypeChatJoinRequestsInfo +} + // Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users) type BasicGroup struct { meta // Group identifier - Id int32 `json:"id"` + Id int64 `json:"id"` // Number of members in the group MemberCount int32 `json:"member_count"` // Status of the current user in the group @@ -4846,7 +5468,7 @@ type BasicGroup struct { // True, if the group is active IsActive bool `json:"is_active"` // Identifier of the supergroup to which this group was upgraded; 0 if none - UpgradedToSupergroupId int32 `json:"upgraded_to_supergroup_id"` + UpgradedToSupergroupId int64 `json:"upgraded_to_supergroup_id"` } func (entity *BasicGroup) MarshalJSON() ([]byte, error) { @@ -4867,11 +5489,11 @@ func (*BasicGroup) GetType() string { func (basicGroup *BasicGroup) UnmarshalJSON(data []byte) error { var tmp struct { - Id int32 `json:"id"` + Id int64 `json:"id"` MemberCount int32 `json:"member_count"` Status json.RawMessage `json:"status"` IsActive bool `json:"is_active"` - UpgradedToSupergroupId int32 `json:"upgraded_to_supergroup_id"` + UpgradedToSupergroupId int64 `json:"upgraded_to_supergroup_id"` } err := json.Unmarshal(data, &tmp) @@ -4895,14 +5517,16 @@ type BasicGroupFullInfo struct { meta // Chat photo; may be null Photo *ChatPhoto `json:"photo"` - // Group description + // Group description. Updated only after the basic group is opened Description string `json:"description"` // User identifier of the creator of the group; 0 if unknown - CreatorUserId int32 `json:"creator_user_id"` + CreatorUserId int64 `json:"creator_user_id"` // Group members Members []*ChatMember `json:"members"` - // Invite link for this group; available only after it has been generated at least once and only for the group creator - InviteLink string `json:"invite_link"` + // Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened + InviteLink *ChatInviteLink `json:"invite_link"` + // List of commands of bots in the group + BotCommands []*BotCommands `json:"bot_commands"` } func (entity *BasicGroupFullInfo) MarshalJSON() ([]byte, error) { @@ -4925,31 +5549,35 @@ func (*BasicGroupFullInfo) GetType() string { type Supergroup struct { meta // Supergroup or channel identifier - Id int32 `json:"id"` + Id int64 `json:"id"` // Username of the supergroup or channel; empty for private supergroups or channels Username string `json:"username"` // Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member Date int32 `json:"date"` // Status of the current user in the supergroup or channel; custom title will be always empty Status ChatMemberStatus `json:"status"` - // Number of members in the supergroup or channel; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules + // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules MemberCount int32 `json:"member_count"` // True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel HasLinkedChat bool `json:"has_linked_chat"` // True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup HasLocation bool `json:"has_location"` - // True, if messages sent to the channel should contain information about the sender. This field is only applicable to channels + // True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels SignMessages bool `json:"sign_messages"` // True, if the slow mode is enabled in the supergroup IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` // True, if the supergroup is a channel IsChannel bool `json:"is_channel"` + // True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members + IsBroadcastGroup bool `json:"is_broadcast_group"` // True, if the supergroup or channel is verified IsVerified bool `json:"is_verified"` // If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted RestrictionReason string `json:"restriction_reason"` - // True, if many users reported this supergroup as a scam + // True, if many users reported this supergroup or channel as a scam IsScam bool `json:"is_scam"` + // True, if many users reported this supergroup or channel as a fake account + IsFake bool `json:"is_fake"` } func (entity *Supergroup) MarshalJSON() ([]byte, error) { @@ -4970,7 +5598,7 @@ func (*Supergroup) GetType() string { func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { var tmp struct { - Id int32 `json:"id"` + Id int64 `json:"id"` Username string `json:"username"` Date int32 `json:"date"` Status json.RawMessage `json:"status"` @@ -4980,9 +5608,11 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { SignMessages bool `json:"sign_messages"` IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` IsChannel bool `json:"is_channel"` + IsBroadcastGroup bool `json:"is_broadcast_group"` IsVerified bool `json:"is_verified"` RestrictionReason string `json:"restriction_reason"` IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` } err := json.Unmarshal(data, &tmp) @@ -4999,9 +5629,11 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { supergroup.SignMessages = tmp.SignMessages supergroup.IsSlowModeEnabled = tmp.IsSlowModeEnabled supergroup.IsChannel = tmp.IsChannel + supergroup.IsBroadcastGroup = tmp.IsBroadcastGroup supergroup.IsVerified = tmp.IsVerified supergroup.RestrictionReason = tmp.RestrictionReason supergroup.IsScam = tmp.IsScam + supergroup.IsFake = tmp.IsFake fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) supergroup.Status = fieldStatus @@ -5046,10 +5678,12 @@ type SupergroupFullInfo struct { StickerSetId JsonInt64 `json:"sticker_set_id"` // Location to which the supergroup is connected; may be null Location *ChatLocation `json:"location"` - // Invite link for this chat - InviteLink string `json:"invite_link"` + // Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only + InviteLink *ChatInviteLink `json:"invite_link"` + // List of commands of bots in the group + BotCommands []*BotCommands `json:"bot_commands"` // Identifier of the basic group from which supergroup was upgraded; 0 if none - UpgradedFromBasicGroupId int32 `json:"upgraded_from_basic_group_id"` + UpgradedFromBasicGroupId int64 `json:"upgraded_from_basic_group_id"` // Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none UpgradedFromMaxMessageId int64 `json:"upgraded_from_max_message_id"` } @@ -5151,16 +5785,14 @@ type SecretChat struct { // Secret chat identifier Id int32 `json:"id"` // Identifier of the chat partner - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // State of the secret chat State SecretChatState `json:"state"` // True, if the chat was created by the current user; otherwise false IsOutbound bool `json:"is_outbound"` - // Current message Time To Live setting (self-destruct timer) for the chat, in seconds - 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 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 + // Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101 Layer int32 `json:"layer"` } @@ -5183,10 +5815,9 @@ func (*SecretChat) GetType() string { func (secretChat *SecretChat) UnmarshalJSON(data []byte) error { var tmp struct { Id int32 `json:"id"` - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` State json.RawMessage `json:"state"` IsOutbound bool `json:"is_outbound"` - Ttl int32 `json:"ttl"` KeyHash []byte `json:"key_hash"` Layer int32 `json:"layer"` } @@ -5199,7 +5830,6 @@ func (secretChat *SecretChat) UnmarshalJSON(data []byte) error { secretChat.Id = tmp.Id secretChat.UserId = tmp.UserId secretChat.IsOutbound = tmp.IsOutbound - secretChat.Ttl = tmp.Ttl secretChat.KeyHash = tmp.KeyHash secretChat.Layer = tmp.Layer @@ -5213,7 +5843,7 @@ func (secretChat *SecretChat) UnmarshalJSON(data []byte) error { type MessageSenderUser struct { meta // Identifier of the user that sent the message - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } func (entity *MessageSenderUser) MarshalJSON() ([]byte, error) { @@ -5311,7 +5941,7 @@ func (messageSenders *MessageSenders) UnmarshalJSON(data []byte) error { type MessageForwardOriginUser struct { meta // Identifier of the user that originally sent the message - SenderUserId int32 `json:"sender_user_id"` + SenderUserId int64 `json:"sender_user_id"` } func (entity *MessageForwardOriginUser) MarshalJSON() ([]byte, error) { @@ -5334,12 +5964,12 @@ func (*MessageForwardOriginUser) MessageForwardOriginType() string { return TypeMessageForwardOriginUser } -// The message was originally sent by an anonymous chat administrator on behalf of the chat +// The message was originally sent on behalf of a chat type MessageForwardOriginChat struct { meta // Identifier of the chat that originally sent the message SenderChatId int64 `json:"sender_chat_id"` - // Original message author signature + // For messages originally sent by an anonymous chat administrator, original message author signature AuthorSignature string `json:"author_signature"` } @@ -5421,6 +6051,33 @@ func (*MessageForwardOriginChannel) MessageForwardOriginType() string { return TypeMessageForwardOriginChannel } +// The message was imported from an exported message history +type MessageForwardOriginMessageImport struct { + meta + // Name of the sender + SenderName string `json:"sender_name"` +} + +func (entity *MessageForwardOriginMessageImport) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForwardOriginMessageImport + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForwardOriginMessageImport) GetClass() string { + return ClassMessageForwardOrigin +} + +func (*MessageForwardOriginMessageImport) GetType() string { + return TypeMessageForwardOriginMessageImport +} + +func (*MessageForwardOriginMessageImport) MessageForwardOriginType() string { + return TypeMessageForwardOriginMessageImport +} + // Contains information about a forwarded message type MessageForwardInfo struct { meta @@ -5482,8 +6139,8 @@ 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"` + // Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available + RecentReplierIds []MessageSender `json:"recent_replier_ids"` // Identifier of the last read incoming reply to the message LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` // Identifier of the last read outgoing reply to the message @@ -5511,7 +6168,7 @@ func (*MessageReplyInfo) GetType() string { func (messageReplyInfo *MessageReplyInfo) UnmarshalJSON(data []byte) error { var tmp struct { ReplyCount int32 `json:"reply_count"` - RecentRepliers []json.RawMessage `json:"recent_repliers"` + RecentReplierIds []json.RawMessage `json:"recent_replier_ids"` LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` LastMessageId int64 `json:"last_message_id"` @@ -5527,8 +6184,8 @@ func (messageReplyInfo *MessageReplyInfo) UnmarshalJSON(data []byte) error { messageReplyInfo.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId messageReplyInfo.LastMessageId = tmp.LastMessageId - fieldRecentRepliers, _ := UnmarshalListOfMessageSender(tmp.RecentRepliers) - messageReplyInfo.RecentRepliers = fieldRecentRepliers + fieldRecentReplierIds, _ := UnmarshalListOfMessageSender(tmp.RecentReplierIds) + messageReplyInfo.RecentReplierIds = fieldRecentReplierIds return nil } @@ -5540,7 +6197,7 @@ type MessageInteractionInfo struct { 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 + // 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"` } @@ -5594,6 +6251,8 @@ type MessageSendingStateFailed struct { ErrorMessage string `json:"error_message"` // True, if the message can be re-sent CanRetry bool `json:"can_retry"` + // True, if the message can be re-sent only on behalf of a different sender + NeedAnotherSender bool `json:"need_another_sender"` // Time left before the message can be re-sent, in seconds. No update is sent when this field changes RetryAfter float64 `json:"retry_after"` } @@ -5623,13 +6282,13 @@ type Message struct { meta // Message identifier; unique for the chat to which the message belongs Id int64 `json:"id"` - // The sender of the message - Sender MessageSender `json:"sender"` + // Identifier of the sender of the message + SenderId MessageSender `json:"sender_id"` // Chat identifier ChatId int64 `json:"chat_id"` - // Information about the sending state of the message; may be null + // The sending state of the message; may be null SendingState MessageSendingState `json:"sending_state"` - // Information about the scheduling state of the message; may be null + // The scheduling state of the message; may be null SchedulingState MessageSchedulingState `json:"scheduling_state"` // True, if the message is outgoing IsOutgoing bool `json:"is_outgoing"` @@ -5639,6 +6298,8 @@ type Message struct { CanBeEdited bool `json:"can_be_edited"` // True, if the message can be forwarded CanBeForwarded bool `json:"can_be_forwarded"` + // True, if content of the message can be saved locally or copied + CanBeSaved bool `json:"can_be_saved"` // True, if the message can be deleted only for the current user while other users will continue to see it CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` // True, if the message can be deleted for all users @@ -5647,6 +6308,12 @@ type Message struct { CanGetStatistics bool `json:"can_get_statistics"` // True, if the message thread info is available CanGetMessageThread bool `json:"can_get_message_thread"` + // True, if chat members already viewed the message can be received through getMessageViewers + CanGetViewers bool `json:"can_get_viewers"` + // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description + CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` + // True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message + HasTimestampedMedia bool `json:"has_timestamped_media"` // 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 @@ -5667,13 +6334,13 @@ type Message struct { 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 + // Time left before the message expires, in seconds. If the TTL timer isn't started yet, equals to the value of the ttl field TtlExpiresIn float64 `json:"ttl_expires_in"` // If non-zero, the user identifier of the bot through which this message was sent - ViaBotUserId int32 `json:"via_bot_user_id"` + ViaBotUserId int64 `json:"via_bot_user_id"` // For channel posts and anonymous group messages, optional author signature AuthorSignature string `json:"author_signature"` - // Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums + // Unique identifier of an album this message belongs to. Only audios, documents, 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 RestrictionReason string `json:"restriction_reason"` @@ -5701,36 +6368,40 @@ func (*Message) GetType() string { func (message *Message) UnmarshalJSON(data []byte) error { var tmp struct { - 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"` + Id int64 `json:"id"` + SenderId json.RawMessage `json:"sender_id"` + 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"` + CanBeSaved bool `json:"can_be_saved"` + 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"` + CanGetViewers bool `json:"can_get_viewers"` + CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` + HasTimestampedMedia bool `json:"has_timestamped_media"` + 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 int64 `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) @@ -5744,10 +6415,14 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.IsPinned = tmp.IsPinned message.CanBeEdited = tmp.CanBeEdited message.CanBeForwarded = tmp.CanBeForwarded + message.CanBeSaved = tmp.CanBeSaved message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers message.CanGetStatistics = tmp.CanGetStatistics message.CanGetMessageThread = tmp.CanGetMessageThread + message.CanGetViewers = tmp.CanGetViewers + message.CanGetMediaTimestampLinks = tmp.CanGetMediaTimestampLinks + message.HasTimestampedMedia = tmp.HasTimestampedMedia message.IsChannelPost = tmp.IsChannelPost message.ContainsUnreadMention = tmp.ContainsUnreadMention message.Date = tmp.Date @@ -5764,8 +6439,8 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.MediaAlbumId = tmp.MediaAlbumId message.RestrictionReason = tmp.RestrictionReason - fieldSender, _ := UnmarshalMessageSender(tmp.Sender) - message.Sender = fieldSender + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + message.SenderId = fieldSenderId fieldSendingState, _ := UnmarshalMessageSendingState(tmp.SendingState) message.SendingState = fieldSendingState @@ -5834,6 +6509,162 @@ func (*FoundMessages) GetType() string { return TypeFoundMessages } +// Contains information about a message in a specific position +type MessagePosition struct { + meta + // 0-based message position in the full list of suitable messages + Position int32 `json:"position"` + // Message identifier + MessageId int64 `json:"message_id"` + // Point in time (Unix timestamp) when the message was sent + Date int32 `json:"date"` +} + +func (entity *MessagePosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePosition + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePosition) GetClass() string { + return ClassMessagePosition +} + +func (*MessagePosition) GetType() string { + return TypeMessagePosition +} + +// Contains a list of message positions +type MessagePositions struct { + meta + // Total count of messages found + TotalCount int32 `json:"total_count"` + // List of message positions + Positions []*MessagePosition `json:"positions"` +} + +func (entity *MessagePositions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePositions + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePositions) GetClass() string { + return ClassMessagePositions +} + +func (*MessagePositions) GetType() string { + return TypeMessagePositions +} + +// Contains information about found messages sent on a specific day +type MessageCalendarDay struct { + meta + // Total number of found messages sent on the day + TotalCount int32 `json:"total_count"` + // First message sent on the day + Message *Message `json:"message"` +} + +func (entity *MessageCalendarDay) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageCalendarDay + + return json.Marshal((*stub)(entity)) +} + +func (*MessageCalendarDay) GetClass() string { + return ClassMessageCalendarDay +} + +func (*MessageCalendarDay) GetType() string { + return TypeMessageCalendarDay +} + +// Contains information about found messages, split by days according to the option "utc_time_offset" +type MessageCalendar struct { + meta + // Total number of found messages + TotalCount int32 `json:"total_count"` + // Information about messages sent + Days []*MessageCalendarDay `json:"days"` +} + +func (entity *MessageCalendar) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageCalendar + + return json.Marshal((*stub)(entity)) +} + +func (*MessageCalendar) GetClass() string { + return ClassMessageCalendar +} + +func (*MessageCalendar) GetType() string { + return TypeMessageCalendar +} + +// Describes a sponsored message +type SponsoredMessage struct { + meta + // Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages + MessageId int64 `json:"message_id"` + // Chat identifier + SponsorChatId int64 `json:"sponsor_chat_id"` + // An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead + Link InternalLinkType `json:"link"` + // Content of the message. Currently, can be only of the type messageText + Content MessageContent `json:"content"` +} + +func (entity *SponsoredMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SponsoredMessage + + return json.Marshal((*stub)(entity)) +} + +func (*SponsoredMessage) GetClass() string { + return ClassSponsoredMessage +} + +func (*SponsoredMessage) GetType() string { + return TypeSponsoredMessage +} + +func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + MessageId int64 `json:"message_id"` + SponsorChatId int64 `json:"sponsor_chat_id"` + Link json.RawMessage `json:"link"` + Content json.RawMessage `json:"content"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + sponsoredMessage.MessageId = tmp.MessageId + sponsoredMessage.SponsorChatId = tmp.SponsorChatId + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + sponsoredMessage.Link = fieldLink + + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + sponsoredMessage.Content = fieldContent + + return nil +} + // Notification settings applied to all private and secret chats when the corresponding chat setting has a default value type NotificationSettingsScopePrivateChats struct { meta @@ -5922,7 +6753,7 @@ type ChatNotificationSettings struct { Sound string `json:"sound"` // If true, show_preview is ignored and the value for the relevant type of chat is used instead UseDefaultShowPreview bool `json:"use_default_show_preview"` - // True, if message content should be displayed in notifications + // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` // If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead UseDefaultDisablePinnedMessageNotifications bool `json:"use_default_disable_pinned_message_notifications"` @@ -5957,7 +6788,7 @@ type ScopeNotificationSettings struct { MuteFor int32 `json:"mute_for"` // The name of an audio file to be used for notification sounds; only applies to iOS applications Sound string `json:"sound"` - // True, if message content should be displayed in notifications + // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` // True, if notifications for incoming pinned messages will be created as for an ordinary unread message DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"` @@ -5988,7 +6819,7 @@ type DraftMessage struct { 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 + // Content of the message draft; must be of the type inputMessageText InputMessageText InputMessageContent `json:"input_message_text"` } @@ -6033,7 +6864,7 @@ func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { type ChatTypePrivate struct { meta // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } func (entity *ChatTypePrivate) MarshalJSON() ([]byte, error) { @@ -6056,11 +6887,11 @@ func (*ChatTypePrivate) ChatTypeType() string { return TypeChatTypePrivate } -// A basic group (i.e., a chat with 0-200 other users) +// A basic group (a chat with 0-200 other users) type ChatTypeBasicGroup struct { meta // Basic group identifier - BasicGroupId int32 `json:"basic_group_id"` + BasicGroupId int64 `json:"basic_group_id"` } func (entity *ChatTypeBasicGroup) MarshalJSON() ([]byte, error) { @@ -6083,11 +6914,11 @@ func (*ChatTypeBasicGroup) ChatTypeType() string { return TypeChatTypeBasicGroup } -// A supergroup (i.e. a chat with up to GetOption("supergroup_max_size") other users), or channel (with unlimited members) +// A supergroup or channel (with unlimited members) type ChatTypeSupergroup struct { meta // Supergroup or channel identifier - SupergroupId int32 `json:"supergroup_id"` + SupergroupId int64 `json:"supergroup_id"` // True, if the supergroup is a channel IsChannel bool `json:"is_channel"` } @@ -6118,7 +6949,7 @@ type ChatTypeSecret struct { // Secret chat identifier SecretChatId int32 `json:"secret_chat_id"` // User identifier of the secret chat peer - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } func (entity *ChatTypeSecret) MarshalJSON() ([]byte, error) { @@ -6146,7 +6977,7 @@ type ChatFilter struct { meta // The title of the filter; 1-12 characters without line feeds Title string `json:"title"` - // The icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". If empty, use getChatFilterDefaultIconName to get default icon name for the filter + // The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". If empty, use getChatFilterDefaultIconName to get default icon name for the filter IconName string `json:"icon_name"` // The chat identifiers of pinned chats in the filtered chat list PinnedChatIds []int64 `json:"pinned_chat_ids"` @@ -6195,7 +7026,7 @@ type ChatFilterInfo struct { Id int32 `json:"id"` // The title of the filter; 1-12 characters without line feeds Title string `json:"title"` - // The icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" + // The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" IconName string `json:"icon_name"` } @@ -6487,6 +7318,54 @@ func (chatPosition *ChatPosition) UnmarshalJSON(data []byte) error { return nil } +// Describes a video chat +type VideoChat struct { + meta + // Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` + // True, if the video chat has participants + HasParticipants bool `json:"has_participants"` + // Default group call participant identifier to join the video chat; may be null + DefaultParticipantId MessageSender `json:"default_participant_id"` +} + +func (entity *VideoChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub VideoChat + + return json.Marshal((*stub)(entity)) +} + +func (*VideoChat) GetClass() string { + return ClassVideoChat +} + +func (*VideoChat) GetType() string { + return TypeVideoChat +} + +func (videoChat *VideoChat) UnmarshalJSON(data []byte) error { + var tmp struct { + GroupCallId int32 `json:"group_call_id"` + HasParticipants bool `json:"has_participants"` + DefaultParticipantId json.RawMessage `json:"default_participant_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + videoChat.GroupCallId = tmp.GroupCallId + videoChat.HasParticipants = tmp.HasParticipants + + fieldDefaultParticipantId, _ := UnmarshalMessageSender(tmp.DefaultParticipantId) + videoChat.DefaultParticipantId = fieldDefaultParticipantId + + return nil +} + // A chat. (Can be a private chat, basic group, supergroup, or secret chat) type Chat struct { meta @@ -6504,6 +7383,10 @@ type Chat struct { LastMessage *Message `json:"last_message"` // Positions of the chat in chat lists Positions []*ChatPosition `json:"positions"` + // Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender + MessageSenderId MessageSender `json:"message_sender_id"` + // True, if chat content can't be saved locally, forwarded, or copied + HasProtectedContent bool `json:"has_protected_content"` // True, if the chat is marked as unread IsMarkedAsUnread bool `json:"is_marked_as_unread"` // True, if the chat is blocked by the current user and private messages from the chat can't be received @@ -6514,7 +7397,7 @@ type Chat struct { CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` // True, if the chat messages can be deleted for all users CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - // True, if the chat can be reported to Telegram moderators through reportChat + // True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto CanBeReported bool `json:"can_be_reported"` // Default value of the disable_notification parameter, used when a message is sent to the chat DefaultDisableNotification bool `json:"default_disable_notification"` @@ -6528,13 +7411,21 @@ type Chat struct { UnreadMentionCount int32 `json:"unread_mention_count"` // Notification settings for this chat NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - // Describes actions which should be possible to do through a chat action bar; may be null + // Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats + MessageTtl int32 `json:"message_ttl"` + // If non-empty, name of a theme, set for the chat + ThemeName string `json:"theme_name"` + // Information about actions which must be possible to do through the chat action bar; may be null ActionBar ChatActionBar `json:"action_bar"` + // Information about video chat of the chat + VideoChat *VideoChat `json:"video_chat"` + // Information about pending join requests; may be null + PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"` // 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 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 + // 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"` } @@ -6563,6 +7454,8 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { Permissions *ChatPermissions `json:"permissions"` LastMessage *Message `json:"last_message"` Positions []*ChatPosition `json:"positions"` + MessageSenderId json.RawMessage `json:"message_sender_id"` + HasProtectedContent bool `json:"has_protected_content"` IsMarkedAsUnread bool `json:"is_marked_as_unread"` IsBlocked bool `json:"is_blocked"` HasScheduledMessages bool `json:"has_scheduled_messages"` @@ -6575,7 +7468,11 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` UnreadMentionCount int32 `json:"unread_mention_count"` NotificationSettings *ChatNotificationSettings `json:"notification_settings"` + MessageTtl int32 `json:"message_ttl"` + ThemeName string `json:"theme_name"` ActionBar json.RawMessage `json:"action_bar"` + VideoChat *VideoChat `json:"video_chat"` + PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"` ReplyMarkupMessageId int64 `json:"reply_markup_message_id"` DraftMessage *DraftMessage `json:"draft_message"` ClientData string `json:"client_data"` @@ -6592,6 +7489,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.Permissions = tmp.Permissions chat.LastMessage = tmp.LastMessage chat.Positions = tmp.Positions + chat.HasProtectedContent = tmp.HasProtectedContent chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread chat.IsBlocked = tmp.IsBlocked chat.HasScheduledMessages = tmp.HasScheduledMessages @@ -6604,6 +7502,10 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId chat.UnreadMentionCount = tmp.UnreadMentionCount chat.NotificationSettings = tmp.NotificationSettings + chat.MessageTtl = tmp.MessageTtl + chat.ThemeName = tmp.ThemeName + chat.VideoChat = tmp.VideoChat + chat.PendingJoinRequests = tmp.PendingJoinRequests chat.ReplyMarkupMessageId = tmp.ReplyMarkupMessageId chat.DraftMessage = tmp.DraftMessage chat.ClientData = tmp.ClientData @@ -6611,6 +7513,9 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { fieldType, _ := UnmarshalChatType(tmp.Type) chat.Type = fieldType + fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) + chat.MessageSenderId = fieldMessageSenderId + fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) chat.ActionBar = fieldActionBar @@ -6692,97 +7597,6 @@ func (*ChatsNearby) GetType() string { return TypeChatsNearby } -// Contains a chat invite link -type ChatInviteLink struct { - meta - // Chat invite link - InviteLink string `json:"invite_link"` -} - -func (entity *ChatInviteLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatInviteLink - - return json.Marshal((*stub)(entity)) -} - -func (*ChatInviteLink) GetClass() string { - return ClassChatInviteLink -} - -func (*ChatInviteLink) GetType() string { - return TypeChatInviteLink -} - -// Contains information about a chat invite link -type ChatInviteLinkInfo struct { - meta - // 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 *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"` - // True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup - IsPublic bool `json:"is_public"` -} - -func (entity *ChatInviteLinkInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatInviteLinkInfo - - return json.Marshal((*stub)(entity)) -} - -func (*ChatInviteLinkInfo) GetClass() string { - return ClassChatInviteLinkInfo -} - -func (*ChatInviteLinkInfo) GetType() string { - return TypeChatInviteLinkInfo -} - -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 *ChatPhotoInfo `json:"photo"` - MemberCount int32 `json:"member_count"` - MemberUserIds []int32 `json:"member_user_ids"` - IsPublic bool `json:"is_public"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - chatInviteLinkInfo.ChatId = tmp.ChatId - chatInviteLinkInfo.AccessibleFor = tmp.AccessibleFor - chatInviteLinkInfo.Title = tmp.Title - chatInviteLinkInfo.Photo = tmp.Photo - chatInviteLinkInfo.MemberCount = tmp.MemberCount - chatInviteLinkInfo.MemberUserIds = tmp.MemberUserIds - chatInviteLinkInfo.IsPublic = tmp.IsPublic - - fieldType, _ := UnmarshalChatType(tmp.Type) - chatInviteLinkInfo.Type = fieldType - - return nil -} - // The chat is public, because it has username type PublicChatTypeHasUsername struct { meta @@ -6885,7 +7699,32 @@ 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 blocked using the method blockUser, or the other user can be added to the contact list using the method addContact +// The chat is a recently created group chat to which new members can be invited +type ChatActionBarInviteMembers struct { + meta +} + +func (entity *ChatActionBarInviteMembers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarInviteMembers + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarInviteMembers) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarInviteMembers) GetType() string { + return TypeChatActionBarInviteMembers +} + +func (*ChatActionBarInviteMembers) ChatActionBarType() string { + return TypeChatActionBarInviteMembers +} + +// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact 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 @@ -6964,7 +7803,38 @@ func (*ChatActionBarSharePhoneNumber) ChatActionBarType() string { return TypeChatActionBarSharePhoneNumber } -// A simple button, with text that should be sent when the button is pressed +// The chat is a private chat with an administrator of a chat to which the user sent join request +type ChatActionBarJoinRequest struct { + meta + // Title of the chat to which the join request was sent + Title string `json:"title"` + // True, if the join request was sent to a channel chat + IsChannel bool `json:"is_channel"` + // Point in time (Unix timestamp) when the join request was sent + RequestDate int32 `json:"request_date"` +} + +func (entity *ChatActionBarJoinRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarJoinRequest + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarJoinRequest) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarJoinRequest) GetType() string { + return TypeChatActionBarJoinRequest +} + +func (*ChatActionBarJoinRequest) ChatActionBarType() string { + return TypeChatActionBarJoinRequest +} + +// A simple button, with text that must be sent when the button is pressed type KeyboardButtonTypeText struct { meta } @@ -7139,13 +8009,13 @@ func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeUrl } -// A button that opens a specified URL and automatically logs in in current user if they allowed to do that +// A button that opens a specified URL and automatically authorize the current user if allowed to do so type InlineKeyboardButtonTypeLoginUrl struct { meta // An HTTP URL to open Url string `json:"url"` // Unique button identifier - Id int32 `json:"id"` + Id int64 `json:"id"` // If non-empty, new text of the button in forwarded messages ForwardText string `json:"forward_text"` } @@ -7254,7 +8124,7 @@ type InlineKeyboardButtonTypeSwitchInline struct { meta // Inline query to be sent to the bot Query string `json:"query"` - // True, if the inline query should be sent from the current chat + // True, if the inline query must be sent from the current chat InCurrentChat bool `json:"in_current_chat"` } @@ -7303,6 +8173,33 @@ func (*InlineKeyboardButtonTypeBuy) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeBuy } +// A button with a user reference to be handled in the same way as textEntityTypeMentionName entities +type InlineKeyboardButtonTypeUser struct { + meta + // User identifier + UserId int64 `json:"user_id"` +} + +func (entity *InlineKeyboardButtonTypeUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeUser + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeUser) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeUser) GetType() string { + return TypeInlineKeyboardButtonTypeUser +} + +func (*InlineKeyboardButtonTypeUser) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeUser +} + // Represents a single button in an inline keyboard type InlineKeyboardButton struct { meta @@ -7379,6 +8276,8 @@ 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 IsPersonal bool `json:"is_personal"` + // If non-empty, the placeholder to be shown in the input field when the reply is active; 0-64 characters + InputFieldPlaceholder string `json:"input_field_placeholder"` } func (entity *ReplyMarkupForceReply) MarshalJSON() ([]byte, error) { @@ -7412,6 +8311,8 @@ type ReplyMarkupShowKeyboard struct { 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"` + // If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters + InputFieldPlaceholder string `json:"input_field_placeholder"` } func (entity *ReplyMarkupShowKeyboard) MarshalJSON() ([]byte, error) { @@ -7498,7 +8399,7 @@ type LoginUrlInfoRequestConfirmation struct { // A domain of the URL Domain string `json:"domain"` // User identifier of a bot linked with the website - BotUserId int32 `json:"bot_user_id"` + BotUserId int64 `json:"bot_user_id"` // True, if the user needs to be requested to give the permission to the bot to send them messages RequestWriteAccess bool `json:"request_write_access"` } @@ -7530,8 +8431,10 @@ type MessageThreadInfo struct { ChatId int64 `json:"chat_id"` // Message thread identifier, unique within the chat MessageThreadId int64 `json:"message_thread_id"` - // Contains information about the message thread + // Information about the message thread ReplyInfo *MessageReplyInfo `json:"reply_info"` + // Approximate number of unread messages in the message thread + UnreadMessageCount int32 `json:"unread_message_count"` // The messages from which the thread starts. The messages are returned in 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 @@ -8078,9 +8981,9 @@ type RichTextIcon struct { meta // The image represented as a document. The image can be in GIF, JPEG or PNG format Document *Document `json:"document"` - // Width of a bounding box in which the image should be shown; 0 if unknown + // Width of a bounding box in which the image must be shown; 0 if unknown Width int32 `json:"width"` - // Height of a bounding box in which the image should be shown; 0 if unknown + // Height of a bounding box in which the image must be shown; 0 if unknown Height int32 `json:"height"` } @@ -8188,7 +9091,7 @@ 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 + // The anchor name. If the name is empty, the link must bring back to top AnchorName string `json:"anchor_name"` // An HTTP URL, opening the anchor Url string `json:"url"` @@ -8367,7 +9270,7 @@ func (pageBlockListItem *PageBlockListItem) UnmarshalJSON(data []byte) error { return nil } -// The content should be left-aligned +// The content must be left-aligned type PageBlockHorizontalAlignmentLeft struct { meta } @@ -8392,7 +9295,7 @@ func (*PageBlockHorizontalAlignmentLeft) PageBlockHorizontalAlignmentType() stri return TypePageBlockHorizontalAlignmentLeft } -// The content should be center-aligned +// The content must be center-aligned type PageBlockHorizontalAlignmentCenter struct { meta } @@ -8417,7 +9320,7 @@ func (*PageBlockHorizontalAlignmentCenter) PageBlockHorizontalAlignmentType() st return TypePageBlockHorizontalAlignmentCenter } -// The content should be right-aligned +// The content must be right-aligned type PageBlockHorizontalAlignmentRight struct { meta } @@ -8442,7 +9345,7 @@ func (*PageBlockHorizontalAlignmentRight) PageBlockHorizontalAlignmentType() str return TypePageBlockHorizontalAlignmentRight } -// The content should be top-aligned +// The content must be top-aligned type PageBlockVerticalAlignmentTop struct { meta } @@ -8467,7 +9370,7 @@ func (*PageBlockVerticalAlignmentTop) PageBlockVerticalAlignmentType() string { return TypePageBlockVerticalAlignmentTop } -// The content should be middle-aligned +// The content must be middle-aligned type PageBlockVerticalAlignmentMiddle struct { meta } @@ -8492,7 +9395,7 @@ func (*PageBlockVerticalAlignmentMiddle) PageBlockVerticalAlignmentType() string return TypePageBlockVerticalAlignmentMiddle } -// The content should be bottom-aligned +// The content must be bottom-aligned type PageBlockVerticalAlignmentBottom struct { meta } @@ -8520,13 +9423,13 @@ func (*PageBlockVerticalAlignmentBottom) PageBlockVerticalAlignmentType() string // Represents a cell of a table type PageBlockTableCell struct { meta - // Cell text; may be null. If the text is null, then the cell should be invisible + // Cell text; may be null. If the text is null, then the cell must be invisible Text RichText `json:"text"` // True, if it is a header cell IsHeader bool `json:"is_header"` - // The number of columns the cell should span + // The number of columns the cell spans Colspan int32 `json:"colspan"` - // The number of rows the cell should span + // The number of rows the cell spans Rowspan int32 `json:"rowspan"` // Horizontal cell content alignment Align PageBlockHorizontalAlignment `json:"align"` @@ -8925,7 +9828,7 @@ type PageBlockPreformatted struct { meta // Paragraph text Text RichText `json:"text"` - // Programming language for which the text should be formatted + // Programming language for which the text needs to be formatted Language string `json:"language"` } @@ -9195,7 +10098,7 @@ type PageBlockAnimation struct { Animation *Animation `json:"animation"` // Animation caption Caption *PageBlockCaption `json:"caption"` - // True, if the animation should be played automatically + // True, if the animation must be played automatically NeedAutoplay bool `json:"need_autoplay"` } @@ -9286,9 +10189,9 @@ type PageBlockVideo struct { Video *Video `json:"video"` // Video caption Caption *PageBlockCaption `json:"caption"` - // True, if the video should be played automatically + // True, if the video must be played automatically NeedAutoplay bool `json:"need_autoplay"` - // True, if the video should be looped + // True, if the video must be looped IsLooped bool `json:"is_looped"` } @@ -9399,9 +10302,9 @@ type PageBlockEmbedded struct { Height int32 `json:"height"` // Block caption Caption *PageBlockCaption `json:"caption"` - // True, if the block should be full width + // True, if the block must be full width IsFullWidth bool `json:"is_full_width"` - // True, if scrolling should be allowed + // True, if scrolling needs to be allowed AllowScrolling bool `json:"allow_scrolling"` } @@ -9592,7 +10495,7 @@ type PageBlockChatLink struct { Title string `json:"title"` // Chat photo; may be null Photo *ChatPhotoInfo `json:"photo"` - // Chat username, by which all other information about the chat should be resolved + // Chat username, by which all other information about the chat can be resolved Username string `json:"username"` } @@ -9816,12 +10719,14 @@ type WebPageInstantView struct { PageBlocks []PageBlock `json:"page_blocks"` // Number of the instant view views; 0 if unknown ViewCount int32 `json:"view_count"` - // Version of the instant view, currently can be 1 or 2 + // Version of the instant view; currently, can be 1 or 2 Version int32 `json:"version"` // True, if the instant view must be shown from right to left IsRtl bool `json:"is_rtl"` // True, if the instant view contains the full page. A network request might be needed to get the full web page instant view IsFull bool `json:"is_full"` + // An internal link to be opened to leave feedback about the instant view + FeedbackLink InternalLinkType `json:"feedback_link"` } func (entity *WebPageInstantView) MarshalJSON() ([]byte, error) { @@ -9842,11 +10747,12 @@ func (*WebPageInstantView) GetType() string { func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error { var tmp struct { - PageBlocks []json.RawMessage `json:"page_blocks"` - ViewCount int32 `json:"view_count"` - Version int32 `json:"version"` - IsRtl bool `json:"is_rtl"` - IsFull bool `json:"is_full"` + PageBlocks []json.RawMessage `json:"page_blocks"` + ViewCount int32 `json:"view_count"` + Version int32 `json:"version"` + IsRtl bool `json:"is_rtl"` + IsFull bool `json:"is_full"` + FeedbackLink json.RawMessage `json:"feedback_link"` } err := json.Unmarshal(data, &tmp) @@ -9862,6 +10768,9 @@ func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error { fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) webPageInstantView.PageBlocks = fieldPageBlocks + fieldFeedbackLink, _ := UnmarshalInternalLinkType(tmp.FeedbackLink) + webPageInstantView.FeedbackLink = fieldFeedbackLink + return nil } @@ -9898,7 +10807,7 @@ type WebPage struct { Animation *Animation `json:"animation"` // Preview of the content as an audio file, if available; may be null Audio *Audio `json:"audio"` - // Preview of the content as a document, if available (currently only available for small PDF files and ZIP archives); may be null + // Preview of the content as a document, if available; may be null Document *Document `json:"document"` // Preview of the content as a sticker for small WEBP files, if available; may be null Sticker *Sticker `json:"sticker"` @@ -9908,7 +10817,7 @@ type WebPage struct { VideoNote *VideoNote `json:"video_note"` // Preview of the content as a voice note, if available; may be null VoiceNote *VoiceNote `json:"voice_note"` - // Version of instant view, available for the web page (currently can be 1 or 2), 0 if none + // Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none InstantViewVersion int32 `json:"instant_view_version"` } @@ -9937,7 +10846,7 @@ type CountryInfo struct { 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 + // True, if the country must be hidden from the list of all countries IsHidden bool `json:"is_hidden"` // List of country calling codes CallingCodes []string `json:"calling_codes"` @@ -9989,7 +10898,7 @@ type PhoneNumberInfo struct { 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 + // The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user FormattedPhoneNumber string `json:"formatted_phone_number"` } @@ -10097,7 +11006,7 @@ type LabeledPricePart struct { meta // Label for this portion of the product price Label string `json:"label"` - // Currency amount in minimal quantity of the currency + // Currency amount in the smallest units of the currency Amount int64 `json:"amount"` } @@ -10124,6 +11033,10 @@ type Invoice struct { Currency string `json:"currency"` // A list of objects used to calculate the total price of the product PriceParts []*LabeledPricePart `json:"price_parts"` + // The maximum allowed amount of tip in the smallest units of the currency + MaxTipAmount int64 `json:"max_tip_amount"` + // Suggested amounts of tip in the smallest units of the currency + SuggestedTipAmounts []int64 `json:"suggested_tip_amounts"` // True, if the payment is a test payment IsTest bool `json:"is_test"` // True, if the user's name is needed for payment @@ -10269,7 +11182,7 @@ func (*InputCredentialsSaved) InputCredentialsType() string { // Applies if a user enters new credentials on a payment provider website type InputCredentialsNew struct { meta - // Contains JSON-encoded data with a credential identifier from the payment provider + // JSON-encoded data with the credential identifier from the payment provider Data string `json:"data"` // True, if the credential identifier can be saved on the server side AllowSave bool `json:"allow_save"` @@ -10295,33 +11208,6 @@ func (*InputCredentialsNew) InputCredentialsType() string { return TypeInputCredentialsNew } -// Applies if a user enters new credentials using Android Pay -type InputCredentialsAndroidPay struct { - meta - // JSON-encoded data with the credential identifier - Data string `json:"data"` -} - -func (entity *InputCredentialsAndroidPay) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputCredentialsAndroidPay - - return json.Marshal((*stub)(entity)) -} - -func (*InputCredentialsAndroidPay) GetClass() string { - return ClassInputCredentials -} - -func (*InputCredentialsAndroidPay) GetType() string { - return TypeInputCredentialsAndroidPay -} - -func (*InputCredentialsAndroidPay) InputCredentialsType() string { - return TypeInputCredentialsAndroidPay -} - // Applies if a user enters new credentials using Apple Pay type InputCredentialsApplePay struct { meta @@ -10349,6 +11235,33 @@ func (*InputCredentialsApplePay) InputCredentialsType() string { return TypeInputCredentialsApplePay } +// Applies if a user enters new credentials using Google Pay +type InputCredentialsGooglePay struct { + meta + // JSON-encoded data with the credential identifier + Data string `json:"data"` +} + +func (entity *InputCredentialsGooglePay) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputCredentialsGooglePay + + return json.Marshal((*stub)(entity)) +} + +func (*InputCredentialsGooglePay) GetClass() string { + return ClassInputCredentials +} + +func (*InputCredentialsGooglePay) GetType() string { + return TypeInputCredentialsGooglePay +} + +func (*InputCredentialsGooglePay) InputCredentialsType() string { + return TypeInputCredentialsGooglePay +} + // Stripe payment provider type PaymentsProviderStripe struct { meta @@ -10378,18 +11291,57 @@ func (*PaymentsProviderStripe) GetType() string { return TypePaymentsProviderStripe } +// Theme colors for a payment form +type PaymentFormTheme struct { + meta + // A color of the payment form background in the RGB24 format + BackgroundColor int32 `json:"background_color"` + // A color of text in the RGB24 format + TextColor int32 `json:"text_color"` + // A color of hints in the RGB24 format + HintColor int32 `json:"hint_color"` + // A color of links in the RGB24 format + LinkColor int32 `json:"link_color"` + // A color of the buttons in the RGB24 format + ButtonColor int32 `json:"button_color"` + // A color of text on the buttons in the RGB24 format + ButtonTextColor int32 `json:"button_text_color"` +} + +func (entity *PaymentFormTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentFormTheme + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentFormTheme) GetClass() string { + return ClassPaymentFormTheme +} + +func (*PaymentFormTheme) GetType() string { + return TypePaymentFormTheme +} + // Contains information about an invoice payment form type PaymentForm struct { meta + // The payment form identifier + Id JsonInt64 `json:"id"` // Full information of the invoice Invoice *Invoice `json:"invoice"` // Payment form URL Url string `json:"url"` - // Contains information about the payment provider, if available, to support it natively without the need for opening the URL; may be null + // User identifier of the seller bot + SellerBotUserId int64 `json:"seller_bot_user_id"` + // User identifier of the payment provider bot + PaymentsProviderUserId int64 `json:"payments_provider_user_id"` + // Information about the payment provider, if available, to support it natively without the need for opening the URL; may be null PaymentsProvider *PaymentsProviderStripe `json:"payments_provider"` // Saved server-side order information; may be null SavedOrderInfo *OrderInfo `json:"saved_order_info"` - // Contains information about saved card credentials; may be null + // Information about saved card credentials; may be null SavedCredentials *SavedCredentials `json:"saved_credentials"` // True, if the user can choose to save credentials CanSaveCredentials bool `json:"can_save_credentials"` @@ -10441,7 +11393,7 @@ func (*ValidatedOrderInfo) GetType() string { // Contains the result of a payment request type PaymentResult struct { meta - // True, if the payment request was successful; otherwise the verification_url will be not empty + // True, if the payment request was successful; otherwise the verification_url will be non-empty Success bool `json:"success"` // URL for additional payment credentials verification VerificationUrl string `json:"verification_url"` @@ -10466,18 +11418,28 @@ func (*PaymentResult) GetType() string { // Contains information about a successful payment type PaymentReceipt struct { meta + // Product title + Title string `json:"title"` + // Product description + Description string `json:"description"` + // Product photo; may be null + Photo *Photo `json:"photo"` // Point in time (Unix timestamp) when the payment was made Date int32 `json:"date"` + // User identifier of the seller bot + SellerBotUserId int64 `json:"seller_bot_user_id"` // User identifier of the payment provider bot - PaymentsProviderUserId int32 `json:"payments_provider_user_id"` - // Contains information about the invoice + PaymentsProviderUserId int64 `json:"payments_provider_user_id"` + // Information about the invoice Invoice *Invoice `json:"invoice"` - // Contains order information; may be null + // Order information; may be null OrderInfo *OrderInfo `json:"order_info"` // Chosen shipping option; may be null ShippingOption *ShippingOption `json:"shipping_option"` - // Title of the saved credentials + // Title of the saved credentials chosen by the buyer CredentialsTitle string `json:"credentials_title"` + // The amount of tip chosen by the buyer in the smallest units of the currency + TipAmount int64 `json:"tip_amount"` } func (entity *PaymentReceipt) MarshalJSON() ([]byte, error) { @@ -10849,11 +11811,11 @@ func (*PassportElementTypeEmailAddress) PassportElementTypeType() string { // Represents a date according to the Gregorian calendar type Date struct { meta - // Day of the month, 1-31 + // Day of the month; 1-31 Day int32 `json:"day"` - // Month, 1-12 + // Month; 1-12 Month int32 `json:"month"` - // Year, 1-9999 + // Year; 1-9999 Year int32 `json:"year"` } @@ -10919,11 +11881,11 @@ type IdentityDocument struct { meta // Document number; 1-24 characters Number string `json:"number"` - // Document expiry date; may be null + // Document expiry date; may be null if not applicable ExpiryDate *Date `json:"expiry_date"` // Front side of the document FrontSide *DatedFile `json:"front_side"` - // Reverse side of the document; only for driver license and identity card + // Reverse side of the document; only for driver license and identity card; may be null ReverseSide *DatedFile `json:"reverse_side"` // Selfie with the document; may be null Selfie *DatedFile `json:"selfie"` @@ -10952,13 +11914,13 @@ type InputIdentityDocument struct { meta // Document number; 1-24 characters Number string `json:"number"` - // Document expiry date, if available + // Document expiry date; pass null if not applicable ExpiryDate *Date `json:"expiry_date"` // Front side of the document FrontSide InputFile `json:"front_side"` - // Reverse side of the document; only for driver license and identity card + // Reverse side of the document; only for driver license and identity card; pass null otherwise ReverseSide InputFile `json:"reverse_side"` - // Selfie with the document, if available + // Selfie with the document; pass null if unavailable Selfie InputFile `json:"selfie"` // List of files containing a certified English translation of the document Translation []InputFile `json:"translation"` @@ -12185,7 +13147,7 @@ type PassportAuthorizationForm struct { meta // Unique identifier of the authorization form Id int32 `json:"id"` - // Information about the Telegram Passport elements that must be provided to complete the form + // 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"` @@ -13053,6 +14015,35 @@ func (*MessageContact) MessageContentType() string { return TypeMessageContact } +// A message with an animated emoji +type MessageAnimatedEmoji struct { + meta + // The animated emoji + AnimatedEmoji *AnimatedEmoji `json:"animated_emoji"` + // The corresponding emoji + Emoji string `json:"emoji"` +} + +func (entity *MessageAnimatedEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageAnimatedEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*MessageAnimatedEmoji) GetClass() string { + return ClassMessageContent +} + +func (*MessageAnimatedEmoji) GetType() string { + return TypeMessageAnimatedEmoji +} + +func (*MessageAnimatedEmoji) MessageContentType() string { + return TypeMessageAnimatedEmoji +} + // A dice message. The dice value is randomly generated by the server type MessageDice struct { meta @@ -13180,13 +14171,13 @@ type MessageInvoice struct { Photo *Photo `json:"photo"` // Currency for the product price Currency string `json:"currency"` - // Product total price in the minimal quantity of the currency + // Product total price in the smallest units of the currency TotalAmount int64 `json:"total_amount"` // Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter} StartParameter string `json:"start_parameter"` // True, if the invoice is a test invoice IsTest bool `json:"is_test"` - // True, if the shipping address should be specified + // True, if the shipping address must be specified NeedShippingAddress bool `json:"need_shipping_address"` // The identifier of the message with the receipt, after the product has been purchased ReceiptMessageId int64 `json:"receipt_message_id"` @@ -13264,13 +14255,125 @@ func (messageCall *MessageCall) UnmarshalJSON(data []byte) error { return nil } +// A new video chat was scheduled +type MessageVideoChatScheduled struct { + meta + // Identifier of the video chat. The video chat can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` + // Point in time (Unix timestamp) when the group call is supposed to be started by an administrator + StartDate int32 `json:"start_date"` +} + +func (entity *MessageVideoChatScheduled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageVideoChatScheduled + + return json.Marshal((*stub)(entity)) +} + +func (*MessageVideoChatScheduled) GetClass() string { + return ClassMessageContent +} + +func (*MessageVideoChatScheduled) GetType() string { + return TypeMessageVideoChatScheduled +} + +func (*MessageVideoChatScheduled) MessageContentType() string { + return TypeMessageVideoChatScheduled +} + +// A newly created video chat +type MessageVideoChatStarted struct { + meta + // Identifier of the video chat. The video chat can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` +} + +func (entity *MessageVideoChatStarted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageVideoChatStarted + + return json.Marshal((*stub)(entity)) +} + +func (*MessageVideoChatStarted) GetClass() string { + return ClassMessageContent +} + +func (*MessageVideoChatStarted) GetType() string { + return TypeMessageVideoChatStarted +} + +func (*MessageVideoChatStarted) MessageContentType() string { + return TypeMessageVideoChatStarted +} + +// A message with information about an ended video chat +type MessageVideoChatEnded struct { + meta + // Call duration, in seconds + Duration int32 `json:"duration"` +} + +func (entity *MessageVideoChatEnded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageVideoChatEnded + + return json.Marshal((*stub)(entity)) +} + +func (*MessageVideoChatEnded) GetClass() string { + return ClassMessageContent +} + +func (*MessageVideoChatEnded) GetType() string { + return TypeMessageVideoChatEnded +} + +func (*MessageVideoChatEnded) MessageContentType() string { + return TypeMessageVideoChatEnded +} + +// A message with information about an invite to a video chat +type MessageInviteVideoChatParticipants struct { + meta + // Identifier of the video chat. The video chat can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` + // Invited user identifiers + UserIds []int64 `json:"user_ids"` +} + +func (entity *MessageInviteVideoChatParticipants) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageInviteVideoChatParticipants + + return json.Marshal((*stub)(entity)) +} + +func (*MessageInviteVideoChatParticipants) GetClass() string { + return ClassMessageContent +} + +func (*MessageInviteVideoChatParticipants) GetType() string { + return TypeMessageInviteVideoChatParticipants +} + +func (*MessageInviteVideoChatParticipants) MessageContentType() string { + return TypeMessageInviteVideoChatParticipants +} + // A newly created basic group type MessageBasicGroupChatCreate struct { meta // Title of the basic group Title string `json:"title"` // User identifiers of members in the basic group - MemberUserIds []int32 `json:"member_user_ids"` + MemberUserIds []int64 `json:"member_user_ids"` } func (entity *MessageBasicGroupChatCreate) MarshalJSON() ([]byte, error) { @@ -13403,7 +14506,7 @@ func (*MessageChatDeletePhoto) MessageContentType() string { type MessageChatAddMembers struct { meta // User identifiers of the new members - MemberUserIds []int32 `json:"member_user_ids"` + MemberUserIds []int64 `json:"member_user_ids"` } func (entity *MessageChatAddMembers) MarshalJSON() ([]byte, error) { @@ -13426,7 +14529,7 @@ func (*MessageChatAddMembers) MessageContentType() string { return TypeMessageChatAddMembers } -// A new member joined the chat by invite link +// A new member joined the chat via an invite link type MessageChatJoinByLink struct { meta } @@ -13451,11 +14554,36 @@ func (*MessageChatJoinByLink) MessageContentType() string { return TypeMessageChatJoinByLink } +// A new member was accepted to the chat by an administrator +type MessageChatJoinByRequest struct { + meta +} + +func (entity *MessageChatJoinByRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatJoinByRequest + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatJoinByRequest) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatJoinByRequest) GetType() string { + return TypeMessageChatJoinByRequest +} + +func (*MessageChatJoinByRequest) MessageContentType() string { + return TypeMessageChatJoinByRequest +} + // A chat member was deleted type MessageChatDeleteMember struct { meta // User identifier of the deleted chat member - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } func (entity *MessageChatDeleteMember) MarshalJSON() ([]byte, error) { @@ -13482,7 +14610,7 @@ func (*MessageChatDeleteMember) MessageContentType() string { type MessageChatUpgradeTo struct { meta // Identifier of the supergroup to which the basic group was upgraded - SupergroupId int32 `json:"supergroup_id"` + SupergroupId int64 `json:"supergroup_id"` } func (entity *MessageChatUpgradeTo) MarshalJSON() ([]byte, error) { @@ -13511,7 +14639,7 @@ type MessageChatUpgradeFrom struct { // Title of the newly created supergroup Title string `json:"title"` // The identifier of the original basic group - BasicGroupId int32 `json:"basic_group_id"` + BasicGroupId int64 `json:"basic_group_id"` } func (entity *MessageChatUpgradeFrom) MarshalJSON() ([]byte, error) { @@ -13586,10 +14714,37 @@ func (*MessageScreenshotTaken) MessageContentType() string { return TypeMessageScreenshotTaken } -// The TTL (Time To Live) setting messages in a secret chat has been changed +// A theme in the chat has been changed +type MessageChatSetTheme struct { + meta + // If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one + ThemeName string `json:"theme_name"` +} + +func (entity *MessageChatSetTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatSetTheme + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatSetTheme) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatSetTheme) GetType() string { + return TypeMessageChatSetTheme +} + +func (*MessageChatSetTheme) MessageContentType() string { + return TypeMessageChatSetTheme +} + +// The TTL (Time To Live) setting for messages in the chat has been changed type MessageChatSetTtl struct { meta - // New TTL + // New message TTL Ttl int32 `json:"ttl"` } @@ -13674,11 +14829,13 @@ func (*MessageGameScore) MessageContentType() string { // A payment has been completed type MessagePaymentSuccessful struct { meta + // Identifier of the chat, containing the corresponding invoice message; 0 if unknown + InvoiceChatId int64 `json:"invoice_chat_id"` // Identifier of the message with the corresponding invoice; can be an identifier of a deleted message InvoiceMessageId int64 `json:"invoice_message_id"` // Currency for the price of the product Currency string `json:"currency"` - // Total price for the product, in the minimal quantity of the currency + // Total price for the product, in the smallest units of the currency TotalAmount int64 `json:"total_amount"` } @@ -13705,11 +14862,9 @@ func (*MessagePaymentSuccessful) MessageContentType() string { // A payment has been completed; for bots only type MessagePaymentSuccessfulBot struct { meta - // Identifier of the message with the corresponding invoice; can be an identifier of a deleted message - InvoiceMessageId int64 `json:"invoice_message_id"` // Currency for price of the product Currency string `json:"currency"` - // Total price for the product, in the minimal quantity of the currency + // Total price for the product, in the smallest units of the currency TotalAmount int64 `json:"total_amount"` // Invoice payload InvoicePayload []byte `json:"invoice_payload"` @@ -13870,10 +15025,10 @@ func (*MessagePassportDataReceived) MessageContentType() string { // 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 identifier of a user or chat that triggered the proximity alert + TravelerId MessageSender `json:"traveler_id"` + // The identifier of a user or chat that subscribed for the proximity alert + WatcherId MessageSender `json:"watcher_id"` // The distance between the users Distance int32 `json:"distance"` } @@ -13900,9 +15055,9 @@ func (*MessageProximityAlertTriggered) MessageContentType() string { func (messageProximityAlertTriggered *MessageProximityAlertTriggered) UnmarshalJSON(data []byte) error { var tmp struct { - Traveler json.RawMessage `json:"traveler"` - Watcher json.RawMessage `json:"watcher"` - Distance int32 `json:"distance"` + TravelerId json.RawMessage `json:"traveler_id"` + WatcherId json.RawMessage `json:"watcher_id"` + Distance int32 `json:"distance"` } err := json.Unmarshal(data, &tmp) @@ -13912,11 +15067,11 @@ func (messageProximityAlertTriggered *MessageProximityAlertTriggered) UnmarshalJ messageProximityAlertTriggered.Distance = tmp.Distance - fieldTraveler, _ := UnmarshalMessageSender(tmp.Traveler) - messageProximityAlertTriggered.Traveler = fieldTraveler + fieldTravelerId, _ := UnmarshalMessageSender(tmp.TravelerId) + messageProximityAlertTriggered.TravelerId = fieldTravelerId - fieldWatcher, _ := UnmarshalMessageSender(tmp.Watcher) - messageProximityAlertTriggered.Watcher = fieldWatcher + fieldWatcherId, _ := UnmarshalMessageSender(tmp.WatcherId) + messageProximityAlertTriggered.WatcherId = fieldWatcherId return nil } @@ -13996,7 +15151,7 @@ func (*TextEntityTypeHashtag) TextEntityTypeType() string { return TypeTextEntityTypeHashtag } -// A cashtag text, beginning with "$" and consisting of capital english letters (i.e. "$USD") +// A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD") type TextEntityTypeCashtag struct { meta } @@ -14021,7 +15176,7 @@ func (*TextEntityTypeCashtag) TextEntityTypeType() string { return TypeTextEntityTypeCashtag } -// A bot command, beginning with "/". This shouldn't be highlighted if there are no bots in the chat +// A bot command, beginning with "/" type TextEntityTypeBotCommand struct { meta } @@ -14354,7 +15509,7 @@ func (*TextEntityTypeTextUrl) TextEntityTypeType() string { type TextEntityTypeMentionName struct { meta // Identifier of the mentioned user - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } func (entity *TextEntityTypeMentionName) MarshalJSON() ([]byte, error) { @@ -14377,6 +15532,33 @@ func (*TextEntityTypeMentionName) TextEntityTypeType() string { return TypeTextEntityTypeMentionName } +// A media timestamp +type TextEntityTypeMediaTimestamp struct { + meta + // Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message + MediaTimestamp int32 `json:"media_timestamp"` +} + +func (entity *TextEntityTypeMediaTimestamp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeMediaTimestamp + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeMediaTimestamp) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeMediaTimestamp) GetType() string { + return TypeTextEntityTypeMediaTimestamp +} + +func (*TextEntityTypeMediaTimestamp) TextEntityTypeType() string { + return TypeTextEntityTypeMediaTimestamp +} + // 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 @@ -14484,7 +15666,7 @@ type MessageSendOptions struct { DisableNotification bool `json:"disable_notification"` // Pass true if the message is sent from the background FromBackground bool `json:"from_background"` - // Message scheduling state. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled + // Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled SchedulingState MessageSchedulingState `json:"scheduling_state"` } @@ -14525,14 +15707,14 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { return nil } -// Options to be used when a message content is copied without a link to the original message +// Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied 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 + // True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local 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 + // New message caption; pass null to copy message without caption. Ignored if replace_caption is false NewCaption *FormattedText `json:"new_caption"` } @@ -14557,9 +15739,9 @@ type InputMessageText struct { meta // Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually Text *FormattedText `json:"text"` - // True, if rich web page previews for URLs in the message text should be disabled + // True, if rich web page previews for URLs in the message text must be disabled DisableWebPagePreview bool `json:"disable_web_page_preview"` - // True, if a chat message draft should be deleted + // True, if a chat message draft must be deleted ClearDraft bool `json:"clear_draft"` } @@ -14588,7 +15770,7 @@ type InputMessageAnimation struct { meta // Animation file to be sent Animation InputFile `json:"animation"` - // Animation thumbnail, if available + // Animation thumbnail; pass null to skip thumbnail uploading Thumbnail *InputThumbnail `json:"thumbnail"` // File identifiers of the stickers added to the animation, if applicable AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` @@ -14598,7 +15780,7 @@ type InputMessageAnimation struct { Width int32 `json:"width"` // Height of the animation; may be replaced by the server Height int32 `json:"height"` - // Animation caption; 0-GetOption("message_caption_length_max") characters + // Animation caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -14656,7 +15838,7 @@ type InputMessageAudio struct { meta // Audio file to be sent Audio InputFile `json:"audio"` - // Thumbnail of the cover for the album, if available + // Thumbnail of the cover for the album; pass null to skip thumbnail uploading AlbumCoverThumbnail *InputThumbnail `json:"album_cover_thumbnail"` // Duration of the audio, in seconds; may be replaced by the server Duration int32 `json:"duration"` @@ -14664,7 +15846,7 @@ type InputMessageAudio struct { Title string `json:"title"` // Performer of the audio; 0-64 characters, may be replaced by the server Performer string `json:"performer"` - // Audio caption; 0-GetOption("message_caption_length_max") characters + // Audio caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -14720,11 +15902,11 @@ type InputMessageDocument struct { meta // Document to be sent Document InputFile `json:"document"` - // Document thumbnail, if available + // Document thumbnail; pass null to skip thumbnail uploading Thumbnail *InputThumbnail `json:"thumbnail"` // If true, automatic file type detection will be disabled and the document will be always sent as file. Always true for files sent to secret chats DisableContentTypeDetection bool `json:"disable_content_type_detection"` - // Document caption; 0-GetOption("message_caption_length_max") characters + // Document caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -14776,7 +15958,7 @@ type InputMessagePhoto struct { meta // Photo to send Photo InputFile `json:"photo"` - // Photo thumbnail to be sent, this is sent to the other party in secret chats only + // Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats Thumbnail *InputThumbnail `json:"thumbnail"` // File identifiers of the stickers added to the photo, if applicable AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` @@ -14784,7 +15966,7 @@ type InputMessagePhoto struct { Width int32 `json:"width"` // Photo height Height int32 `json:"height"` - // Photo caption; 0-GetOption("message_caption_length_max") characters + // Photo caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` // Photo TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats Ttl int32 `json:"ttl"` @@ -14844,12 +16026,14 @@ type InputMessageSticker struct { meta // Sticker to be sent Sticker InputFile `json:"sticker"` - // Sticker thumbnail, if available + // Sticker thumbnail; pass null to skip thumbnail uploading Thumbnail *InputThumbnail `json:"thumbnail"` // Sticker width Width int32 `json:"width"` // Sticker height Height int32 `json:"height"` + // Emoji used to choose the sticker + Emoji string `json:"emoji"` } func (entity *InputMessageSticker) MarshalJSON() ([]byte, error) { @@ -14878,6 +16062,7 @@ func (inputMessageSticker *InputMessageSticker) UnmarshalJSON(data []byte) error Thumbnail *InputThumbnail `json:"thumbnail"` Width int32 `json:"width"` Height int32 `json:"height"` + Emoji string `json:"emoji"` } err := json.Unmarshal(data, &tmp) @@ -14888,6 +16073,7 @@ func (inputMessageSticker *InputMessageSticker) UnmarshalJSON(data []byte) error inputMessageSticker.Thumbnail = tmp.Thumbnail inputMessageSticker.Width = tmp.Width inputMessageSticker.Height = tmp.Height + inputMessageSticker.Emoji = tmp.Emoji fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) inputMessageSticker.Sticker = fieldSticker @@ -14900,7 +16086,7 @@ type InputMessageVideo struct { meta // Video to be sent Video InputFile `json:"video"` - // Video thumbnail, if available + // Video thumbnail; pass null to skip thumbnail uploading Thumbnail *InputThumbnail `json:"thumbnail"` // File identifiers of the stickers added to the video, if applicable AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` @@ -14910,9 +16096,9 @@ type InputMessageVideo struct { Width int32 `json:"width"` // Video height Height int32 `json:"height"` - // True, if the video should be tried to be streamed + // True, if the video is supposed to be streamed SupportsStreaming bool `json:"supports_streaming"` - // Video caption; 0-GetOption("message_caption_length_max") characters + // Video caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` // Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats Ttl int32 `json:"ttl"` @@ -14976,7 +16162,7 @@ type InputMessageVideoNote struct { meta // Video note to be sent VideoNote InputFile `json:"video_note"` - // Video thumbnail, if available + // Video thumbnail; pass null to skip thumbnail uploading Thumbnail *InputThumbnail `json:"thumbnail"` // Duration of the video, in seconds Duration int32 `json:"duration"` @@ -15036,7 +16222,7 @@ type InputMessageVoiceNote struct { Duration int32 `json:"duration"` // Waveform representation of the voice note, in 5-bit format Waveform []byte `json:"waveform"` - // Voice note caption; 0-GetOption("message_caption_length_max") characters + // Voice note caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -15088,7 +16274,7 @@ type InputMessageLocation struct { meta // Location to be sent 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 + // Period for which the location can be updated, in seconds; must 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"` @@ -15175,7 +16361,7 @@ 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 + // True, if the chat message draft must be deleted ClearDraft bool `json:"clear_draft"` } @@ -15203,7 +16389,7 @@ func (*InputMessageDice) InputMessageContentType() string { type InputMessageGame struct { meta // User identifier of the bot that owns the game - BotUserId int32 `json:"bot_user_id"` + BotUserId int64 `json:"bot_user_id"` // Short name of the game GameShortName string `json:"game_short_name"` } @@ -15228,7 +16414,7 @@ func (*InputMessageGame) InputMessageContentType() string { return TypeInputMessageGame } -// A message with an invoice; can be used only by bots and only in private chats +// A message with an invoice; can be used only by bots type InputMessageInvoice struct { meta // Invoice @@ -15251,7 +16437,7 @@ type InputMessageInvoice struct { ProviderToken string `json:"provider_token"` // JSON-encoded data about the invoice, which will be shared with the payment provider ProviderData string `json:"provider_data"` - // Unique invoice bot start_parameter for the generation of this invoice + // Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message StartParameter string `json:"start_parameter"` } @@ -15278,7 +16464,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 (up to 300 characters for bots) + // 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"` @@ -15288,7 +16474,7 @@ type InputMessagePoll struct { 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 + // Point in time (Unix timestamp) when the poll will automatically be 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"` @@ -15350,9 +16536,9 @@ type InputMessageForwarded struct { FromChatId int64 `json:"from_chat_id"` // Identifier of the message to forward MessageId int64 `json:"message_id"` - // True, if a game message should be shared within a launched game; applies only to game messages + // True, if a game message is being shared from a launched game; applies only to game messages InGameShare bool `json:"in_game_share"` - // Options to be used to copy content of the message without a link to the original message + // Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual CopyOptions *MessageCopyOptions `json:"copy_options"` } @@ -15626,56 +16812,6 @@ func (*SearchMessagesFilterChatPhoto) SearchMessagesFilterType() string { return TypeSearchMessagesFilterChatPhoto } -// Returns only call messages -type SearchMessagesFilterCall struct { - meta -} - -func (entity *SearchMessagesFilterCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterCall - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterCall) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterCall) GetType() string { - return TypeSearchMessagesFilterCall -} - -func (*SearchMessagesFilterCall) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterCall -} - -// Returns only incoming call messages with missed/declined discard reasons -type SearchMessagesFilterMissedCall struct { - meta -} - -func (entity *SearchMessagesFilterMissedCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterMissedCall - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterMissedCall) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterMissedCall) GetType() string { - return TypeSearchMessagesFilterMissedCall -} - -func (*SearchMessagesFilterMissedCall) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterMissedCall -} - // Returns only video note messages type SearchMessagesFilterVideoNote struct { meta @@ -16009,6 +17145,31 @@ func (*ChatActionUploadingDocument) ChatActionType() string { return TypeChatActionUploadingDocument } +// The user is picking a sticker to send +type ChatActionChoosingSticker struct { + meta +} + +func (entity *ChatActionChoosingSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionChoosingSticker + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionChoosingSticker) GetClass() string { + return ClassChatAction +} + +func (*ChatActionChoosingSticker) GetType() string { + return TypeChatActionChoosingSticker +} + +func (*ChatActionChoosingSticker) ChatActionType() string { + return TypeChatActionChoosingSticker +} + // The user is picking a location or venue to send type ChatActionChoosingLocation struct { meta @@ -16136,7 +17297,34 @@ func (*ChatActionUploadingVideoNote) ChatActionType() string { return TypeChatActionUploadingVideoNote } -// The user has cancelled the previous action +// The user is watching animations sent by the other party by clicking on an animated emoji +type ChatActionWatchingAnimations struct { + meta + // The animated emoji + Emoji string `json:"emoji"` +} + +func (entity *ChatActionWatchingAnimations) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionWatchingAnimations + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionWatchingAnimations) GetClass() string { + return ClassChatAction +} + +func (*ChatActionWatchingAnimations) GetType() string { + return TypeChatActionWatchingAnimations +} + +func (*ChatActionWatchingAnimations) ChatActionType() string { + return TypeChatActionWatchingAnimations +} + +// The user has canceled the previous action type ChatActionCancel struct { meta } @@ -16372,6 +17560,8 @@ type StickerSet struct { Name string `json:"name"` // Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed Thumbnail *Thumbnail `json:"thumbnail"` + // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` // 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 @@ -16417,7 +17607,9 @@ type StickerSetInfo struct { Name string `json:"name"` // 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 + // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + // 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 IsArchived bool `json:"is_archived"` @@ -16431,7 +17623,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 application needs more stickers the full set should be requested + // Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested Covers []*Sticker `json:"covers"` } @@ -16501,7 +17693,7 @@ func (*CallDiscardReasonEmpty) CallDiscardReasonType() string { return TypeCallDiscardReasonEmpty } -// The call was ended before the conversation started. It was cancelled by the caller or missed by the other party +// The call was ended before the conversation started. It was canceled by the caller or missed by the other party type CallDiscardReasonMissed struct { meta } @@ -16612,7 +17804,7 @@ 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 + // List of supported tgcalls versions LibraryVersions []string `json:"library_versions"` } @@ -16771,6 +17963,29 @@ func (*CallId) GetType() string { return TypeCallId } +// Contains the group call identifier +type GroupCallId struct { + meta + // Group call identifier + Id int32 `json:"id"` +} + +func (entity *GroupCallId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallId + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallId) GetClass() string { + return ClassGroupCallId +} + +func (*GroupCallId) GetType() string { + return TypeGroupCallId +} + // The call is pending, waiting to be accepted by a user type CallStatePending struct { meta @@ -16892,9 +18107,9 @@ type CallStateDiscarded struct { meta // The reason, why the call has ended Reason CallDiscardReason `json:"reason"` - // True, if the call rating should be sent to the server + // True, if the call rating must be sent to the server NeedRating bool `json:"need_rating"` - // True, if the call debug information should be sent to the server + // True, if the call debug information must be sent to the server NeedDebugInformation bool `json:"need_debug_information"` } @@ -16966,6 +18181,344 @@ func (*CallStateError) CallStateType() string { return TypeCallStateError } +// The worst available video quality +type GroupCallVideoQualityThumbnail struct { + meta +} + +func (entity *GroupCallVideoQualityThumbnail) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallVideoQualityThumbnail + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallVideoQualityThumbnail) GetClass() string { + return ClassGroupCallVideoQuality +} + +func (*GroupCallVideoQualityThumbnail) GetType() string { + return TypeGroupCallVideoQualityThumbnail +} + +func (*GroupCallVideoQualityThumbnail) GroupCallVideoQualityType() string { + return TypeGroupCallVideoQualityThumbnail +} + +// The medium video quality +type GroupCallVideoQualityMedium struct { + meta +} + +func (entity *GroupCallVideoQualityMedium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallVideoQualityMedium + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallVideoQualityMedium) GetClass() string { + return ClassGroupCallVideoQuality +} + +func (*GroupCallVideoQualityMedium) GetType() string { + return TypeGroupCallVideoQualityMedium +} + +func (*GroupCallVideoQualityMedium) GroupCallVideoQualityType() string { + return TypeGroupCallVideoQualityMedium +} + +// The best available video quality +type GroupCallVideoQualityFull struct { + meta +} + +func (entity *GroupCallVideoQualityFull) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallVideoQualityFull + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallVideoQualityFull) GetClass() string { + return ClassGroupCallVideoQuality +} + +func (*GroupCallVideoQualityFull) GetType() string { + return TypeGroupCallVideoQualityFull +} + +func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string { + return TypeGroupCallVideoQualityFull +} + +// Describes a recently speaking participant in a group call +type GroupCallRecentSpeaker struct { + meta + // Group call participant identifier + ParticipantId MessageSender `json:"participant_id"` + // True, is the user has spoken recently + IsSpeaking bool `json:"is_speaking"` +} + +func (entity *GroupCallRecentSpeaker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallRecentSpeaker + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallRecentSpeaker) GetClass() string { + return ClassGroupCallRecentSpeaker +} + +func (*GroupCallRecentSpeaker) GetType() string { + return TypeGroupCallRecentSpeaker +} + +func (groupCallRecentSpeaker *GroupCallRecentSpeaker) UnmarshalJSON(data []byte) error { + var tmp struct { + ParticipantId json.RawMessage `json:"participant_id"` + IsSpeaking bool `json:"is_speaking"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + groupCallRecentSpeaker.IsSpeaking = tmp.IsSpeaking + + fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId) + groupCallRecentSpeaker.ParticipantId = fieldParticipantId + + return nil +} + +// Describes a group call +type GroupCall struct { + meta + // Group call identifier + Id int32 `json:"id"` + // Group call title + Title string `json:"title"` + // Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended + ScheduledStartDate int32 `json:"scheduled_start_date"` + // True, if the group call is scheduled and the current user will receive a notification when the group call will start + EnabledStartNotification bool `json:"enabled_start_notification"` + // True, if the call is active + IsActive bool `json:"is_active"` + // True, if the call is joined + IsJoined bool `json:"is_joined"` + // True, if user was kicked from the call because of network loss and the call needs to be rejoined + NeedRejoin bool `json:"need_rejoin"` + // True, if the current user can manage the group call + CanBeManaged bool `json:"can_be_managed"` + // Number of participants in the group call + ParticipantCount int32 `json:"participant_count"` + // True, if all group call participants are loaded + LoadedAllParticipants bool `json:"loaded_all_participants"` + // At most 3 recently speaking users in the group call + RecentSpeakers []*GroupCallRecentSpeaker `json:"recent_speakers"` + // True, if the current user's video is enabled + IsMyVideoEnabled bool `json:"is_my_video_enabled"` + // True, if the current user's video is paused + IsMyVideoPaused bool `json:"is_my_video_paused"` + // True, if the current user can broadcast video or share screen + CanEnableVideo bool `json:"can_enable_video"` + // True, if only group call administrators can unmute new participants + MuteNewParticipants bool `json:"mute_new_participants"` + // True, if the current user can enable or disable mute_new_participants setting + CanToggleMuteNewParticipants bool `json:"can_toggle_mute_new_participants"` + // Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on + RecordDuration int32 `json:"record_duration"` + // True, if a video file is being recorded for the call + IsVideoRecorded bool `json:"is_video_recorded"` + // Call duration, in seconds; for ended calls only + Duration int32 `json:"duration"` +} + +func (entity *GroupCall) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCall + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCall) GetClass() string { + return ClassGroupCall +} + +func (*GroupCall) GetType() string { + return TypeGroupCall +} + +// Describes a group of video synchronization source identifiers +type GroupCallVideoSourceGroup struct { + meta + // The semantics of sources, one of "SIM" or "FID" + Semantics string `json:"semantics"` + // The list of synchronization source identifiers + SourceIds []int32 `json:"source_ids"` +} + +func (entity *GroupCallVideoSourceGroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallVideoSourceGroup + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallVideoSourceGroup) GetClass() string { + return ClassGroupCallVideoSourceGroup +} + +func (*GroupCallVideoSourceGroup) GetType() string { + return TypeGroupCallVideoSourceGroup +} + +// Contains information about a group call participant's video channel +type GroupCallParticipantVideoInfo struct { + meta + // List of synchronization source groups of the video + SourceGroups []*GroupCallVideoSourceGroup `json:"source_groups"` + // Video channel endpoint identifier + EndpointId string `json:"endpoint_id"` + // True if the video is paused. This flag needs to be ignored, if new video frames are received + IsPaused bool `json:"is_paused"` +} + +func (entity *GroupCallParticipantVideoInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallParticipantVideoInfo + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallParticipantVideoInfo) GetClass() string { + return ClassGroupCallParticipantVideoInfo +} + +func (*GroupCallParticipantVideoInfo) GetType() string { + return TypeGroupCallParticipantVideoInfo +} + +// Represents a group call participant +type GroupCallParticipant struct { + meta + // Identifier of the group call participant + ParticipantId MessageSender `json:"participant_id"` + // User's audio channel synchronization source identifier + AudioSourceId int32 `json:"audio_source_id"` + // User's screen sharing audio channel synchronization source identifier + ScreenSharingAudioSourceId int32 `json:"screen_sharing_audio_source_id"` + // Information about user's video channel; may be null if there is no active video + VideoInfo *GroupCallParticipantVideoInfo `json:"video_info"` + // Information about user's screen sharing video channel; may be null if there is no active screen sharing video + ScreenSharingVideoInfo *GroupCallParticipantVideoInfo `json:"screen_sharing_video_info"` + // The participant user's bio or the participant chat's description + Bio string `json:"bio"` + // True, if the participant is the current user + IsCurrentUser bool `json:"is_current_user"` + // True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking + IsSpeaking bool `json:"is_speaking"` + // True, if the participant hand is raised + IsHandRaised bool `json:"is_hand_raised"` + // True, if the current user can mute the participant for all other group call participants + CanBeMutedForAllUsers bool `json:"can_be_muted_for_all_users"` + // True, if the current user can allow the participant to unmute themselves or unmute the participant (if the participant is the current user) + CanBeUnmutedForAllUsers bool `json:"can_be_unmuted_for_all_users"` + // True, if the current user can mute the participant only for self + CanBeMutedForCurrentUser bool `json:"can_be_muted_for_current_user"` + // True, if the current user can unmute the participant for self + CanBeUnmutedForCurrentUser bool `json:"can_be_unmuted_for_current_user"` + // True, if the participant is muted for all users + IsMutedForAllUsers bool `json:"is_muted_for_all_users"` + // True, if the participant is muted for the current user + IsMutedForCurrentUser bool `json:"is_muted_for_current_user"` + // True, if the participant is muted for all users, but can unmute themselves + CanUnmuteSelf bool `json:"can_unmute_self"` + // Participant's volume level; 1-20000 in hundreds of percents + VolumeLevel int32 `json:"volume_level"` + // User's order in the group call participant list. Orders must be compared lexicographically. The bigger is order, the higher is user in the list. If order is empty, the user must be removed from the participant list + Order string `json:"order"` +} + +func (entity *GroupCallParticipant) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallParticipant + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallParticipant) GetClass() string { + return ClassGroupCallParticipant +} + +func (*GroupCallParticipant) GetType() string { + return TypeGroupCallParticipant +} + +func (groupCallParticipant *GroupCallParticipant) UnmarshalJSON(data []byte) error { + var tmp struct { + ParticipantId json.RawMessage `json:"participant_id"` + AudioSourceId int32 `json:"audio_source_id"` + ScreenSharingAudioSourceId int32 `json:"screen_sharing_audio_source_id"` + VideoInfo *GroupCallParticipantVideoInfo `json:"video_info"` + ScreenSharingVideoInfo *GroupCallParticipantVideoInfo `json:"screen_sharing_video_info"` + Bio string `json:"bio"` + IsCurrentUser bool `json:"is_current_user"` + IsSpeaking bool `json:"is_speaking"` + IsHandRaised bool `json:"is_hand_raised"` + CanBeMutedForAllUsers bool `json:"can_be_muted_for_all_users"` + CanBeUnmutedForAllUsers bool `json:"can_be_unmuted_for_all_users"` + CanBeMutedForCurrentUser bool `json:"can_be_muted_for_current_user"` + CanBeUnmutedForCurrentUser bool `json:"can_be_unmuted_for_current_user"` + IsMutedForAllUsers bool `json:"is_muted_for_all_users"` + IsMutedForCurrentUser bool `json:"is_muted_for_current_user"` + CanUnmuteSelf bool `json:"can_unmute_self"` + VolumeLevel int32 `json:"volume_level"` + Order string `json:"order"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + groupCallParticipant.AudioSourceId = tmp.AudioSourceId + groupCallParticipant.ScreenSharingAudioSourceId = tmp.ScreenSharingAudioSourceId + groupCallParticipant.VideoInfo = tmp.VideoInfo + groupCallParticipant.ScreenSharingVideoInfo = tmp.ScreenSharingVideoInfo + groupCallParticipant.Bio = tmp.Bio + groupCallParticipant.IsCurrentUser = tmp.IsCurrentUser + groupCallParticipant.IsSpeaking = tmp.IsSpeaking + groupCallParticipant.IsHandRaised = tmp.IsHandRaised + groupCallParticipant.CanBeMutedForAllUsers = tmp.CanBeMutedForAllUsers + groupCallParticipant.CanBeUnmutedForAllUsers = tmp.CanBeUnmutedForAllUsers + groupCallParticipant.CanBeMutedForCurrentUser = tmp.CanBeMutedForCurrentUser + groupCallParticipant.CanBeUnmutedForCurrentUser = tmp.CanBeUnmutedForCurrentUser + groupCallParticipant.IsMutedForAllUsers = tmp.IsMutedForAllUsers + groupCallParticipant.IsMutedForCurrentUser = tmp.IsMutedForCurrentUser + groupCallParticipant.CanUnmuteSelf = tmp.CanUnmuteSelf + groupCallParticipant.VolumeLevel = tmp.VolumeLevel + groupCallParticipant.Order = tmp.Order + + fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId) + groupCallParticipant.ParticipantId = fieldParticipantId + + return nil +} + // The user heard their own voice type CallProblemEcho struct { meta @@ -17197,7 +18750,7 @@ type Call struct { // Call identifier, not persistent Id int32 `json:"id"` // Peer user identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // True, if the call is outgoing IsOutgoing bool `json:"is_outgoing"` // True, if the call is a video call @@ -17225,7 +18778,7 @@ func (*Call) GetType() string { func (call *Call) UnmarshalJSON(data []byte) error { var tmp struct { Id int32 `json:"id"` - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` IsOutgoing bool `json:"is_outgoing"` IsVideo bool `json:"is_video"` State json.RawMessage `json:"state"` @@ -17250,12 +18803,16 @@ func (call *Call) UnmarshalJSON(data []byte) error { // Contains settings for the authentication of the user's phone number type PhoneNumberAuthenticationSettings struct { meta - // Pass true if the authentication code may be sent via flash call to the specified phone number + // Pass true if the authentication code may be sent via a flash call to the specified phone number AllowFlashCall bool `json:"allow_flash_call"` + // Pass true if the authentication code may be sent via a missed call to the specified phone number + AllowMissedCall bool `json:"allow_missed_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 application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details AllowSmsRetrieverApi bool `json:"allow_sms_retriever_api"` + // List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions + AuthenticationTokens []string `json:"authentication_tokens"` } func (entity *PhoneNumberAuthenticationSettings) MarshalJSON() ([]byte, error) { @@ -17363,7 +18920,7 @@ func (*DiceStickersSlotMachine) DiceStickersType() string { type ImportedContacts struct { meta // User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user - UserIds []int32 `json:"user_ids"` + UserIds []int64 `json:"user_ids"` // The number of users that imported the corresponding contact; 0 for already registered users or if unavailable ImporterCount []int32 `json:"importer_count"` } @@ -17407,7 +18964,7 @@ func (*HttpUrl) GetType() string { return TypeHttpUrl } -// Represents a link to an animated GIF or an animated (i.e. without sound) H.264/MPEG-4 AVC video +// 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 @@ -17428,9 +18985,9 @@ type InputInlineQueryResultAnimation struct { VideoWidth int32 `json:"video_width"` // Height of the video VideoHeight int32 `json:"video_height"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageAnimation, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -17512,9 +19069,9 @@ type InputInlineQueryResultArticle struct { ThumbnailWidth int32 `json:"thumbnail_width"` // Thumbnail height, if known ThumbnailHeight int32 `json:"thumbnail_height"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -17588,9 +19145,9 @@ type InputInlineQueryResultAudio struct { AudioUrl string `json:"audio_url"` // Audio file duration, in seconds AudioDuration int32 `json:"audio_duration"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageAudio, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAudio, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -17658,9 +19215,9 @@ type InputInlineQueryResultContact struct { ThumbnailWidth int32 `json:"thumbnail_width"` // Thumbnail height, if known ThumbnailHeight int32 `json:"thumbnail_height"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -17734,9 +19291,9 @@ type InputInlineQueryResultDocument struct { ThumbnailWidth int32 `json:"thumbnail_width"` // Height of the thumbnail ThumbnailHeight int32 `json:"thumbnail_height"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageDocument, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageDocument, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -17804,7 +19361,7 @@ type InputInlineQueryResultGame struct { Id string `json:"id"` // Short name of the game GameShortName string `json:"game_short_name"` - // Message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` } @@ -17866,9 +19423,9 @@ type InputInlineQueryResultLocation struct { ThumbnailWidth int32 `json:"thumbnail_width"` // Thumbnail height, if known ThumbnailHeight int32 `json:"thumbnail_height"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -17944,9 +19501,9 @@ type InputInlineQueryResultPhoto struct { PhotoWidth int32 `json:"photo_width"` // Height of the photo PhotoHeight int32 `json:"photo_height"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessagePhoto, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -18018,9 +19575,9 @@ type InputInlineQueryResultSticker struct { StickerWidth int32 `json:"sticker_width"` // Height of the sticker StickerHeight int32 `json:"sticker_height"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, inputMessageSticker, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -18088,9 +19645,9 @@ type InputInlineQueryResultVenue struct { ThumbnailWidth int32 `json:"thumbnail_width"` // Thumbnail height, if known ThumbnailHeight int32 `json:"thumbnail_height"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -18166,9 +19723,9 @@ type InputInlineQueryResultVideo struct { VideoHeight int32 `json:"video_height"` // Video duration, in seconds VideoDuration int32 `json:"video_duration"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageVideo, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVideo, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -18242,9 +19799,9 @@ type InputInlineQueryResultVoiceNote struct { VoiceNoteUrl string `json:"voice_note_url"` // Duration of the voice note, in seconds VoiceNoteDuration int32 `json:"voice_note_duration"` - // The message reply markup. Must be of type replyMarkupInlineKeyboard or null + // The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue or InputMessageContact + // The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVoiceNote, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -18686,7 +20243,7 @@ type InlineQueryResults struct { NextOffset string `json:"next_offset"` // Results of the query Results []InlineQueryResult `json:"results"` - // If non-empty, this text should be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter + // If non-empty, this text must be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter SwitchPmText string `json:"switch_pm_text"` // Parameter for the bot start message SwitchPmParameter string `json:"switch_pm_parameter"` @@ -18821,7 +20378,7 @@ type CallbackQueryAnswer struct { meta // Text of the answer Text string `json:"text"` - // True, if an alert should be shown to the user instead of a toast notification + // True, if an alert must be shown to the user instead of a toast notification ShowAlert bool `json:"show_alert"` // URL to be opened Url string `json:"url"` @@ -18872,7 +20429,7 @@ type GameHighScore struct { // Position in the high score table Position int32 `json:"position"` // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // User score Score int32 `json:"score"` } @@ -19078,6 +20635,62 @@ func (*ChatEventMemberJoined) ChatEventActionType() string { return TypeChatEventMemberJoined } +// A new member joined the chat via an invite link +type ChatEventMemberJoinedByInviteLink struct { + meta + // Invite link used to join the chat + InviteLink *ChatInviteLink `json:"invite_link"` +} + +func (entity *ChatEventMemberJoinedByInviteLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberJoinedByInviteLink + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberJoinedByInviteLink) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberJoinedByInviteLink) GetType() string { + return TypeChatEventMemberJoinedByInviteLink +} + +func (*ChatEventMemberJoinedByInviteLink) ChatEventActionType() string { + return TypeChatEventMemberJoinedByInviteLink +} + +// A new member was accepted to the chat by an administrator +type ChatEventMemberJoinedByRequest struct { + meta + // User identifier of the chat administrator, approved user join request + ApproverUserId int64 `json:"approver_user_id"` + // Invite link used to join the chat; may be null + InviteLink *ChatInviteLink `json:"invite_link"` +} + +func (entity *ChatEventMemberJoinedByRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberJoinedByRequest + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberJoinedByRequest) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberJoinedByRequest) GetType() string { + return TypeChatEventMemberJoinedByRequest +} + +func (*ChatEventMemberJoinedByRequest) ChatEventActionType() string { + return TypeChatEventMemberJoinedByRequest +} + // A member left the chat type ChatEventMemberLeft struct { meta @@ -19107,7 +20720,7 @@ func (*ChatEventMemberLeft) ChatEventActionType() string { type ChatEventMemberInvited struct { meta // New member user identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // New member status Status ChatMemberStatus `json:"status"` } @@ -19134,7 +20747,7 @@ func (*ChatEventMemberInvited) ChatEventActionType() string { func (chatEventMemberInvited *ChatEventMemberInvited) UnmarshalJSON(data []byte) error { var tmp struct { - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` Status json.RawMessage `json:"status"` } @@ -19154,8 +20767,8 @@ func (chatEventMemberInvited *ChatEventMemberInvited) UnmarshalJSON(data []byte) // A chat member has gained/lost administrator status, or the list of their administrator privileges has changed type ChatEventMemberPromoted struct { meta - // Chat member user identifier - UserId int32 `json:"user_id"` + // Affected chat member user identifier + UserId int64 `json:"user_id"` // Previous status of the chat member OldStatus ChatMemberStatus `json:"old_status"` // New status of the chat member @@ -19184,7 +20797,7 @@ func (*ChatEventMemberPromoted) ChatEventActionType() string { func (chatEventMemberPromoted *ChatEventMemberPromoted) UnmarshalJSON(data []byte) error { var tmp struct { - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` OldStatus json.RawMessage `json:"old_status"` NewStatus json.RawMessage `json:"new_status"` } @@ -19208,8 +20821,8 @@ func (chatEventMemberPromoted *ChatEventMemberPromoted) UnmarshalJSON(data []byt // A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed type ChatEventMemberRestricted struct { meta - // Chat member user identifier - UserId int32 `json:"user_id"` + // Affected chat member identifier + MemberId MessageSender `json:"member_id"` // Previous status of the chat member OldStatus ChatMemberStatus `json:"old_status"` // New status of the chat member @@ -19238,7 +20851,7 @@ func (*ChatEventMemberRestricted) ChatEventActionType() string { func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data []byte) error { var tmp struct { - UserId int32 `json:"user_id"` + MemberId json.RawMessage `json:"member_id"` OldStatus json.RawMessage `json:"old_status"` NewStatus json.RawMessage `json:"new_status"` } @@ -19248,7 +20861,8 @@ func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data [ return err } - chatEventMemberRestricted.UserId = tmp.UserId + fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId) + chatEventMemberRestricted.MemberId = fieldMemberId fieldOldStatus, _ := UnmarshalChatMemberStatus(tmp.OldStatus) chatEventMemberRestricted.OldStatus = fieldOldStatus @@ -19463,9 +21077,9 @@ func (*ChatEventLinkedChatChanged) ChatEventActionType() string { // The slow_mode_delay setting of a supergroup was changed type ChatEventSlowModeDelayChanged struct { meta - // Previous value of slow_mode_delay + // Previous value of slow_mode_delay, in seconds OldSlowModeDelay int32 `json:"old_slow_mode_delay"` - // New value of slow_mode_delay + // New value of slow_mode_delay, in seconds NewSlowModeDelay int32 `json:"new_slow_mode_delay"` } @@ -19489,6 +21103,35 @@ func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { return TypeChatEventSlowModeDelayChanged } +// The message TTL was changed +type ChatEventMessageTtlChanged struct { + meta + // Previous value of message_ttl + OldMessageTtl int32 `json:"old_message_ttl"` + // New value of message_ttl + NewMessageTtl int32 `json:"new_message_ttl"` +} + +func (entity *ChatEventMessageTtlChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMessageTtlChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMessageTtlChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMessageTtlChanged) GetType() string { + return TypeChatEventMessageTtlChanged +} + +func (*ChatEventMessageTtlChanged) ChatEventActionType() string { + return TypeChatEventMessageTtlChanged +} + // The sign_messages setting of a channel was toggled type ChatEventSignMessagesToggled struct { meta @@ -19516,6 +21159,33 @@ func (*ChatEventSignMessagesToggled) ChatEventActionType() string { return TypeChatEventSignMessagesToggled } +// The has_protected_content setting of a channel was toggled +type ChatEventHasProtectedContentToggled struct { + meta + // New value of has_protected_content + HasProtectedContent bool `json:"has_protected_content"` +} + +func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventHasProtectedContentToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventHasProtectedContentToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventHasProtectedContentToggled) GetType() string { + return TypeChatEventHasProtectedContentToggled +} + +func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { + return TypeChatEventHasProtectedContentToggled +} + // The supergroup sticker set was changed type ChatEventStickerSetChanged struct { meta @@ -19601,6 +21271,266 @@ func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string { return TypeChatEventIsAllHistoryAvailableToggled } +// A chat invite link was edited +type ChatEventInviteLinkEdited struct { + meta + // Previous information about the invite link + OldInviteLink *ChatInviteLink `json:"old_invite_link"` + // New information about the invite link + NewInviteLink *ChatInviteLink `json:"new_invite_link"` +} + +func (entity *ChatEventInviteLinkEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventInviteLinkEdited + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventInviteLinkEdited) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventInviteLinkEdited) GetType() string { + return TypeChatEventInviteLinkEdited +} + +func (*ChatEventInviteLinkEdited) ChatEventActionType() string { + return TypeChatEventInviteLinkEdited +} + +// A chat invite link was revoked +type ChatEventInviteLinkRevoked struct { + meta + // The invite link + InviteLink *ChatInviteLink `json:"invite_link"` +} + +func (entity *ChatEventInviteLinkRevoked) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventInviteLinkRevoked + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventInviteLinkRevoked) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventInviteLinkRevoked) GetType() string { + return TypeChatEventInviteLinkRevoked +} + +func (*ChatEventInviteLinkRevoked) ChatEventActionType() string { + return TypeChatEventInviteLinkRevoked +} + +// A revoked chat invite link was deleted +type ChatEventInviteLinkDeleted struct { + meta + // The invite link + InviteLink *ChatInviteLink `json:"invite_link"` +} + +func (entity *ChatEventInviteLinkDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventInviteLinkDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventInviteLinkDeleted) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventInviteLinkDeleted) GetType() string { + return TypeChatEventInviteLinkDeleted +} + +func (*ChatEventInviteLinkDeleted) ChatEventActionType() string { + return TypeChatEventInviteLinkDeleted +} + +// A video chat was created +type ChatEventVideoChatCreated struct { + meta + // Identifier of the video chat. The video chat can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` +} + +func (entity *ChatEventVideoChatCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatCreated + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatCreated) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatCreated) GetType() string { + return TypeChatEventVideoChatCreated +} + +func (*ChatEventVideoChatCreated) ChatEventActionType() string { + return TypeChatEventVideoChatCreated +} + +// A video chat was ended +type ChatEventVideoChatEnded struct { + meta + // Identifier of the video chat. The video chat can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` +} + +func (entity *ChatEventVideoChatEnded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatEnded + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatEnded) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatEnded) GetType() string { + return TypeChatEventVideoChatEnded +} + +func (*ChatEventVideoChatEnded) ChatEventActionType() string { + return TypeChatEventVideoChatEnded +} + +// A video chat participant was muted or unmuted +type ChatEventVideoChatParticipantIsMutedToggled struct { + meta + // Identifier of the affected group call participant + ParticipantId MessageSender `json:"participant_id"` + // New value of is_muted + IsMuted bool `json:"is_muted"` +} + +func (entity *ChatEventVideoChatParticipantIsMutedToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatParticipantIsMutedToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatParticipantIsMutedToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatParticipantIsMutedToggled) GetType() string { + return TypeChatEventVideoChatParticipantIsMutedToggled +} + +func (*ChatEventVideoChatParticipantIsMutedToggled) ChatEventActionType() string { + return TypeChatEventVideoChatParticipantIsMutedToggled +} + +func (chatEventVideoChatParticipantIsMutedToggled *ChatEventVideoChatParticipantIsMutedToggled) UnmarshalJSON(data []byte) error { + var tmp struct { + ParticipantId json.RawMessage `json:"participant_id"` + IsMuted bool `json:"is_muted"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatEventVideoChatParticipantIsMutedToggled.IsMuted = tmp.IsMuted + + fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId) + chatEventVideoChatParticipantIsMutedToggled.ParticipantId = fieldParticipantId + + return nil +} + +// A video chat participant volume level was changed +type ChatEventVideoChatParticipantVolumeLevelChanged struct { + meta + // Identifier of the affected group call participant + ParticipantId MessageSender `json:"participant_id"` + // New value of volume_level; 1-20000 in hundreds of percents + VolumeLevel int32 `json:"volume_level"` +} + +func (entity *ChatEventVideoChatParticipantVolumeLevelChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatParticipantVolumeLevelChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatParticipantVolumeLevelChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatParticipantVolumeLevelChanged) GetType() string { + return TypeChatEventVideoChatParticipantVolumeLevelChanged +} + +func (*ChatEventVideoChatParticipantVolumeLevelChanged) ChatEventActionType() string { + return TypeChatEventVideoChatParticipantVolumeLevelChanged +} + +func (chatEventVideoChatParticipantVolumeLevelChanged *ChatEventVideoChatParticipantVolumeLevelChanged) UnmarshalJSON(data []byte) error { + var tmp struct { + ParticipantId json.RawMessage `json:"participant_id"` + VolumeLevel int32 `json:"volume_level"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatEventVideoChatParticipantVolumeLevelChanged.VolumeLevel = tmp.VolumeLevel + + fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId) + chatEventVideoChatParticipantVolumeLevelChanged.ParticipantId = fieldParticipantId + + return nil +} + +// The mute_new_participants setting of a video chat was toggled +type ChatEventVideoChatMuteNewParticipantsToggled struct { + meta + // New value of the mute_new_participants setting + MuteNewParticipants bool `json:"mute_new_participants"` +} + +func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatMuteNewParticipantsToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + // Represents a chat event type ChatEvent struct { meta @@ -19608,9 +21538,9 @@ type ChatEvent struct { Id JsonInt64 `json:"id"` // Point in time (Unix timestamp) when the event happened Date int32 `json:"date"` - // Identifier of the user who performed the action that triggered the event - UserId int32 `json:"user_id"` - // Action performed by the user + // Identifier of the user or chat who performed the action + MemberId MessageSender `json:"member_id"` + // The action Action ChatEventAction `json:"action"` } @@ -19632,10 +21562,10 @@ func (*ChatEvent) GetType() string { func (chatEvent *ChatEvent) UnmarshalJSON(data []byte) error { var tmp struct { - Id JsonInt64 `json:"id"` - Date int32 `json:"date"` - UserId int32 `json:"user_id"` - Action json.RawMessage `json:"action"` + Id JsonInt64 `json:"id"` + Date int32 `json:"date"` + MemberId json.RawMessage `json:"member_id"` + Action json.RawMessage `json:"action"` } err := json.Unmarshal(data, &tmp) @@ -19645,7 +21575,9 @@ func (chatEvent *ChatEvent) UnmarshalJSON(data []byte) error { chatEvent.Id = tmp.Id chatEvent.Date = tmp.Date - chatEvent.UserId = tmp.UserId + + fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId) + chatEvent.MemberId = fieldMemberId fieldAction, _ := UnmarshalChatEventAction(tmp.Action) chatEvent.Action = fieldAction @@ -19679,26 +21611,30 @@ func (*ChatEvents) GetType() string { // Represents a set of filters used to obtain a chat event log type ChatEventLogFilters struct { meta - // True, if message edits should be returned + // True, if message edits need to be returned MessageEdits bool `json:"message_edits"` - // True, if message deletions should be returned + // True, if message deletions need to be returned MessageDeletions bool `json:"message_deletions"` - // True, if pin/unpin events should be returned + // True, if pin/unpin events need to be returned MessagePins bool `json:"message_pins"` - // True, if members joining events should be returned + // True, if members joining events need to be returned MemberJoins bool `json:"member_joins"` - // True, if members leaving events should be returned + // True, if members leaving events need to be returned MemberLeaves bool `json:"member_leaves"` - // True, if invited member events should be returned + // True, if invited member events need to be returned MemberInvites bool `json:"member_invites"` - // True, if member promotion/demotion events should be returned + // True, if member promotion/demotion events need to be returned MemberPromotions bool `json:"member_promotions"` - // True, if member restricted/unrestricted/banned/unbanned events should be returned + // True, if member restricted/unrestricted/banned/unbanned events need to be returned MemberRestrictions bool `json:"member_restrictions"` - // True, if changes in chat information should be returned + // True, if changes in chat information need to be returned InfoChanges bool `json:"info_changes"` - // True, if changes in chat settings should be returned + // True, if changes in chat settings need to be returned SettingChanges bool `json:"setting_changes"` + // True, if changes to invite links need to be returned + InviteLinkChanges bool `json:"invite_link_changes"` + // True, if video chat actions need to be returned + VideoChatChanges bool `json:"video_chat_changes"` } func (entity *ChatEventLogFilters) MarshalJSON() ([]byte, error) { @@ -19781,7 +21717,7 @@ func (*LanguagePackStringValuePluralized) LanguagePackStringValueType() string { return TypeLanguagePackStringValuePluralized } -// A deleted language pack string, the value should be taken from the built-in english language pack +// A deleted language pack string, the value must be taken from the built-in English language pack type LanguagePackStringValueDeleted struct { meta } @@ -19811,7 +21747,7 @@ type LanguagePackString struct { meta // String key Key string `json:"key"` - // String value + // String value; pass null if the string needs to be taken from the built-in English language pack Value LanguagePackStringValue `json:"value"` } @@ -19878,7 +21814,7 @@ type LanguagePackInfo struct { meta // Unique language pack identifier Id string `json:"id"` - // Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it should be fetched from base language pack. Unsupported in custom language packs + // Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs BaseLanguagePackId string `json:"base_language_pack_id"` // Language name Name string `json:"name"` @@ -19946,9 +21882,9 @@ func (*LocalizationTargetInfo) GetType() string { // A token for Firebase Cloud Messaging type DeviceTokenFirebaseCloudMessaging struct { meta - // Device registration token; may be empty to de-register a device + // Device registration token; may be empty to deregister a device Token string `json:"token"` - // True, if push notifications should be additionally encrypted + // True, if push notifications must be additionally encrypted Encrypt bool `json:"encrypt"` } @@ -19975,7 +21911,7 @@ func (*DeviceTokenFirebaseCloudMessaging) DeviceTokenType() string { // A token for Apple Push Notification service type DeviceTokenApplePush struct { meta - // Device token; may be empty to de-register a device + // Device token; may be empty to deregister a device DeviceToken string `json:"device_token"` // True, if App Sandbox is enabled IsAppSandbox bool `json:"is_app_sandbox"` @@ -20004,11 +21940,11 @@ func (*DeviceTokenApplePush) DeviceTokenType() string { // A token for Apple Push Notification service VoIP notifications type DeviceTokenApplePushVoIP struct { meta - // Device token; may be empty to de-register a device + // Device token; may be empty to deregister a device DeviceToken string `json:"device_token"` // True, if App Sandbox is enabled IsAppSandbox bool `json:"is_app_sandbox"` - // True, if push notifications should be additionally encrypted + // True, if push notifications must be additionally encrypted Encrypt bool `json:"encrypt"` } @@ -20035,7 +21971,7 @@ func (*DeviceTokenApplePushVoIP) DeviceTokenType() string { // A token for Windows Push Notification Services type DeviceTokenWindowsPush struct { meta - // The access token that will be used to send notifications; may be empty to de-register a device + // The access token that will be used to send notifications; may be empty to deregister a device AccessToken string `json:"access_token"` } @@ -20062,7 +21998,7 @@ func (*DeviceTokenWindowsPush) DeviceTokenType() string { // A token for Microsoft Push Notification Service type DeviceTokenMicrosoftPush struct { meta - // Push notification channel URI; may be empty to de-register a device + // Push notification channel URI; may be empty to deregister a device ChannelUri string `json:"channel_uri"` } @@ -20089,7 +22025,7 @@ func (*DeviceTokenMicrosoftPush) DeviceTokenType() string { // A token for Microsoft Push Notification Service VoIP channel type DeviceTokenMicrosoftPushVoIP struct { meta - // Push notification channel URI; may be empty to de-register a device + // Push notification channel URI; may be empty to deregister a device ChannelUri string `json:"channel_uri"` } @@ -20116,7 +22052,7 @@ func (*DeviceTokenMicrosoftPushVoIP) DeviceTokenType() string { // A token for web Push API type DeviceTokenWebPush struct { meta - // Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device + // Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device Endpoint string `json:"endpoint"` // Base64url-encoded P-256 elliptic curve Diffie-Hellman public key P256dhBase64url string `json:"p256dh_base64url"` @@ -20147,7 +22083,7 @@ func (*DeviceTokenWebPush) DeviceTokenType() string { // A token for Simple Push API for Firefox OS type DeviceTokenSimplePush struct { meta - // Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device + // Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device Endpoint string `json:"endpoint"` } @@ -20174,7 +22110,7 @@ func (*DeviceTokenSimplePush) DeviceTokenType() string { // A token for Ubuntu Push Client service type DeviceTokenUbuntuPush struct { meta - // Token; may be empty to de-register a device + // Token; may be empty to deregister a device Token string `json:"token"` } @@ -20201,7 +22137,7 @@ func (*DeviceTokenUbuntuPush) DeviceTokenType() string { // A token for BlackBerry Push Service type DeviceTokenBlackBerryPush struct { meta - // Token; may be empty to de-register a device + // Token; may be empty to deregister a device Token string `json:"token"` } @@ -20228,7 +22164,7 @@ func (*DeviceTokenBlackBerryPush) DeviceTokenType() string { // A token for Tizen Push Service type DeviceTokenTizenPush struct { meta - // Push service registration identifier; may be empty to de-register a device + // Push service registration identifier; may be empty to deregister a device RegId string `json:"reg_id"` } @@ -20309,7 +22245,7 @@ type BackgroundFillGradient struct { TopColor int32 `json:"top_color"` // A bottom color of the background in the RGB24 format BottomColor int32 `json:"bottom_color"` - // Clockwise rotation angle of the gradient, in degrees; 0-359. Should be always divisible by 45 + // Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45 RotationAngle int32 `json:"rotation_angle"` } @@ -20333,6 +22269,33 @@ func (*BackgroundFillGradient) BackgroundFillType() string { return TypeBackgroundFillGradient } +// Describes a freeform gradient fill of a background +type BackgroundFillFreeformGradient struct { + meta + // A list of 3 or 4 colors of the freeform gradients in the RGB24 format + Colors []int32 `json:"colors"` +} + +func (entity *BackgroundFillFreeformGradient) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundFillFreeformGradient + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundFillFreeformGradient) GetClass() string { + return ClassBackgroundFill +} + +func (*BackgroundFillFreeformGradient) GetType() string { + return TypeBackgroundFillFreeformGradient +} + +func (*BackgroundFillFreeformGradient) BackgroundFillType() string { + return TypeBackgroundFillFreeformGradient +} + // A wallpaper in JPEG format type BackgroundTypeWallpaper struct { meta @@ -20365,10 +22328,12 @@ func (*BackgroundTypeWallpaper) BackgroundTypeType() string { // A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user type BackgroundTypePattern struct { meta - // Description of the background fill + // Fill of the background Fill BackgroundFill `json:"fill"` - // Intensity of the pattern when it is shown above the filled background, 0-100 + // Intensity of the pattern when it is shown above the filled background; 0-100. Intensity int32 `json:"intensity"` + // True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only + IsInverted bool `json:"is_inverted"` // True, if the background needs to be slightly moved when device is tilted IsMoving bool `json:"is_moving"` } @@ -20395,9 +22360,10 @@ func (*BackgroundTypePattern) BackgroundTypeType() string { func (backgroundTypePattern *BackgroundTypePattern) UnmarshalJSON(data []byte) error { var tmp struct { - Fill json.RawMessage `json:"fill"` - Intensity int32 `json:"intensity"` - IsMoving bool `json:"is_moving"` + Fill json.RawMessage `json:"fill"` + Intensity int32 `json:"intensity"` + IsInverted bool `json:"is_inverted"` + IsMoving bool `json:"is_moving"` } err := json.Unmarshal(data, &tmp) @@ -20406,6 +22372,7 @@ func (backgroundTypePattern *BackgroundTypePattern) UnmarshalJSON(data []byte) e } backgroundTypePattern.Intensity = tmp.Intensity + backgroundTypePattern.IsInverted = tmp.IsInverted backgroundTypePattern.IsMoving = tmp.IsMoving fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill) @@ -20417,7 +22384,7 @@ func (backgroundTypePattern *BackgroundTypePattern) UnmarshalJSON(data []byte) e // A filled background type BackgroundTypeFill struct { meta - // Description of the background fill + // The background fill Fill BackgroundFill `json:"fill"` } @@ -20610,6 +22577,89 @@ func (*InputBackgroundRemote) InputBackgroundType() string { return TypeInputBackgroundRemote } +// Describes theme settings +type ThemeSettings struct { + meta + // Theme accent color in ARGB format + AccentColor int32 `json:"accent_color"` + // The background to be used in chats; may be null + Background *Background `json:"background"` + // The fill to be used as a background for outgoing messages + OutgoingMessageFill BackgroundFill `json:"outgoing_message_fill"` + // If true, the freeform gradient fill needs to be animated on every sent message + AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"` + // Accent color of outgoing messages in ARGB format + OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"` +} + +func (entity *ThemeSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThemeSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ThemeSettings) GetClass() string { + return ClassThemeSettings +} + +func (*ThemeSettings) GetType() string { + return TypeThemeSettings +} + +func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + AccentColor int32 `json:"accent_color"` + Background *Background `json:"background"` + OutgoingMessageFill json.RawMessage `json:"outgoing_message_fill"` + AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"` + OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + themeSettings.AccentColor = tmp.AccentColor + themeSettings.Background = tmp.Background + themeSettings.AnimateOutgoingMessageFill = tmp.AnimateOutgoingMessageFill + themeSettings.OutgoingMessageAccentColor = tmp.OutgoingMessageAccentColor + + fieldOutgoingMessageFill, _ := UnmarshalBackgroundFill(tmp.OutgoingMessageFill) + themeSettings.OutgoingMessageFill = fieldOutgoingMessageFill + + return nil +} + +// Describes a chat theme +type ChatTheme struct { + meta + // Theme name + Name string `json:"name"` + // Theme settings for a light chat theme + LightSettings *ThemeSettings `json:"light_settings"` + // Theme settings for a dark chat theme + DarkSettings *ThemeSettings `json:"dark_settings"` +} + +func (entity *ChatTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatTheme + + return json.Marshal((*stub)(entity)) +} + +func (*ChatTheme) GetClass() string { + return ClassChatTheme +} + +func (*ChatTheme) GetType() string { + return TypeChatTheme +} + // Contains a list of hashtags type Hashtags struct { meta @@ -20812,7 +22862,7 @@ func (*CheckChatUsernameResultUsernameOccupied) CheckChatUsernameResultType() st return TypeCheckChatUsernameResultUsernameOccupied } -// The user has too much chats with username, one of them should be made private first +// The user has too much chats with username, one of them must be made private first type CheckChatUsernameResultPublicChatsTooMuch struct { meta } @@ -20862,6 +22912,239 @@ func (*CheckChatUsernameResultPublicGroupsUnavailable) CheckChatUsernameResultTy return TypeCheckChatUsernameResultPublicGroupsUnavailable } +// The name can be set +type CheckStickerSetNameResultOk struct { + meta +} + +func (entity *CheckStickerSetNameResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CheckStickerSetNameResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*CheckStickerSetNameResultOk) GetClass() string { + return ClassCheckStickerSetNameResult +} + +func (*CheckStickerSetNameResultOk) GetType() string { + return TypeCheckStickerSetNameResultOk +} + +func (*CheckStickerSetNameResultOk) CheckStickerSetNameResultType() string { + return TypeCheckStickerSetNameResultOk +} + +// The name is invalid +type CheckStickerSetNameResultNameInvalid struct { + meta +} + +func (entity *CheckStickerSetNameResultNameInvalid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CheckStickerSetNameResultNameInvalid + + return json.Marshal((*stub)(entity)) +} + +func (*CheckStickerSetNameResultNameInvalid) GetClass() string { + return ClassCheckStickerSetNameResult +} + +func (*CheckStickerSetNameResultNameInvalid) GetType() string { + return TypeCheckStickerSetNameResultNameInvalid +} + +func (*CheckStickerSetNameResultNameInvalid) CheckStickerSetNameResultType() string { + return TypeCheckStickerSetNameResultNameInvalid +} + +// The name is occupied +type CheckStickerSetNameResultNameOccupied struct { + meta +} + +func (entity *CheckStickerSetNameResultNameOccupied) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CheckStickerSetNameResultNameOccupied + + return json.Marshal((*stub)(entity)) +} + +func (*CheckStickerSetNameResultNameOccupied) GetClass() string { + return ClassCheckStickerSetNameResult +} + +func (*CheckStickerSetNameResultNameOccupied) GetType() string { + return TypeCheckStickerSetNameResultNameOccupied +} + +func (*CheckStickerSetNameResultNameOccupied) CheckStickerSetNameResultType() string { + return TypeCheckStickerSetNameResultNameOccupied +} + +// The password was reset +type ResetPasswordResultOk struct { + meta +} + +func (entity *ResetPasswordResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ResetPasswordResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*ResetPasswordResultOk) GetClass() string { + return ClassResetPasswordResult +} + +func (*ResetPasswordResultOk) GetType() string { + return TypeResetPasswordResultOk +} + +func (*ResetPasswordResultOk) ResetPasswordResultType() string { + return TypeResetPasswordResultOk +} + +// The password reset request is pending +type ResetPasswordResultPending struct { + meta + // Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword + PendingResetDate int32 `json:"pending_reset_date"` +} + +func (entity *ResetPasswordResultPending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ResetPasswordResultPending + + return json.Marshal((*stub)(entity)) +} + +func (*ResetPasswordResultPending) GetClass() string { + return ClassResetPasswordResult +} + +func (*ResetPasswordResultPending) GetType() string { + return TypeResetPasswordResultPending +} + +func (*ResetPasswordResultPending) ResetPasswordResultType() string { + return TypeResetPasswordResultPending +} + +// The password reset request was declined +type ResetPasswordResultDeclined struct { + meta + // Point in time (Unix timestamp) when the password reset can be retried + RetryDate int32 `json:"retry_date"` +} + +func (entity *ResetPasswordResultDeclined) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ResetPasswordResultDeclined + + return json.Marshal((*stub)(entity)) +} + +func (*ResetPasswordResultDeclined) GetClass() string { + return ClassResetPasswordResult +} + +func (*ResetPasswordResultDeclined) GetType() string { + return TypeResetPasswordResultDeclined +} + +func (*ResetPasswordResultDeclined) ResetPasswordResultType() string { + return TypeResetPasswordResultDeclined +} + +// The messages was exported from a private chat +type MessageFileTypePrivate struct { + meta + // Name of the other party; may be empty if unrecognized + Name string `json:"name"` +} + +func (entity *MessageFileTypePrivate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageFileTypePrivate + + return json.Marshal((*stub)(entity)) +} + +func (*MessageFileTypePrivate) GetClass() string { + return ClassMessageFileType +} + +func (*MessageFileTypePrivate) GetType() string { + return TypeMessageFileTypePrivate +} + +func (*MessageFileTypePrivate) MessageFileTypeType() string { + return TypeMessageFileTypePrivate +} + +// The messages was exported from a group chat +type MessageFileTypeGroup struct { + meta + // Title of the group chat; may be empty if unrecognized + Title string `json:"title"` +} + +func (entity *MessageFileTypeGroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageFileTypeGroup + + return json.Marshal((*stub)(entity)) +} + +func (*MessageFileTypeGroup) GetClass() string { + return ClassMessageFileType +} + +func (*MessageFileTypeGroup) GetType() string { + return TypeMessageFileTypeGroup +} + +func (*MessageFileTypeGroup) MessageFileTypeType() string { + return TypeMessageFileTypeGroup +} + +// The messages was exported from a chat of unknown type +type MessageFileTypeUnknown struct { + meta +} + +func (entity *MessageFileTypeUnknown) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageFileTypeUnknown + + return json.Marshal((*stub)(entity)) +} + +func (*MessageFileTypeUnknown) GetClass() string { + return ClassMessageFileType +} + +func (*MessageFileTypeUnknown) GetType() string { + return TypeMessageFileTypeUnknown +} + +func (*MessageFileTypeUnknown) MessageFileTypeType() string { + return TypeMessageFileTypeUnknown +} + // A general message with hidden content type PushMessageContentHidden struct { meta @@ -21422,7 +23705,7 @@ type PushMessageContentChatAddMembers struct { MemberName string `json:"member_name"` // True, if the current user was added to the group IsCurrentUser bool `json:"is_current_user"` - // True, if the user has returned to the group themself + // True, if the user has returned to the group themselves IsReturned bool `json:"is_returned"` } @@ -21498,6 +23781,33 @@ func (*PushMessageContentChatChangeTitle) PushMessageContentType() string { return TypePushMessageContentChatChangeTitle } +// A chat theme was edited +type PushMessageContentChatSetTheme struct { + meta + // If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one + ThemeName string `json:"theme_name"` +} + +func (entity *PushMessageContentChatSetTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentChatSetTheme + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentChatSetTheme) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentChatSetTheme) GetType() string { + return TypePushMessageContentChatSetTheme +} + +func (*PushMessageContentChatSetTheme) PushMessageContentType() string { + return TypePushMessageContentChatSetTheme +} + // A chat member was deleted type PushMessageContentChatDeleteMember struct { meta @@ -21505,7 +23815,7 @@ type PushMessageContentChatDeleteMember struct { MemberName string `json:"member_name"` // True, if the current user was deleted from the group IsCurrentUser bool `json:"is_current_user"` - // True, if the user has left the group themself + // True, if the user has left the group themselves IsLeft bool `json:"is_left"` } @@ -21529,7 +23839,7 @@ func (*PushMessageContentChatDeleteMember) PushMessageContentType() string { return TypePushMessageContentChatDeleteMember } -// A new member joined the chat by invite link +// A new member joined the chat via an invite link type PushMessageContentChatJoinByLink struct { meta } @@ -21554,6 +23864,31 @@ func (*PushMessageContentChatJoinByLink) PushMessageContentType() string { return TypePushMessageContentChatJoinByLink } +// A new member was accepted to the chat by an administrator +type PushMessageContentChatJoinByRequest struct { + meta +} + +func (entity *PushMessageContentChatJoinByRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentChatJoinByRequest + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentChatJoinByRequest) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentChatJoinByRequest) GetType() string { + return TypePushMessageContentChatJoinByRequest +} + +func (*PushMessageContentChatJoinByRequest) PushMessageContentType() string { + return TypePushMessageContentChatJoinByRequest +} + // A forwarded messages type PushMessageContentMessageForwards struct { meta @@ -21700,8 +24035,8 @@ 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, or as reply_to_message_id MessageId int64 `json:"message_id"` - // The sender of the message. Corresponding user or chat may be inaccessible - Sender MessageSender `json:"sender"` + // Identifier of the sender of the message. Corresponding user or chat may be inaccessible + SenderId MessageSender `json:"sender_id"` // Name of the sender SenderName string `json:"sender_name"` // True, if the message is outgoing @@ -21733,7 +24068,7 @@ func (*NotificationTypeNewPushMessage) NotificationTypeType() string { func (notificationTypeNewPushMessage *NotificationTypeNewPushMessage) UnmarshalJSON(data []byte) error { var tmp struct { MessageId int64 `json:"message_id"` - Sender json.RawMessage `json:"sender"` + SenderId json.RawMessage `json:"sender_id"` SenderName string `json:"sender_name"` IsOutgoing bool `json:"is_outgoing"` Content json.RawMessage `json:"content"` @@ -21748,8 +24083,8 @@ func (notificationTypeNewPushMessage *NotificationTypeNewPushMessage) UnmarshalJ notificationTypeNewPushMessage.SenderName = tmp.SenderName notificationTypeNewPushMessage.IsOutgoing = tmp.IsOutgoing - fieldSender, _ := UnmarshalMessageSender(tmp.Sender) - notificationTypeNewPushMessage.Sender = fieldSender + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + notificationTypeNewPushMessage.SenderId = fieldSenderId fieldContent, _ := UnmarshalPushMessageContent(tmp.Content) notificationTypeNewPushMessage.Content = fieldContent @@ -22345,7 +24680,7 @@ func (*UserPrivacySettingRuleAllowContacts) UserPrivacySettingRuleType() string type UserPrivacySettingRuleAllowUsers struct { meta // The user identifiers, total number of users in all rules must not exceed 1000 - UserIds []int32 `json:"user_ids"` + UserIds []int64 `json:"user_ids"` } func (entity *UserPrivacySettingRuleAllowUsers) MarshalJSON() ([]byte, error) { @@ -22449,7 +24784,7 @@ func (*UserPrivacySettingRuleRestrictContacts) UserPrivacySettingRuleType() stri type UserPrivacySettingRuleRestrictUsers struct { meta // The user identifiers, total number of users in all rules must not exceed 1000 - UserIds []int32 `json:"user_ids"` + UserIds []int64 `json:"user_ids"` } func (entity *UserPrivacySettingRuleRestrictUsers) MarshalJSON() ([]byte, error) { @@ -22741,7 +25076,7 @@ func (*UserPrivacySettingAllowFindingByPhoneNumber) UserPrivacySettingType() str // Contains information about the period of inactivity after which the current user's account will automatically be deleted type AccountTtl struct { meta - // Number of days of inactivity before the account will be flagged for deletion; should range from 30-366 days + // Number of days of inactivity before the account will be flagged for deletion; 30-366 days Days int32 `json:"days"` } @@ -22761,7 +25096,7 @@ func (*AccountTtl) GetType() string { return TypeAccountTtl } -// Contains information about one session in a Telegram application used by the current user. Sessions should be shown to the user in the returned order +// Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order type Session struct { meta // Session identifier @@ -22770,6 +25105,10 @@ type Session struct { IsCurrent bool `json:"is_current"` // True, if a password is needed to complete authorization of the session IsPasswordPending bool `json:"is_password_pending"` + // True, if incoming secret chats can be accepted by the session + CanAcceptSecretChats bool `json:"can_accept_secret_chats"` + // True, if incoming calls can be accepted by the session + CanAcceptCalls bool `json:"can_accept_calls"` // Telegram API identifier, as provided by the application ApiId int32 `json:"api_id"` // Name of the application, as provided by the application @@ -22817,6 +25156,8 @@ type Sessions struct { meta // List of sessions Sessions []*Session `json:"sessions"` + // Number of days of inactivity before sessions will automatically be terminated; 1-366 days + InactiveSessionTtlDays int32 `json:"inactive_session_ttl_days"` } func (entity *Sessions) MarshalJSON() ([]byte, error) { @@ -22843,7 +25184,7 @@ type ConnectedWebsite struct { // The domain name of the website DomainName string `json:"domain_name"` // User identifier of a bot linked with the website - BotUserId int32 `json:"bot_user_id"` + BotUserId int64 `json:"bot_user_id"` // The version of a browser used to log in Browser string `json:"browser"` // Operating system the browser is running on @@ -23047,11 +25388,34 @@ func (*ChatReportReasonUnrelatedLocation) ChatReportReasonType() string { return TypeChatReportReasonUnrelatedLocation } +// The chat represents a fake account +type ChatReportReasonFake struct { + meta +} + +func (entity *ChatReportReasonFake) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatReportReasonFake + + return json.Marshal((*stub)(entity)) +} + +func (*ChatReportReasonFake) GetClass() string { + return ClassChatReportReason +} + +func (*ChatReportReasonFake) GetType() string { + return TypeChatReportReasonFake +} + +func (*ChatReportReasonFake) ChatReportReasonType() string { + return TypeChatReportReasonFake +} + // A custom reason provided by the user type ChatReportReasonCustom struct { meta - // Report text - Text string `json:"text"` } func (entity *ChatReportReasonCustom) MarshalJSON() ([]byte, error) { @@ -23074,6 +25438,687 @@ func (*ChatReportReasonCustom) ChatReportReasonType() string { return TypeChatReportReasonCustom } +// The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link +type InternalLinkTypeActiveSessions struct { + meta +} + +func (entity *InternalLinkTypeActiveSessions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeActiveSessions + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeActiveSessions) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeActiveSessions) GetType() string { + return TypeInternalLinkTypeActiveSessions +} + +func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string { + return TypeInternalLinkTypeActiveSessions +} + +// The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode +type InternalLinkTypeAuthenticationCode struct { + meta + // The authentication code + Code string `json:"code"` +} + +func (entity *InternalLinkTypeAuthenticationCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeAuthenticationCode + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeAuthenticationCode) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeAuthenticationCode) GetType() string { + return TypeInternalLinkTypeAuthenticationCode +} + +func (*InternalLinkTypeAuthenticationCode) InternalLinkTypeType() string { + return TypeInternalLinkTypeAuthenticationCode +} + +// The link is a link to a background. Call searchBackground with the given background name to process the link +type InternalLinkTypeBackground struct { + meta + // Name of the background + BackgroundName string `json:"background_name"` +} + +func (entity *InternalLinkTypeBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeBackground + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeBackground) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeBackground) GetType() string { + return TypeInternalLinkTypeBackground +} + +func (*InternalLinkTypeBackground) InternalLinkTypeType() string { + return TypeInternalLinkTypeBackground +} + +// The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed +type InternalLinkTypeBotStart struct { + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // The parameter to be passed to sendBotStartMessage + StartParameter string `json:"start_parameter"` +} + +func (entity *InternalLinkTypeBotStart) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeBotStart + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeBotStart) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeBotStart) GetType() string { + return TypeInternalLinkTypeBotStart +} + +func (*InternalLinkTypeBotStart) InternalLinkTypeType() string { + return TypeInternalLinkTypeBotStart +} + +// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group +type InternalLinkTypeBotStartInGroup struct { + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // The parameter to be passed to sendBotStartMessage + StartParameter string `json:"start_parameter"` +} + +func (entity *InternalLinkTypeBotStartInGroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeBotStartInGroup + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeBotStartInGroup) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeBotStartInGroup) GetType() string { + return TypeInternalLinkTypeBotStartInGroup +} + +func (*InternalLinkTypeBotStartInGroup) InternalLinkTypeType() string { + return TypeInternalLinkTypeBotStartInGroup +} + +// The link is a link to the change phone number section of the app +type InternalLinkTypeChangePhoneNumber struct { + meta +} + +func (entity *InternalLinkTypeChangePhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChangePhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChangePhoneNumber) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChangePhoneNumber) GetType() string { + return TypeInternalLinkTypeChangePhoneNumber +} + +func (*InternalLinkTypeChangePhoneNumber) InternalLinkTypeType() string { + return TypeInternalLinkTypeChangePhoneNumber +} + +// The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link +type InternalLinkTypeChatInvite struct { + meta + // Internal representation of the invite link + InviteLink string `json:"invite_link"` +} + +func (entity *InternalLinkTypeChatInvite) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChatInvite + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChatInvite) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChatInvite) GetType() string { + return TypeInternalLinkTypeChatInvite +} + +func (*InternalLinkTypeChatInvite) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatInvite +} + +// The link is a link to the filter settings section of the app +type InternalLinkTypeFilterSettings struct { + meta +} + +func (entity *InternalLinkTypeFilterSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeFilterSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeFilterSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeFilterSettings) GetType() string { + return TypeInternalLinkTypeFilterSettings +} + +func (*InternalLinkTypeFilterSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeFilterSettings +} + +// The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame +type InternalLinkTypeGame struct { + meta + // Username of the bot that owns the game + BotUsername string `json:"bot_username"` + // Short name of the game + GameShortName string `json:"game_short_name"` +} + +func (entity *InternalLinkTypeGame) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeGame + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeGame) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeGame) GetType() string { + return TypeInternalLinkTypeGame +} + +func (*InternalLinkTypeGame) InternalLinkTypeType() string { + return TypeInternalLinkTypeGame +} + +// The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link +type InternalLinkTypeLanguagePack struct { + meta + // Language pack identifier + LanguagePackId string `json:"language_pack_id"` +} + +func (entity *InternalLinkTypeLanguagePack) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeLanguagePack + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeLanguagePack) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeLanguagePack) GetType() string { + return TypeInternalLinkTypeLanguagePack +} + +func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string { + return TypeInternalLinkTypeLanguagePack +} + +// The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link +type InternalLinkTypeMessage struct { + meta + // URL to be passed to getMessageLinkInfo + Url string `json:"url"` +} + +func (entity *InternalLinkTypeMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeMessage) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeMessage) GetType() string { + return TypeInternalLinkTypeMessage +} + +func (*InternalLinkTypeMessage) InternalLinkTypeType() string { + return TypeInternalLinkTypeMessage +} + +// The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field +type InternalLinkTypeMessageDraft struct { + meta + // Message draft text + Text *FormattedText `json:"text"` + // True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected + ContainsLink bool `json:"contains_link"` +} + +func (entity *InternalLinkTypeMessageDraft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeMessageDraft + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeMessageDraft) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeMessageDraft) GetType() string { + return TypeInternalLinkTypeMessageDraft +} + +func (*InternalLinkTypeMessageDraft) InternalLinkTypeType() string { + return TypeInternalLinkTypeMessageDraft +} + +// The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the app, otherwise ignore it +type InternalLinkTypePassportDataRequest struct { + meta + // User identifier of the service's bot + BotUserId int64 `json:"bot_user_id"` + // Telegram Passport element types requested by the service + Scope string `json:"scope"` + // Service's public key + PublicKey string `json:"public_key"` + // Unique request identifier provided by the service + Nonce string `json:"nonce"` + // An HTTP URL to open once the request is finished or canceled with the parameter tg_passport=success or tg_passport=cancel respectively. If empty, then the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel needs to be opened instead + CallbackUrl string `json:"callback_url"` +} + +func (entity *InternalLinkTypePassportDataRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePassportDataRequest + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePassportDataRequest) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePassportDataRequest) GetType() string { + return TypeInternalLinkTypePassportDataRequest +} + +func (*InternalLinkTypePassportDataRequest) InternalLinkTypeType() string { + return TypeInternalLinkTypePassportDataRequest +} + +// The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link +type InternalLinkTypePhoneNumberConfirmation struct { + meta + // Hash value from the link + Hash string `json:"hash"` + // Phone number value from the link + PhoneNumber string `json:"phone_number"` +} + +func (entity *InternalLinkTypePhoneNumberConfirmation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePhoneNumberConfirmation + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePhoneNumberConfirmation) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePhoneNumberConfirmation) GetType() string { + return TypeInternalLinkTypePhoneNumberConfirmation +} + +func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string { + return TypeInternalLinkTypePhoneNumberConfirmation +} + +// The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy +type InternalLinkTypeProxy struct { + meta + // Proxy server IP address + Server string `json:"server"` + // Proxy server port + Port int32 `json:"port"` + // Type of the proxy + Type ProxyType `json:"type"` +} + +func (entity *InternalLinkTypeProxy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeProxy + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeProxy) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeProxy) GetType() string { + return TypeInternalLinkTypeProxy +} + +func (*InternalLinkTypeProxy) InternalLinkTypeType() string { + return TypeInternalLinkTypeProxy +} + +func (internalLinkTypeProxy *InternalLinkTypeProxy) UnmarshalJSON(data []byte) error { + var tmp struct { + Server string `json:"server"` + Port int32 `json:"port"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + internalLinkTypeProxy.Server = tmp.Server + internalLinkTypeProxy.Port = tmp.Port + + fieldType, _ := UnmarshalProxyType(tmp.Type) + internalLinkTypeProxy.Type = fieldType + + return nil +} + +// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link +type InternalLinkTypePublicChat struct { + meta + // Username of the chat + ChatUsername string `json:"chat_username"` +} + +func (entity *InternalLinkTypePublicChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePublicChat + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePublicChat) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePublicChat) GetType() string { + return TypeInternalLinkTypePublicChat +} + +func (*InternalLinkTypePublicChat) InternalLinkTypeType() string { + return TypeInternalLinkTypePublicChat +} + +// The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to "This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown +type InternalLinkTypeQrCodeAuthentication struct { + meta +} + +func (entity *InternalLinkTypeQrCodeAuthentication) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeQrCodeAuthentication + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeQrCodeAuthentication) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeQrCodeAuthentication) GetType() string { + return TypeInternalLinkTypeQrCodeAuthentication +} + +func (*InternalLinkTypeQrCodeAuthentication) InternalLinkTypeType() string { + return TypeInternalLinkTypeQrCodeAuthentication +} + +// The link is a link to app settings +type InternalLinkTypeSettings struct { + meta +} + +func (entity *InternalLinkTypeSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeSettings) GetType() string { + return TypeInternalLinkTypeSettings +} + +func (*InternalLinkTypeSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeSettings +} + +// The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set +type InternalLinkTypeStickerSet struct { + meta + // Name of the sticker set + StickerSetName string `json:"sticker_set_name"` +} + +func (entity *InternalLinkTypeStickerSet) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeStickerSet + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeStickerSet) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeStickerSet) GetType() string { + return TypeInternalLinkTypeStickerSet +} + +func (*InternalLinkTypeStickerSet) InternalLinkTypeType() string { + return TypeInternalLinkTypeStickerSet +} + +// The link is a link to a theme. TDLib has no theme support yet +type InternalLinkTypeTheme struct { + meta + // Name of the theme + ThemeName string `json:"theme_name"` +} + +func (entity *InternalLinkTypeTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeTheme + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeTheme) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeTheme) GetType() string { + return TypeInternalLinkTypeTheme +} + +func (*InternalLinkTypeTheme) InternalLinkTypeType() string { + return TypeInternalLinkTypeTheme +} + +// The link is a link to the theme settings section of the app +type InternalLinkTypeThemeSettings struct { + meta +} + +func (entity *InternalLinkTypeThemeSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeThemeSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeThemeSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeThemeSettings) GetType() string { + return TypeInternalLinkTypeThemeSettings +} + +func (*InternalLinkTypeThemeSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeThemeSettings +} + +// The link is an unknown tg: link. Call getDeepLinkInfo to process the link +type InternalLinkTypeUnknownDeepLink struct { + meta + // Link to be passed to getDeepLinkInfo + Link string `json:"link"` +} + +func (entity *InternalLinkTypeUnknownDeepLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeUnknownDeepLink + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeUnknownDeepLink) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeUnknownDeepLink) GetType() string { + return TypeInternalLinkTypeUnknownDeepLink +} + +func (*InternalLinkTypeUnknownDeepLink) InternalLinkTypeType() string { + return TypeInternalLinkTypeUnknownDeepLink +} + +// The link is a link to an unsupported proxy. An alert can be shown to the user +type InternalLinkTypeUnsupportedProxy struct { + meta +} + +func (entity *InternalLinkTypeUnsupportedProxy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeUnsupportedProxy + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeUnsupportedProxy) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeUnsupportedProxy) GetType() string { + return TypeInternalLinkTypeUnsupportedProxy +} + +func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { + return TypeInternalLinkTypeUnsupportedProxy +} + +// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link +type InternalLinkTypeVideoChat struct { + meta + // Username of the chat with the video chat + ChatUsername string `json:"chat_username"` + // If non-empty, invite hash to be used to join the video chat without being muted by administrators + InviteHash string `json:"invite_hash"` + // True, if the video chat is expected to be a live stream in a channel or a broadcast group + IsLiveStream bool `json:"is_live_stream"` +} + +func (entity *InternalLinkTypeVideoChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeVideoChat + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeVideoChat) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeVideoChat) GetType() string { + return TypeInternalLinkTypeVideoChat +} + +func (*InternalLinkTypeVideoChat) InternalLinkTypeType() string { + return TypeInternalLinkTypeVideoChat +} + // Contains an HTTPS link to a message in a supergroup or channel type MessageLink struct { meta @@ -23108,6 +26153,8 @@ type MessageLinkInfo struct { ChatId int64 `json:"chat_id"` // If found, the linked message; may be null Message *Message `json:"message"` + // Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview + MediaTimestamp int32 `json:"media_timestamp"` // True, if the whole media album to which the message belongs is linked ForAlbum bool `json:"for_album"` // True, if the message is linked as a channel post comment or from a message thread @@ -23558,7 +26605,7 @@ type StorageStatisticsByFileType struct { meta // File type FileType FileType `json:"file_type"` - // Total size of the files + // Total size of the files, in bytes Size int64 `json:"size"` // Total number of files Count int32 `json:"count"` @@ -23606,7 +26653,7 @@ type StorageStatisticsByChat struct { meta // Chat identifier; 0 if none ChatId int64 `json:"chat_id"` - // Total size of the files in the chat + // Total size of the files in the chat, in bytes Size int64 `json:"size"` // Total number of files in the chat Count int32 `json:"count"` @@ -23633,7 +26680,7 @@ func (*StorageStatisticsByChat) GetType() string { // Contains the exact storage usage statistics split by chats and file type type StorageStatistics struct { meta - // Total size of files + // Total size of files, in bytes Size int64 `json:"size"` // Total number of files Count int32 `json:"count"` @@ -23660,7 +26707,7 @@ func (*StorageStatistics) GetType() string { // Contains approximate storage usage statistics, excluding files of unknown file type type StorageStatisticsFast struct { meta - // Approximate total size of files + // Approximate total size of files, in bytes FilesSize int64 `json:"files_size"` // Approximate number of files FileCount int32 `json:"file_count"` @@ -23839,7 +26886,7 @@ func (*NetworkTypeOther) NetworkTypeType() string { // Contains information about the total amount of data that was used to send and receive files type NetworkStatisticsEntryFile struct { meta - // Type of the file the data is part of + // Type of the file the data is part of; pass null if the data isn't related to files FileType FileType `json:"file_type"` // Type of the network the data was sent through. Call setNetworkType to maintain the actual network type NetworkType NetworkType `json:"network_type"` @@ -23999,13 +27046,13 @@ type AutoDownloadSettings struct { meta // True, if the auto-download is enabled IsAutoDownloadEnabled bool `json:"is_auto_download_enabled"` - // The maximum size of a photo file to be auto-downloaded + // The maximum size of a photo file to be auto-downloaded, in bytes MaxPhotoFileSize int32 `json:"max_photo_file_size"` - // The maximum size of a video file to be auto-downloaded + // The maximum size of a video file to be auto-downloaded, in bytes MaxVideoFileSize int32 `json:"max_video_file_size"` - // The maximum size of other file types to be auto-downloaded + // The maximum size of other file types to be auto-downloaded, in bytes MaxOtherFileSize int32 `json:"max_other_file_size"` - // The maximum suggested bitrate for uploaded videos + // The maximum suggested bitrate for uploaded videos, in kbit/s VideoUploadBitrate int32 `json:"video_upload_bitrate"` // True, if the beginning of video files needs to be preloaded for instant playback PreloadLargeVideos bool `json:"preload_large_videos"` @@ -24031,7 +27078,7 @@ func (*AutoDownloadSettings) GetType() string { return TypeAutoDownloadSettings } -// Contains auto-download settings presets for the user +// Contains auto-download settings presets for the current user type AutoDownloadSettingsPresets struct { meta // Preset with lowest settings; supposed to be used by default when roaming @@ -24362,7 +27409,7 @@ func (*TopChatCategoryForwardChats) TopChatCategoryType() string { type TMeUrlTypeUser struct { meta // Identifier of the user - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` } func (entity *TMeUrlTypeUser) MarshalJSON() ([]byte, error) { @@ -24558,7 +27605,32 @@ func (*SuggestedActionEnableArchiveAndMuteNewChats) SuggestedActionType() string return TypeSuggestedActionEnableArchiveAndMuteNewChats } -// Suggests the user to check authorization phone number and change the phone number if it is inaccessible +// Suggests the user to check whether they still remember their 2-step verification password +type SuggestedActionCheckPassword struct { + meta +} + +func (entity *SuggestedActionCheckPassword) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionCheckPassword + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionCheckPassword) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionCheckPassword) GetType() string { + return TypeSuggestedActionCheckPassword +} + +func (*SuggestedActionCheckPassword) SuggestedActionType() string { + return TypeSuggestedActionCheckPassword +} + +// Suggests the user to check whether authorization phone number is correct and change the phone number if it is inaccessible type SuggestedActionCheckPhoneNumber struct { meta } @@ -24583,6 +27655,85 @@ func (*SuggestedActionCheckPhoneNumber) SuggestedActionType() string { return TypeSuggestedActionCheckPhoneNumber } +// Suggests the user to view a hint about the meaning of one and two check marks on sent messages +type SuggestedActionViewChecksHint struct { + meta +} + +func (entity *SuggestedActionViewChecksHint) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionViewChecksHint + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionViewChecksHint) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionViewChecksHint) GetType() string { + return TypeSuggestedActionViewChecksHint +} + +func (*SuggestedActionViewChecksHint) SuggestedActionType() string { + return TypeSuggestedActionViewChecksHint +} + +// Suggests the user to convert specified supergroup to a broadcast group +type SuggestedActionConvertToBroadcastGroup struct { + meta + // Supergroup identifier + SupergroupId int64 `json:"supergroup_id"` +} + +func (entity *SuggestedActionConvertToBroadcastGroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionConvertToBroadcastGroup + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionConvertToBroadcastGroup) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionConvertToBroadcastGroup) GetType() string { + return TypeSuggestedActionConvertToBroadcastGroup +} + +func (*SuggestedActionConvertToBroadcastGroup) SuggestedActionType() string { + return TypeSuggestedActionConvertToBroadcastGroup +} + +// Suggests the user to set a 2-step verification password to be able to log in again +type SuggestedActionSetPassword struct { + meta + // The number of days to pass between consecutive authorizations if the user declines to set password + AuthorizationDelay int32 `json:"authorization_delay"` +} + +func (entity *SuggestedActionSetPassword) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionSetPassword + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionSetPassword) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionSetPassword) GetType() string { + return TypeSuggestedActionSetPassword +} + +func (*SuggestedActionSetPassword) SuggestedActionType() string { + return TypeSuggestedActionSetPassword +} + // Contains a counter type Count struct { meta @@ -24652,12 +27803,12 @@ func (*Seconds) GetType() string { return TypeSeconds } -// Contains information about a tg:// deep link +// Contains information about a tg: deep link type DeepLinkInfo struct { meta // Text to be shown to the user Text *FormattedText `json:"text"` - // True, if user should be asked to update the application + // True, if the user must be asked to update the application NeedUpdateApplication bool `json:"need_update_application"` } @@ -24906,7 +28057,7 @@ type InputStickerStatic struct { 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 + // For masks, position where the mask is placed; pass null if unspecified MaskPosition *MaskPosition `json:"mask_position"` } @@ -25165,10 +28316,10 @@ func (*ChatStatisticsMessageInteractionInfo) GetType() string { type ChatStatisticsMessageSenderInfo struct { meta // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // Number of sent messages SentMessageCount int32 `json:"sent_message_count"` - // Average number of characters in sent messages + // Average number of characters in sent messages; 0 if unknown AverageCharacterCount int32 `json:"average_character_count"` } @@ -25192,7 +28343,7 @@ func (*ChatStatisticsMessageSenderInfo) GetType() string { type ChatStatisticsAdministratorActionsInfo struct { meta // Administrator user identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // Number of messages deleted by the administrator DeletedMessageCount int32 `json:"deleted_message_count"` // Number of users banned by the administrator @@ -25221,7 +28372,7 @@ func (*ChatStatisticsAdministratorActionsInfo) GetType() string { type ChatStatisticsInviterInfo struct { meta // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // Number of new members invited by the user AddedMemberCount int32 `json:"added_member_count"` } @@ -25515,6 +28666,272 @@ func (messageStatistics *MessageStatistics) UnmarshalJSON(data []byte) error { return nil } +// A point on a Cartesian plane +type Point struct { + meta + // The point's first coordinate + X float64 `json:"x"` + // The point's second coordinate + Y float64 `json:"y"` +} + +func (entity *Point) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Point + + return json.Marshal((*stub)(entity)) +} + +func (*Point) GetClass() string { + return ClassPoint +} + +func (*Point) GetType() string { + return TypePoint +} + +// A straight line to a given point +type VectorPathCommandLine struct { + meta + // The end point of the straight line + EndPoint *Point `json:"end_point"` +} + +func (entity *VectorPathCommandLine) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub VectorPathCommandLine + + return json.Marshal((*stub)(entity)) +} + +func (*VectorPathCommandLine) GetClass() string { + return ClassVectorPathCommand +} + +func (*VectorPathCommandLine) GetType() string { + return TypeVectorPathCommandLine +} + +func (*VectorPathCommandLine) VectorPathCommandType() string { + return TypeVectorPathCommandLine +} + +// A cubic Bézier curve to a given point +type VectorPathCommandCubicBezierCurve struct { + meta + // The start control point of the curve + StartControlPoint *Point `json:"start_control_point"` + // The end control point of the curve + EndControlPoint *Point `json:"end_control_point"` + // The end point of the curve + EndPoint *Point `json:"end_point"` +} + +func (entity *VectorPathCommandCubicBezierCurve) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub VectorPathCommandCubicBezierCurve + + return json.Marshal((*stub)(entity)) +} + +func (*VectorPathCommandCubicBezierCurve) GetClass() string { + return ClassVectorPathCommand +} + +func (*VectorPathCommandCubicBezierCurve) GetType() string { + return TypeVectorPathCommandCubicBezierCurve +} + +func (*VectorPathCommandCubicBezierCurve) VectorPathCommandType() string { + return TypeVectorPathCommandCubicBezierCurve +} + +// A scope covering all users +type BotCommandScopeDefault struct { + meta +} + +func (entity *BotCommandScopeDefault) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotCommandScopeDefault + + return json.Marshal((*stub)(entity)) +} + +func (*BotCommandScopeDefault) GetClass() string { + return ClassBotCommandScope +} + +func (*BotCommandScopeDefault) GetType() string { + return TypeBotCommandScopeDefault +} + +func (*BotCommandScopeDefault) BotCommandScopeType() string { + return TypeBotCommandScopeDefault +} + +// A scope covering all private chats +type BotCommandScopeAllPrivateChats struct { + meta +} + +func (entity *BotCommandScopeAllPrivateChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotCommandScopeAllPrivateChats + + return json.Marshal((*stub)(entity)) +} + +func (*BotCommandScopeAllPrivateChats) GetClass() string { + return ClassBotCommandScope +} + +func (*BotCommandScopeAllPrivateChats) GetType() string { + return TypeBotCommandScopeAllPrivateChats +} + +func (*BotCommandScopeAllPrivateChats) BotCommandScopeType() string { + return TypeBotCommandScopeAllPrivateChats +} + +// A scope covering all group and supergroup chats +type BotCommandScopeAllGroupChats struct { + meta +} + +func (entity *BotCommandScopeAllGroupChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotCommandScopeAllGroupChats + + return json.Marshal((*stub)(entity)) +} + +func (*BotCommandScopeAllGroupChats) GetClass() string { + return ClassBotCommandScope +} + +func (*BotCommandScopeAllGroupChats) GetType() string { + return TypeBotCommandScopeAllGroupChats +} + +func (*BotCommandScopeAllGroupChats) BotCommandScopeType() string { + return TypeBotCommandScopeAllGroupChats +} + +// A scope covering all group and supergroup chat administrators +type BotCommandScopeAllChatAdministrators struct { + meta +} + +func (entity *BotCommandScopeAllChatAdministrators) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotCommandScopeAllChatAdministrators + + return json.Marshal((*stub)(entity)) +} + +func (*BotCommandScopeAllChatAdministrators) GetClass() string { + return ClassBotCommandScope +} + +func (*BotCommandScopeAllChatAdministrators) GetType() string { + return TypeBotCommandScopeAllChatAdministrators +} + +func (*BotCommandScopeAllChatAdministrators) BotCommandScopeType() string { + return TypeBotCommandScopeAllChatAdministrators +} + +// A scope covering all members of a chat +type BotCommandScopeChat struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +func (entity *BotCommandScopeChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotCommandScopeChat + + return json.Marshal((*stub)(entity)) +} + +func (*BotCommandScopeChat) GetClass() string { + return ClassBotCommandScope +} + +func (*BotCommandScopeChat) GetType() string { + return TypeBotCommandScopeChat +} + +func (*BotCommandScopeChat) BotCommandScopeType() string { + return TypeBotCommandScopeChat +} + +// A scope covering all administrators of a chat +type BotCommandScopeChatAdministrators struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +func (entity *BotCommandScopeChatAdministrators) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotCommandScopeChatAdministrators + + return json.Marshal((*stub)(entity)) +} + +func (*BotCommandScopeChatAdministrators) GetClass() string { + return ClassBotCommandScope +} + +func (*BotCommandScopeChatAdministrators) GetType() string { + return TypeBotCommandScopeChatAdministrators +} + +func (*BotCommandScopeChatAdministrators) BotCommandScopeType() string { + return TypeBotCommandScopeChatAdministrators +} + +// A scope covering a member of a chat +type BotCommandScopeChatMember struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // User identifier + UserId int64 `json:"user_id"` +} + +func (entity *BotCommandScopeChatMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotCommandScopeChatMember + + return json.Marshal((*stub)(entity)) +} + +func (*BotCommandScopeChatMember) GetClass() string { + return ClassBotCommandScope +} + +func (*BotCommandScopeChatMember) GetType() string { + return TypeBotCommandScopeChatMember +} + +func (*BotCommandScopeChatMember) BotCommandScopeType() string { + return TypeBotCommandScopeChatMember +} + // The user authorization state has changed type UpdateAuthorizationState struct { meta @@ -25617,7 +29034,7 @@ func (*UpdateMessageSendAcknowledged) UpdateType() string { // A message has been successfully sent type UpdateMessageSendSucceeded struct { meta - // Information about the sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change + // The sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change Message *Message `json:"message"` // The previous temporary message identifier OldMessageId int64 `json:"old_message_id"` @@ -25646,7 +29063,7 @@ func (*UpdateMessageSendSucceeded) UpdateType() string { // A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update type UpdateMessageSendFailed struct { meta - // Contains information about the message which failed to send + // The failed to send message Message *Message `json:"message"` // The previous temporary message identifier OldMessageId int64 `json:"old_message_id"` @@ -26109,123 +29526,7 @@ func (*UpdateChatPosition) UpdateType() string { return TypeUpdateChatPosition } -// A chat was marked as unread or was read -type UpdateChatIsMarkedAsUnread struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of is_marked_as_unread - IsMarkedAsUnread bool `json:"is_marked_as_unread"` -} - -func (entity *UpdateChatIsMarkedAsUnread) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatIsMarkedAsUnread - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatIsMarkedAsUnread) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatIsMarkedAsUnread) GetType() string { - return TypeUpdateChatIsMarkedAsUnread -} - -func (*UpdateChatIsMarkedAsUnread) UpdateType() string { - return TypeUpdateChatIsMarkedAsUnread -} - -// A chat was blocked or unblocked -type UpdateChatIsBlocked struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of is_blocked - IsBlocked bool `json:"is_blocked"` -} - -func (entity *UpdateChatIsBlocked) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatIsBlocked - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatIsBlocked) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatIsBlocked) GetType() string { - return TypeUpdateChatIsBlocked -} - -func (*UpdateChatIsBlocked) UpdateType() string { - return TypeUpdateChatIsBlocked -} - -// A chat's has_scheduled_messages field has changed -type UpdateChatHasScheduledMessages struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of has_scheduled_messages - HasScheduledMessages bool `json:"has_scheduled_messages"` -} - -func (entity *UpdateChatHasScheduledMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatHasScheduledMessages - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatHasScheduledMessages) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatHasScheduledMessages) GetType() string { - return TypeUpdateChatHasScheduledMessages -} - -func (*UpdateChatHasScheduledMessages) UpdateType() string { - return TypeUpdateChatHasScheduledMessages -} - -// The value of the default disable_notification parameter, used when a message is sent to the chat, was changed -type UpdateChatDefaultDisableNotification struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new default_disable_notification value - DefaultDisableNotification bool `json:"default_disable_notification"` -} - -func (entity *UpdateChatDefaultDisableNotification) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatDefaultDisableNotification - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatDefaultDisableNotification) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatDefaultDisableNotification) GetType() string { - return TypeUpdateChatDefaultDisableNotification -} - -func (*UpdateChatDefaultDisableNotification) UpdateType() string { - return TypeUpdateChatDefaultDisableNotification -} - -// Incoming messages were read or number of unread messages has been changed +// Incoming messages were read or the number of unread messages has been changed type UpdateChatReadInbox struct { meta // Chat identifier @@ -26285,112 +29586,6 @@ func (*UpdateChatReadOutbox) UpdateType() string { return TypeUpdateChatReadOutbox } -// The chat unread_mention_count has changed -type UpdateChatUnreadMentionCount struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The number of unread mention messages left in the chat - UnreadMentionCount int32 `json:"unread_mention_count"` -} - -func (entity *UpdateChatUnreadMentionCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatUnreadMentionCount - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatUnreadMentionCount) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatUnreadMentionCount) GetType() string { - return TypeUpdateChatUnreadMentionCount -} - -func (*UpdateChatUnreadMentionCount) UpdateType() string { - return TypeUpdateChatUnreadMentionCount -} - -// Notification settings for a chat were changed -type UpdateChatNotificationSettings struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new notification settings - NotificationSettings *ChatNotificationSettings `json:"notification_settings"` -} - -func (entity *UpdateChatNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatNotificationSettings - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatNotificationSettings) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatNotificationSettings) GetType() string { - return TypeUpdateChatNotificationSettings -} - -func (*UpdateChatNotificationSettings) UpdateType() string { - return TypeUpdateChatNotificationSettings -} - -// Notification settings for some type of chats were updated -type UpdateScopeNotificationSettings struct { - meta - // Types of chats for which notification settings were updated - Scope NotificationSettingsScope `json:"scope"` - // The new notification settings - NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` -} - -func (entity *UpdateScopeNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateScopeNotificationSettings - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateScopeNotificationSettings) GetClass() string { - return ClassUpdate -} - -func (*UpdateScopeNotificationSettings) GetType() string { - return TypeUpdateScopeNotificationSettings -} - -func (*UpdateScopeNotificationSettings) UpdateType() string { - return TypeUpdateScopeNotificationSettings -} - -func (updateScopeNotificationSettings *UpdateScopeNotificationSettings) UnmarshalJSON(data []byte) error { - var tmp struct { - Scope json.RawMessage `json:"scope"` - NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - updateScopeNotificationSettings.NotificationSettings = tmp.NotificationSettings - - fieldScope, _ := UnmarshalNotificationSettingsScope(tmp.Scope) - updateScopeNotificationSettings.Scope = fieldScope - - return nil -} - // The chat action bar was changed type UpdateChatActionBar struct { meta @@ -26439,6 +29634,172 @@ func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error return nil } +// A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied +type UpdateChatDraftMessage struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new draft message; may be null + DraftMessage *DraftMessage `json:"draft_message"` + // The new chat positions in the chat lists + Positions []*ChatPosition `json:"positions"` +} + +func (entity *UpdateChatDraftMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatDraftMessage + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatDraftMessage) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatDraftMessage) GetType() string { + return TypeUpdateChatDraftMessage +} + +func (*UpdateChatDraftMessage) UpdateType() string { + return TypeUpdateChatDraftMessage +} + +// The message sender that is selected to send messages in a chat has changed +type UpdateChatMessageSender struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of message_sender_id; may be null if the user can't change message sender + MessageSenderId MessageSender `json:"message_sender_id"` +} + +func (entity *UpdateChatMessageSender) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatMessageSender + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatMessageSender) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatMessageSender) GetType() string { + return TypeUpdateChatMessageSender +} + +func (*UpdateChatMessageSender) UpdateType() string { + return TypeUpdateChatMessageSender +} + +func (updateChatMessageSender *UpdateChatMessageSender) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageSenderId json.RawMessage `json:"message_sender_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatMessageSender.ChatId = tmp.ChatId + + fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) + updateChatMessageSender.MessageSenderId = fieldMessageSenderId + + return nil +} + +// The message Time To Live setting for a chat was changed +type UpdateChatMessageTtl struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of message_ttl + MessageTtl int32 `json:"message_ttl"` +} + +func (entity *UpdateChatMessageTtl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatMessageTtl + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatMessageTtl) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatMessageTtl) GetType() string { + return TypeUpdateChatMessageTtl +} + +func (*UpdateChatMessageTtl) UpdateType() string { + return TypeUpdateChatMessageTtl +} + +// Notification settings for a chat were changed +type UpdateChatNotificationSettings struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new notification settings + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` +} + +func (entity *UpdateChatNotificationSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatNotificationSettings + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatNotificationSettings) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatNotificationSettings) GetType() string { + return TypeUpdateChatNotificationSettings +} + +func (*UpdateChatNotificationSettings) UpdateType() string { + return TypeUpdateChatNotificationSettings +} + +// The chat pending join requests were changed +type UpdateChatPendingJoinRequests struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new data about pending join requests; may be null + PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"` +} + +func (entity *UpdateChatPendingJoinRequests) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatPendingJoinRequests + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatPendingJoinRequests) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatPendingJoinRequests) GetType() string { + return TypeUpdateChatPendingJoinRequests +} + +func (*UpdateChatPendingJoinRequests) UpdateType() string { + return TypeUpdateChatPendingJoinRequests +} + // 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 @@ -26468,35 +29829,236 @@ func (*UpdateChatReplyMarkup) UpdateType() string { return TypeUpdateChatReplyMarkup } -// A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update shouldn't be applied -type UpdateChatDraftMessage struct { +// The chat theme was changed +type UpdateChatTheme struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // The new draft message; may be null - DraftMessage *DraftMessage `json:"draft_message"` - // The new chat positions in the chat lists - Positions []*ChatPosition `json:"positions"` + // The new name of the chat theme; may be empty if theme was reset to default + ThemeName string `json:"theme_name"` } -func (entity *UpdateChatDraftMessage) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatTheme) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatDraftMessage + type stub UpdateChatTheme return json.Marshal((*stub)(entity)) } -func (*UpdateChatDraftMessage) GetClass() string { +func (*UpdateChatTheme) GetClass() string { return ClassUpdate } -func (*UpdateChatDraftMessage) GetType() string { - return TypeUpdateChatDraftMessage +func (*UpdateChatTheme) GetType() string { + return TypeUpdateChatTheme } -func (*UpdateChatDraftMessage) UpdateType() string { - return TypeUpdateChatDraftMessage +func (*UpdateChatTheme) UpdateType() string { + return TypeUpdateChatTheme +} + +// The chat unread_mention_count has changed +type UpdateChatUnreadMentionCount struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The number of unread mention messages left in the chat + UnreadMentionCount int32 `json:"unread_mention_count"` +} + +func (entity *UpdateChatUnreadMentionCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatUnreadMentionCount + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatUnreadMentionCount) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatUnreadMentionCount) GetType() string { + return TypeUpdateChatUnreadMentionCount +} + +func (*UpdateChatUnreadMentionCount) UpdateType() string { + return TypeUpdateChatUnreadMentionCount +} + +// A chat video chat state has changed +type UpdateChatVideoChat struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of video_chat + VideoChat *VideoChat `json:"video_chat"` +} + +func (entity *UpdateChatVideoChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatVideoChat + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatVideoChat) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatVideoChat) GetType() string { + return TypeUpdateChatVideoChat +} + +func (*UpdateChatVideoChat) UpdateType() string { + return TypeUpdateChatVideoChat +} + +// The value of the default disable_notification parameter, used when a message is sent to the chat, was changed +type UpdateChatDefaultDisableNotification struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new default_disable_notification value + DefaultDisableNotification bool `json:"default_disable_notification"` +} + +func (entity *UpdateChatDefaultDisableNotification) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatDefaultDisableNotification + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatDefaultDisableNotification) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatDefaultDisableNotification) GetType() string { + return TypeUpdateChatDefaultDisableNotification +} + +func (*UpdateChatDefaultDisableNotification) UpdateType() string { + return TypeUpdateChatDefaultDisableNotification +} + +// A chat content was allowed or restricted for saving +type UpdateChatHasProtectedContent struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of has_protected_content + HasProtectedContent bool `json:"has_protected_content"` +} + +func (entity *UpdateChatHasProtectedContent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatHasProtectedContent + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatHasProtectedContent) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatHasProtectedContent) GetType() string { + return TypeUpdateChatHasProtectedContent +} + +func (*UpdateChatHasProtectedContent) UpdateType() string { + return TypeUpdateChatHasProtectedContent +} + +// A chat's has_scheduled_messages field has changed +type UpdateChatHasScheduledMessages struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of has_scheduled_messages + HasScheduledMessages bool `json:"has_scheduled_messages"` +} + +func (entity *UpdateChatHasScheduledMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatHasScheduledMessages + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatHasScheduledMessages) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatHasScheduledMessages) GetType() string { + return TypeUpdateChatHasScheduledMessages +} + +func (*UpdateChatHasScheduledMessages) UpdateType() string { + return TypeUpdateChatHasScheduledMessages +} + +// A chat was blocked or unblocked +type UpdateChatIsBlocked struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of is_blocked + IsBlocked bool `json:"is_blocked"` +} + +func (entity *UpdateChatIsBlocked) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatIsBlocked + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatIsBlocked) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatIsBlocked) GetType() string { + return TypeUpdateChatIsBlocked +} + +func (*UpdateChatIsBlocked) UpdateType() string { + return TypeUpdateChatIsBlocked +} + +// A chat was marked as unread or was read +type UpdateChatIsMarkedAsUnread struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of is_marked_as_unread + IsMarkedAsUnread bool `json:"is_marked_as_unread"` +} + +func (entity *UpdateChatIsMarkedAsUnread) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatIsMarkedAsUnread + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatIsMarkedAsUnread) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatIsMarkedAsUnread) GetType() string { + return TypeUpdateChatIsMarkedAsUnread +} + +func (*UpdateChatIsMarkedAsUnread) UpdateType() string { + return TypeUpdateChatIsMarkedAsUnread } // The list of chat filters or a chat filter has changed @@ -26555,6 +30117,54 @@ func (*UpdateChatOnlineMemberCount) UpdateType() string { return TypeUpdateChatOnlineMemberCount } +// Notification settings for some type of chats were updated +type UpdateScopeNotificationSettings struct { + meta + // Types of chats for which notification settings were updated + Scope NotificationSettingsScope `json:"scope"` + // The new notification settings + NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` +} + +func (entity *UpdateScopeNotificationSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateScopeNotificationSettings + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateScopeNotificationSettings) GetClass() string { + return ClassUpdate +} + +func (*UpdateScopeNotificationSettings) GetType() string { + return TypeUpdateScopeNotificationSettings +} + +func (*UpdateScopeNotificationSettings) UpdateType() string { + return TypeUpdateScopeNotificationSettings +} + +func (updateScopeNotificationSettings *UpdateScopeNotificationSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + Scope json.RawMessage `json:"scope"` + NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateScopeNotificationSettings.NotificationSettings = tmp.NotificationSettings + + fieldScope, _ := UnmarshalNotificationSettingsScope(tmp.Scope) + updateScopeNotificationSettings.Scope = fieldScope + + return nil +} + // A notification was changed type UpdateNotification struct { meta @@ -26595,7 +30205,7 @@ type UpdateNotificationGroup struct { ChatId int64 `json:"chat_id"` // Chat identifier, which notification settings must be applied to the added notifications NotificationSettingsChatId int64 `json:"notification_settings_chat_id"` - // True, if the notifications should be shown without sound + // True, if the notifications must be shown without sound IsSilent bool `json:"is_silent"` // Total number of unread notifications in the group, can be bigger than number of active notifications TotalCount int32 `json:"total_count"` @@ -26745,44 +30355,44 @@ func (*UpdateDeleteMessages) UpdateType() string { return TypeUpdateDeleteMessages } -// User activity in the chat has changed -type UpdateUserChatAction struct { +// A message sender activity in the chat has changed +type UpdateChatAction 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 + // Identifier of a message sender performing the action + SenderId MessageSender `json:"sender_id"` + // The action Action ChatAction `json:"action"` } -func (entity *UpdateUserChatAction) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatAction) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateUserChatAction + type stub UpdateChatAction return json.Marshal((*stub)(entity)) } -func (*UpdateUserChatAction) GetClass() string { +func (*UpdateChatAction) GetClass() string { return ClassUpdate } -func (*UpdateUserChatAction) GetType() string { - return TypeUpdateUserChatAction +func (*UpdateChatAction) GetType() string { + return TypeUpdateChatAction } -func (*UpdateUserChatAction) UpdateType() string { - return TypeUpdateUserChatAction +func (*UpdateChatAction) UpdateType() string { + return TypeUpdateChatAction } -func (updateUserChatAction *UpdateUserChatAction) UnmarshalJSON(data []byte) error { +func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error { var tmp struct { ChatId int64 `json:"chat_id"` MessageThreadId int64 `json:"message_thread_id"` - UserId int32 `json:"user_id"` + SenderId json.RawMessage `json:"sender_id"` Action json.RawMessage `json:"action"` } @@ -26791,12 +30401,14 @@ func (updateUserChatAction *UpdateUserChatAction) UnmarshalJSON(data []byte) err return err } - updateUserChatAction.ChatId = tmp.ChatId - updateUserChatAction.MessageThreadId = tmp.MessageThreadId - updateUserChatAction.UserId = tmp.UserId + updateChatAction.ChatId = tmp.ChatId + updateChatAction.MessageThreadId = tmp.MessageThreadId + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + updateChatAction.SenderId = fieldSenderId fieldAction, _ := UnmarshalChatAction(tmp.Action) - updateUserChatAction.Action = fieldAction + updateChatAction.Action = fieldAction return nil } @@ -26805,7 +30417,7 @@ func (updateUserChatAction *UpdateUserChatAction) UnmarshalJSON(data []byte) err type UpdateUserStatus struct { meta // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // New status of the user Status UserStatus `json:"status"` } @@ -26832,7 +30444,7 @@ func (*UpdateUserStatus) UpdateType() string { func (updateUserStatus *UpdateUserStatus) UnmarshalJSON(data []byte) error { var tmp struct { - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` Status json.RawMessage `json:"status"` } @@ -26957,11 +30569,11 @@ func (*UpdateSecretChat) UpdateType() string { return TypeUpdateSecretChat } -// Some data from userFullInfo has been changed +// Some data in userFullInfo has been changed type UpdateUserFullInfo struct { meta // User identifier - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // New full information about the user UserFullInfo *UserFullInfo `json:"user_full_info"` } @@ -26986,11 +30598,11 @@ func (*UpdateUserFullInfo) UpdateType() string { return TypeUpdateUserFullInfo } -// Some data from basicGroupFullInfo has been changed +// Some data in basicGroupFullInfo has been changed type UpdateBasicGroupFullInfo struct { meta // Identifier of a basic group - BasicGroupId int32 `json:"basic_group_id"` + BasicGroupId int64 `json:"basic_group_id"` // New full information about the group BasicGroupFullInfo *BasicGroupFullInfo `json:"basic_group_full_info"` } @@ -27015,11 +30627,11 @@ func (*UpdateBasicGroupFullInfo) UpdateType() string { return TypeUpdateBasicGroupFullInfo } -// Some data from supergroupFullInfo has been changed +// Some data in supergroupFullInfo has been changed type UpdateSupergroupFullInfo struct { meta // Identifier of the supergroup or channel - SupergroupId int32 `json:"supergroup_id"` + SupergroupId int64 `json:"supergroup_id"` // New full information about the supergroup SupergroupFullInfo *SupergroupFullInfo `json:"supergroup_full_info"` } @@ -27044,10 +30656,10 @@ func (*UpdateSupergroupFullInfo) UpdateType() string { return TypeUpdateSupergroupFullInfo } -// Service notification from the server. Upon receiving this the application must show a popup with the content of the notification +// A service notification from the server was received. 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 + // Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" must be shown under notification; if user presses the second, all local data must be destroyed using Destroy method Type string `json:"type"` // Notification content Content MessageContent `json:"content"` @@ -27126,9 +30738,9 @@ type UpdateFileGenerationStart struct { GenerationId JsonInt64 `json:"generation_id"` // The path to a file from which a new file is generated; may be empty OriginalPath string `json:"original_path"` - // The path to a file that should be created and where the new file should be generated + // The path to a file that must be created and where the new file is 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 application + // 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 must be downloaded by the application Conversion string `json:"conversion"` } @@ -27206,6 +30818,62 @@ func (*UpdateCall) UpdateType() string { return TypeUpdateCall } +// Information about a group call was updated +type UpdateGroupCall struct { + meta + // New data about a group call + GroupCall *GroupCall `json:"group_call"` +} + +func (entity *UpdateGroupCall) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateGroupCall + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateGroupCall) GetClass() string { + return ClassUpdate +} + +func (*UpdateGroupCall) GetType() string { + return TypeUpdateGroupCall +} + +func (*UpdateGroupCall) UpdateType() string { + return TypeUpdateGroupCall +} + +// Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined +type UpdateGroupCallParticipant struct { + meta + // Identifier of group call + GroupCallId int32 `json:"group_call_id"` + // New data about a participant + Participant *GroupCallParticipant `json:"participant"` +} + +func (entity *UpdateGroupCallParticipant) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateGroupCallParticipant + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateGroupCallParticipant) GetClass() string { + return ClassUpdate +} + +func (*UpdateGroupCallParticipant) GetType() string { + return TypeUpdateGroupCallParticipant +} + +func (*UpdateGroupCallParticipant) UpdateType() string { + return TypeUpdateGroupCallParticipant +} + // New call signaling data arrived type UpdateNewCallSignalingData struct { meta @@ -27642,6 +31310,33 @@ func (*UpdateSelectedBackground) UpdateType() string { return TypeUpdateSelectedBackground } +// The list of available chat themes has changed +type UpdateChatThemes struct { + meta + // The new list of chat themes + ChatThemes []*ChatTheme `json:"chat_themes"` +} + +func (entity *UpdateChatThemes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatThemes + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatThemes) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatThemes) GetType() string { + return TypeUpdateChatThemes +} + +func (*UpdateChatThemes) UpdateType() string { + return TypeUpdateChatThemes +} + // Some language pack strings have been updated type UpdateLanguagePackStrings struct { meta @@ -27716,7 +31411,7 @@ func (updateConnectionState *UpdateConnectionState) UnmarshalJSON(data []byte) e return nil } -// 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" +// New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update" type UpdateTermsOfService struct { meta // Identifier of the terms of service @@ -27799,6 +31494,37 @@ func (*UpdateDiceEmojis) UpdateType() string { return TypeUpdateDiceEmojis } +// Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played +type UpdateAnimatedEmojiMessageClicked struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // The animated sticker to be played + Sticker *Sticker `json:"sticker"` +} + +func (entity *UpdateAnimatedEmojiMessageClicked) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAnimatedEmojiMessageClicked + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAnimatedEmojiMessageClicked) GetClass() string { + return ClassUpdate +} + +func (*UpdateAnimatedEmojiMessageClicked) GetType() string { + return TypeUpdateAnimatedEmojiMessageClicked +} + +func (*UpdateAnimatedEmojiMessageClicked) UpdateType() string { + return TypeUpdateAnimatedEmojiMessageClicked +} + // The parameters of animation search through GetOption("animation_search_bot_username") bot has changed type UpdateAnimationSearchParameters struct { meta @@ -27883,9 +31609,11 @@ type UpdateNewInlineQuery struct { // Unique query identifier Id JsonInt64 `json:"id"` // Identifier of the user who sent the query - SenderUserId int32 `json:"sender_user_id"` + SenderUserId int64 `json:"sender_user_id"` // User location; may be null UserLocation *Location `json:"user_location"` + // The type of the chat, from which the query originated; may be null if unknown + ChatType ChatType `json:"chat_type"` // Text of the query Query string `json:"query"` // Offset of the first entry to return @@ -27912,11 +31640,38 @@ func (*UpdateNewInlineQuery) UpdateType() string { return TypeUpdateNewInlineQuery } +func (updateNewInlineQuery *UpdateNewInlineQuery) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + SenderUserId int64 `json:"sender_user_id"` + UserLocation *Location `json:"user_location"` + ChatType json.RawMessage `json:"chat_type"` + Query string `json:"query"` + Offset string `json:"offset"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateNewInlineQuery.Id = tmp.Id + updateNewInlineQuery.SenderUserId = tmp.SenderUserId + updateNewInlineQuery.UserLocation = tmp.UserLocation + updateNewInlineQuery.Query = tmp.Query + updateNewInlineQuery.Offset = tmp.Offset + + fieldChatType, _ := UnmarshalChatType(tmp.ChatType) + updateNewInlineQuery.ChatType = fieldChatType + + return nil +} + // The user has chosen a result of an inline query; for bots only type UpdateNewChosenInlineResult struct { meta // Identifier of the user who sent the query - SenderUserId int32 `json:"sender_user_id"` + SenderUserId int64 `json:"sender_user_id"` // User location; may be null UserLocation *Location `json:"user_location"` // Text of the query @@ -27953,7 +31708,7 @@ type UpdateNewCallbackQuery struct { // Unique query identifier Id JsonInt64 `json:"id"` // Identifier of the user who sent the query - SenderUserId int32 `json:"sender_user_id"` + SenderUserId int64 `json:"sender_user_id"` // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` // Identifier of the message, from which the query originated @@ -27987,7 +31742,7 @@ func (*UpdateNewCallbackQuery) UpdateType() string { func (updateNewCallbackQuery *UpdateNewCallbackQuery) UnmarshalJSON(data []byte) error { var tmp struct { Id JsonInt64 `json:"id"` - SenderUserId int32 `json:"sender_user_id"` + SenderUserId int64 `json:"sender_user_id"` ChatId int64 `json:"chat_id"` MessageId int64 `json:"message_id"` ChatInstance JsonInt64 `json:"chat_instance"` @@ -28017,7 +31772,7 @@ type UpdateNewInlineCallbackQuery struct { // Unique query identifier Id JsonInt64 `json:"id"` // Identifier of the user who sent the query - SenderUserId int32 `json:"sender_user_id"` + SenderUserId int64 `json:"sender_user_id"` // Identifier of the inline message, from which the query originated InlineMessageId string `json:"inline_message_id"` // An identifier uniquely corresponding to the chat a message was sent to @@ -28049,7 +31804,7 @@ func (*UpdateNewInlineCallbackQuery) UpdateType() string { func (updateNewInlineCallbackQuery *UpdateNewInlineCallbackQuery) UnmarshalJSON(data []byte) error { var tmp struct { Id JsonInt64 `json:"id"` - SenderUserId int32 `json:"sender_user_id"` + SenderUserId int64 `json:"sender_user_id"` InlineMessageId string `json:"inline_message_id"` ChatInstance JsonInt64 `json:"chat_instance"` Payload json.RawMessage `json:"payload"` @@ -28077,7 +31832,7 @@ type UpdateNewShippingQuery struct { // Unique query identifier Id JsonInt64 `json:"id"` // Identifier of the user who sent the query - SenderUserId int32 `json:"sender_user_id"` + SenderUserId int64 `json:"sender_user_id"` // Invoice payload InvoicePayload string `json:"invoice_payload"` // User shipping address @@ -28110,10 +31865,10 @@ type UpdateNewPreCheckoutQuery struct { // Unique query identifier Id JsonInt64 `json:"id"` // Identifier of the user who sent the query - SenderUserId int32 `json:"sender_user_id"` + SenderUserId int64 `json:"sender_user_id"` // Currency for the product price Currency string `json:"currency"` - // Total price for the product, in the minimal quantity of the currency + // Total price for the product, in the smallest units of the currency TotalAmount int64 `json:"total_amount"` // Invoice payload InvoicePayload []byte `json:"invoice_payload"` @@ -28234,7 +31989,7 @@ type UpdatePollAnswer struct { // Unique poll identifier PollId JsonInt64 `json:"poll_id"` // The user, who changed the answer to the poll - UserId int32 `json:"user_id"` + UserId int64 `json:"user_id"` // 0-based identifiers of answer options, chosen by the user OptionIds []int32 `json:"option_ids"` } @@ -28259,6 +32014,74 @@ func (*UpdatePollAnswer) UpdateType() string { return TypeUpdatePollAnswer } +// User rights changed in a chat; for bots only +type UpdateChatMember struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the user, changing the rights + ActorUserId int64 `json:"actor_user_id"` + // Point in time (Unix timestamp) when the user rights was changed + Date int32 `json:"date"` + // If user has joined the chat using an invite link, the invite link; may be null + InviteLink *ChatInviteLink `json:"invite_link"` + // Previous chat member + OldChatMember *ChatMember `json:"old_chat_member"` + // New chat member + NewChatMember *ChatMember `json:"new_chat_member"` +} + +func (entity *UpdateChatMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatMember + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatMember) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatMember) GetType() string { + return TypeUpdateChatMember +} + +func (*UpdateChatMember) UpdateType() string { + return TypeUpdateChatMember +} + +// A user sent a join request to a chat; for bots only +type UpdateNewChatJoinRequest struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Join request + Request *ChatJoinRequest `json:"request"` + // The invite link, which was used to send join request; may be null + InviteLink *ChatInviteLink `json:"invite_link"` +} + +func (entity *UpdateNewChatJoinRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewChatJoinRequest + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewChatJoinRequest) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewChatJoinRequest) GetType() string { + return TypeUpdateNewChatJoinRequest +} + +func (*UpdateNewChatJoinRequest) UpdateType() string { + return TypeUpdateNewChatJoinRequest +} + // Contains a list of updates type Updates struct { meta @@ -28328,7 +32151,7 @@ type LogStreamFile struct { meta // Path to the file to where the internal TDLib log will be written 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 + // The maximum size of the file to where the internal TDLib log is written before the file will automatically be rotated, in bytes MaxFileSize int64 `json:"max_file_size"` // Pass true to additionally redirect stderr to the log file. Ignored on Windows RedirectStderr bool `json:"redirect_stderr"` diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 367bf89..8c5bac0 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -28,6 +28,9 @@ func UnmarshalAuthenticationCodeType(data json.RawMessage) (AuthenticationCodeTy case TypeAuthenticationCodeTypeFlashCall: return UnmarshalAuthenticationCodeTypeFlashCall(data) + case TypeAuthenticationCodeTypeMissedCall: + return UnmarshalAuthenticationCodeTypeMissedCall(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -584,6 +587,9 @@ func UnmarshalMessageForwardOrigin(data json.RawMessage) (MessageForwardOrigin, case TypeMessageForwardOriginChannel: return UnmarshalMessageForwardOriginChannel(data) + case TypeMessageForwardOriginMessageImport: + return UnmarshalMessageForwardOriginMessageImport(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -834,6 +840,9 @@ func UnmarshalChatActionBar(data json.RawMessage) (ChatActionBar, error) { case TypeChatActionBarReportUnrelatedLocation: return UnmarshalChatActionBarReportUnrelatedLocation(data) + case TypeChatActionBarInviteMembers: + return UnmarshalChatActionBarInviteMembers(data) + case TypeChatActionBarReportAddBlock: return UnmarshalChatActionBarReportAddBlock(data) @@ -843,6 +852,9 @@ func UnmarshalChatActionBar(data json.RawMessage) (ChatActionBar, error) { case TypeChatActionBarSharePhoneNumber: return UnmarshalChatActionBarSharePhoneNumber(data) + case TypeChatActionBarJoinRequest: + return UnmarshalChatActionBarJoinRequest(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -932,6 +944,9 @@ func UnmarshalInlineKeyboardButtonType(data json.RawMessage) (InlineKeyboardButt case TypeInlineKeyboardButtonTypeBuy: return UnmarshalInlineKeyboardButtonTypeBuy(data) + case TypeInlineKeyboardButtonTypeUser: + return UnmarshalInlineKeyboardButtonTypeUser(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -1308,12 +1323,12 @@ func UnmarshalInputCredentials(data json.RawMessage) (InputCredentials, error) { case TypeInputCredentialsNew: return UnmarshalInputCredentialsNew(data) - case TypeInputCredentialsAndroidPay: - return UnmarshalInputCredentialsAndroidPay(data) - case TypeInputCredentialsApplePay: return UnmarshalInputCredentialsApplePay(data) + case TypeInputCredentialsGooglePay: + return UnmarshalInputCredentialsGooglePay(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -1695,6 +1710,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageContact: return UnmarshalMessageContact(data) + case TypeMessageAnimatedEmoji: + return UnmarshalMessageAnimatedEmoji(data) + case TypeMessageDice: return UnmarshalMessageDice(data) @@ -1710,6 +1728,18 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageCall: return UnmarshalMessageCall(data) + case TypeMessageVideoChatScheduled: + return UnmarshalMessageVideoChatScheduled(data) + + case TypeMessageVideoChatStarted: + return UnmarshalMessageVideoChatStarted(data) + + case TypeMessageVideoChatEnded: + return UnmarshalMessageVideoChatEnded(data) + + case TypeMessageInviteVideoChatParticipants: + return UnmarshalMessageInviteVideoChatParticipants(data) + case TypeMessageBasicGroupChatCreate: return UnmarshalMessageBasicGroupChatCreate(data) @@ -1731,6 +1761,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageChatJoinByLink: return UnmarshalMessageChatJoinByLink(data) + case TypeMessageChatJoinByRequest: + return UnmarshalMessageChatJoinByRequest(data) + case TypeMessageChatDeleteMember: return UnmarshalMessageChatDeleteMember(data) @@ -1746,6 +1779,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageScreenshotTaken: return UnmarshalMessageScreenshotTaken(data) + case TypeMessageChatSetTheme: + return UnmarshalMessageChatSetTheme(data) + case TypeMessageChatSetTtl: return UnmarshalMessageChatSetTtl(data) @@ -1858,6 +1894,9 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypeMentionName: return UnmarshalTextEntityTypeMentionName(data) + case TypeTextEntityTypeMediaTimestamp: + return UnmarshalTextEntityTypeMediaTimestamp(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2029,12 +2068,6 @@ func UnmarshalSearchMessagesFilter(data json.RawMessage) (SearchMessagesFilter, case TypeSearchMessagesFilterChatPhoto: return UnmarshalSearchMessagesFilterChatPhoto(data) - case TypeSearchMessagesFilterCall: - return UnmarshalSearchMessagesFilterCall(data) - - case TypeSearchMessagesFilterMissedCall: - return UnmarshalSearchMessagesFilterMissedCall(data) - case TypeSearchMessagesFilterVideoNote: return UnmarshalSearchMessagesFilterVideoNote(data) @@ -2102,6 +2135,9 @@ func UnmarshalChatAction(data json.RawMessage) (ChatAction, error) { case TypeChatActionUploadingDocument: return UnmarshalChatActionUploadingDocument(data) + case TypeChatActionChoosingSticker: + return UnmarshalChatActionChoosingSticker(data) + case TypeChatActionChoosingLocation: return UnmarshalChatActionChoosingLocation(data) @@ -2117,6 +2153,9 @@ func UnmarshalChatAction(data json.RawMessage) (ChatAction, error) { case TypeChatActionUploadingVideoNote: return UnmarshalChatActionUploadingVideoNote(data) + case TypeChatActionWatchingAnimations: + return UnmarshalChatActionWatchingAnimations(data) + case TypeChatActionCancel: return UnmarshalChatActionCancel(data) @@ -2308,6 +2347,43 @@ func UnmarshalListOfCallState(dataList []json.RawMessage) ([]CallState, error) { return list, nil } +func UnmarshalGroupCallVideoQuality(data json.RawMessage) (GroupCallVideoQuality, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeGroupCallVideoQualityThumbnail: + return UnmarshalGroupCallVideoQualityThumbnail(data) + + case TypeGroupCallVideoQualityMedium: + return UnmarshalGroupCallVideoQualityMedium(data) + + case TypeGroupCallVideoQualityFull: + return UnmarshalGroupCallVideoQualityFull(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfGroupCallVideoQuality(dataList []json.RawMessage) ([]GroupCallVideoQuality, error) { + list := []GroupCallVideoQuality{} + + for _, data := range dataList { + entity, err := UnmarshalGroupCallVideoQuality(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCallProblem(data json.RawMessage) (CallProblem, error) { var meta meta @@ -2589,6 +2665,12 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventMemberJoined: return UnmarshalChatEventMemberJoined(data) + case TypeChatEventMemberJoinedByInviteLink: + return UnmarshalChatEventMemberJoinedByInviteLink(data) + + case TypeChatEventMemberJoinedByRequest: + return UnmarshalChatEventMemberJoinedByRequest(data) + case TypeChatEventMemberLeft: return UnmarshalChatEventMemberLeft(data) @@ -2625,9 +2707,15 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventSlowModeDelayChanged: return UnmarshalChatEventSlowModeDelayChanged(data) + case TypeChatEventMessageTtlChanged: + return UnmarshalChatEventMessageTtlChanged(data) + case TypeChatEventSignMessagesToggled: return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) + case TypeChatEventStickerSetChanged: return UnmarshalChatEventStickerSetChanged(data) @@ -2637,6 +2725,30 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventIsAllHistoryAvailableToggled: return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventInviteLinkEdited: + return UnmarshalChatEventInviteLinkEdited(data) + + case TypeChatEventInviteLinkRevoked: + return UnmarshalChatEventInviteLinkRevoked(data) + + case TypeChatEventInviteLinkDeleted: + return UnmarshalChatEventInviteLinkDeleted(data) + + case TypeChatEventVideoChatCreated: + return UnmarshalChatEventVideoChatCreated(data) + + case TypeChatEventVideoChatEnded: + return UnmarshalChatEventVideoChatEnded(data) + + case TypeChatEventVideoChatParticipantIsMutedToggled: + return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) + + case TypeChatEventVideoChatParticipantVolumeLevelChanged: + return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) + + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2769,6 +2881,9 @@ func UnmarshalBackgroundFill(data json.RawMessage) (BackgroundFill, error) { case TypeBackgroundFillGradient: return UnmarshalBackgroundFillGradient(data) + case TypeBackgroundFillFreeformGradient: + return UnmarshalBackgroundFillFreeformGradient(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2942,6 +3057,117 @@ func UnmarshalListOfCheckChatUsernameResult(dataList []json.RawMessage) ([]Check return list, nil } +func UnmarshalCheckStickerSetNameResult(data json.RawMessage) (CheckStickerSetNameResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCheckStickerSetNameResultOk: + return UnmarshalCheckStickerSetNameResultOk(data) + + case TypeCheckStickerSetNameResultNameInvalid: + return UnmarshalCheckStickerSetNameResultNameInvalid(data) + + case TypeCheckStickerSetNameResultNameOccupied: + return UnmarshalCheckStickerSetNameResultNameOccupied(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCheckStickerSetNameResult(dataList []json.RawMessage) ([]CheckStickerSetNameResult, error) { + list := []CheckStickerSetNameResult{} + + for _, data := range dataList { + entity, err := UnmarshalCheckStickerSetNameResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalResetPasswordResult(data json.RawMessage) (ResetPasswordResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeResetPasswordResultOk: + return UnmarshalResetPasswordResultOk(data) + + case TypeResetPasswordResultPending: + return UnmarshalResetPasswordResultPending(data) + + case TypeResetPasswordResultDeclined: + return UnmarshalResetPasswordResultDeclined(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfResetPasswordResult(dataList []json.RawMessage) ([]ResetPasswordResult, error) { + list := []ResetPasswordResult{} + + for _, data := range dataList { + entity, err := UnmarshalResetPasswordResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalMessageFileType(data json.RawMessage) (MessageFileType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageFileTypePrivate: + return UnmarshalMessageFileTypePrivate(data) + + case TypeMessageFileTypeGroup: + return UnmarshalMessageFileTypeGroup(data) + + case TypeMessageFileTypeUnknown: + return UnmarshalMessageFileTypeUnknown(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageFileType(dataList []json.RawMessage) ([]MessageFileType, error) { + list := []MessageFileType{} + + for _, data := range dataList { + entity, err := UnmarshalMessageFileType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, error) { var meta meta @@ -3017,12 +3243,18 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentChatChangeTitle: return UnmarshalPushMessageContentChatChangeTitle(data) + case TypePushMessageContentChatSetTheme: + return UnmarshalPushMessageContentChatSetTheme(data) + case TypePushMessageContentChatDeleteMember: return UnmarshalPushMessageContentChatDeleteMember(data) case TypePushMessageContentChatJoinByLink: return UnmarshalPushMessageContentChatJoinByLink(data) + case TypePushMessageContentChatJoinByRequest: + return UnmarshalPushMessageContentChatJoinByRequest(data) + case TypePushMessageContentMessageForwards: return UnmarshalPushMessageContentMessageForwards(data) @@ -3345,6 +3577,9 @@ func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { case TypeChatReportReasonUnrelatedLocation: return UnmarshalChatReportReasonUnrelatedLocation(data) + case TypeChatReportReasonFake: + return UnmarshalChatReportReasonFake(data) + case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) @@ -3367,6 +3602,106 @@ func UnmarshalListOfChatReportReason(dataList []json.RawMessage) ([]ChatReportRe return list, nil } +func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInternalLinkTypeActiveSessions: + return UnmarshalInternalLinkTypeActiveSessions(data) + + case TypeInternalLinkTypeAuthenticationCode: + return UnmarshalInternalLinkTypeAuthenticationCode(data) + + case TypeInternalLinkTypeBackground: + return UnmarshalInternalLinkTypeBackground(data) + + case TypeInternalLinkTypeBotStart: + return UnmarshalInternalLinkTypeBotStart(data) + + case TypeInternalLinkTypeBotStartInGroup: + return UnmarshalInternalLinkTypeBotStartInGroup(data) + + case TypeInternalLinkTypeChangePhoneNumber: + return UnmarshalInternalLinkTypeChangePhoneNumber(data) + + case TypeInternalLinkTypeChatInvite: + return UnmarshalInternalLinkTypeChatInvite(data) + + case TypeInternalLinkTypeFilterSettings: + return UnmarshalInternalLinkTypeFilterSettings(data) + + case TypeInternalLinkTypeGame: + return UnmarshalInternalLinkTypeGame(data) + + case TypeInternalLinkTypeLanguagePack: + return UnmarshalInternalLinkTypeLanguagePack(data) + + case TypeInternalLinkTypeMessage: + return UnmarshalInternalLinkTypeMessage(data) + + case TypeInternalLinkTypeMessageDraft: + return UnmarshalInternalLinkTypeMessageDraft(data) + + case TypeInternalLinkTypePassportDataRequest: + return UnmarshalInternalLinkTypePassportDataRequest(data) + + case TypeInternalLinkTypePhoneNumberConfirmation: + return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + + case TypeInternalLinkTypeProxy: + return UnmarshalInternalLinkTypeProxy(data) + + case TypeInternalLinkTypePublicChat: + return UnmarshalInternalLinkTypePublicChat(data) + + case TypeInternalLinkTypeQrCodeAuthentication: + return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + + case TypeInternalLinkTypeSettings: + return UnmarshalInternalLinkTypeSettings(data) + + case TypeInternalLinkTypeStickerSet: + return UnmarshalInternalLinkTypeStickerSet(data) + + case TypeInternalLinkTypeTheme: + return UnmarshalInternalLinkTypeTheme(data) + + case TypeInternalLinkTypeThemeSettings: + return UnmarshalInternalLinkTypeThemeSettings(data) + + case TypeInternalLinkTypeUnknownDeepLink: + return UnmarshalInternalLinkTypeUnknownDeepLink(data) + + case TypeInternalLinkTypeUnsupportedProxy: + return UnmarshalInternalLinkTypeUnsupportedProxy(data) + + case TypeInternalLinkTypeVideoChat: + return UnmarshalInternalLinkTypeVideoChat(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInternalLinkType(dataList []json.RawMessage) ([]InternalLinkType, error) { + list := []InternalLinkType{} + + for _, data := range dataList { + entity, err := UnmarshalInternalLinkType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalFileType(data json.RawMessage) (FileType, error) { var meta meta @@ -3664,9 +3999,21 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { case TypeSuggestedActionEnableArchiveAndMuteNewChats: return UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data) + case TypeSuggestedActionCheckPassword: + return UnmarshalSuggestedActionCheckPassword(data) + case TypeSuggestedActionCheckPhoneNumber: return UnmarshalSuggestedActionCheckPhoneNumber(data) + case TypeSuggestedActionViewChecksHint: + return UnmarshalSuggestedActionViewChecksHint(data) + + case TypeSuggestedActionConvertToBroadcastGroup: + return UnmarshalSuggestedActionConvertToBroadcastGroup(data) + + case TypeSuggestedActionSetPassword: + return UnmarshalSuggestedActionSetPassword(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3862,6 +4209,89 @@ func UnmarshalListOfChatStatistics(dataList []json.RawMessage) ([]ChatStatistics return list, nil } +func UnmarshalVectorPathCommand(data json.RawMessage) (VectorPathCommand, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeVectorPathCommandLine: + return UnmarshalVectorPathCommandLine(data) + + case TypeVectorPathCommandCubicBezierCurve: + return UnmarshalVectorPathCommandCubicBezierCurve(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfVectorPathCommand(dataList []json.RawMessage) ([]VectorPathCommand, error) { + list := []VectorPathCommand{} + + for _, data := range dataList { + entity, err := UnmarshalVectorPathCommand(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalBotCommandScope(data json.RawMessage) (BotCommandScope, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBotCommandScopeDefault: + return UnmarshalBotCommandScopeDefault(data) + + case TypeBotCommandScopeAllPrivateChats: + return UnmarshalBotCommandScopeAllPrivateChats(data) + + case TypeBotCommandScopeAllGroupChats: + return UnmarshalBotCommandScopeAllGroupChats(data) + + case TypeBotCommandScopeAllChatAdministrators: + return UnmarshalBotCommandScopeAllChatAdministrators(data) + + case TypeBotCommandScopeChat: + return UnmarshalBotCommandScopeChat(data) + + case TypeBotCommandScopeChatAdministrators: + return UnmarshalBotCommandScopeChatAdministrators(data) + + case TypeBotCommandScopeChatMember: + return UnmarshalBotCommandScopeChatMember(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBotCommandScope(dataList []json.RawMessage) ([]BotCommandScope, error) { + list := []BotCommandScope{} + + for _, data := range dataList { + entity, err := UnmarshalBotCommandScope(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalUpdate(data json.RawMessage) (Update, error) { var meta meta @@ -3925,41 +4355,56 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatPosition: return UnmarshalUpdateChatPosition(data) - case TypeUpdateChatIsMarkedAsUnread: - return UnmarshalUpdateChatIsMarkedAsUnread(data) - - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(data) - - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(data) - - case TypeUpdateChatDefaultDisableNotification: - return UnmarshalUpdateChatDefaultDisableNotification(data) - case TypeUpdateChatReadInbox: return UnmarshalUpdateChatReadInbox(data) case TypeUpdateChatReadOutbox: return UnmarshalUpdateChatReadOutbox(data) - case TypeUpdateChatUnreadMentionCount: - return UnmarshalUpdateChatUnreadMentionCount(data) + case TypeUpdateChatActionBar: + return UnmarshalUpdateChatActionBar(data) + + case TypeUpdateChatDraftMessage: + return UnmarshalUpdateChatDraftMessage(data) + + case TypeUpdateChatMessageSender: + return UnmarshalUpdateChatMessageSender(data) + + case TypeUpdateChatMessageTtl: + return UnmarshalUpdateChatMessageTtl(data) case TypeUpdateChatNotificationSettings: return UnmarshalUpdateChatNotificationSettings(data) - case TypeUpdateScopeNotificationSettings: - return UnmarshalUpdateScopeNotificationSettings(data) - - case TypeUpdateChatActionBar: - return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatPendingJoinRequests: + return UnmarshalUpdateChatPendingJoinRequests(data) case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(data) - case TypeUpdateChatDraftMessage: - return UnmarshalUpdateChatDraftMessage(data) + case TypeUpdateChatTheme: + return UnmarshalUpdateChatTheme(data) + + case TypeUpdateChatUnreadMentionCount: + return UnmarshalUpdateChatUnreadMentionCount(data) + + case TypeUpdateChatVideoChat: + return UnmarshalUpdateChatVideoChat(data) + + case TypeUpdateChatDefaultDisableNotification: + return UnmarshalUpdateChatDefaultDisableNotification(data) + + case TypeUpdateChatHasProtectedContent: + return UnmarshalUpdateChatHasProtectedContent(data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(data) + + case TypeUpdateChatIsBlocked: + return UnmarshalUpdateChatIsBlocked(data) + + case TypeUpdateChatIsMarkedAsUnread: + return UnmarshalUpdateChatIsMarkedAsUnread(data) case TypeUpdateChatFilters: return UnmarshalUpdateChatFilters(data) @@ -3967,6 +4412,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) + case TypeUpdateScopeNotificationSettings: + return UnmarshalUpdateScopeNotificationSettings(data) + case TypeUpdateNotification: return UnmarshalUpdateNotification(data) @@ -3982,8 +4430,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateDeleteMessages: return UnmarshalUpdateDeleteMessages(data) - case TypeUpdateUserChatAction: - return UnmarshalUpdateUserChatAction(data) + case TypeUpdateChatAction: + return UnmarshalUpdateChatAction(data) case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(data) @@ -4024,6 +4472,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateCall: return UnmarshalUpdateCall(data) + case TypeUpdateGroupCall: + return UnmarshalUpdateGroupCall(data) + + case TypeUpdateGroupCallParticipant: + return UnmarshalUpdateGroupCallParticipant(data) + case TypeUpdateNewCallSignalingData: return UnmarshalUpdateNewCallSignalingData(data) @@ -4060,6 +4514,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(data) + case TypeUpdateChatThemes: + return UnmarshalUpdateChatThemes(data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(data) @@ -4075,6 +4532,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) + case TypeUpdateAnimatedEmojiMessageClicked: + return UnmarshalUpdateAnimatedEmojiMessageClicked(data) + case TypeUpdateAnimationSearchParameters: return UnmarshalUpdateAnimationSearchParameters(data) @@ -4111,6 +4571,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdatePollAnswer: return UnmarshalUpdatePollAnswer(data) + case TypeUpdateChatMember: + return UnmarshalUpdateChatMember(data) + + case TypeUpdateNewChatJoinRequest: + return UnmarshalUpdateNewChatJoinRequest(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -4223,6 +4689,14 @@ func UnmarshalAuthenticationCodeTypeFlashCall(data json.RawMessage) (*Authentica return &resp, err } +func UnmarshalAuthenticationCodeTypeMissedCall(data json.RawMessage) (*AuthenticationCodeTypeMissedCall, error) { + var resp AuthenticationCodeTypeMissedCall + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAuthenticationCodeInfo(data json.RawMessage) (*AuthenticationCodeInfo, error) { var resp AuthenticationCodeInfo @@ -4551,6 +5025,14 @@ func UnmarshalMaskPosition(data json.RawMessage) (*MaskPosition, error) { return &resp, err } +func UnmarshalClosedVectorPath(data json.RawMessage) (*ClosedVectorPath, error) { + var resp ClosedVectorPath + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPollOption(data json.RawMessage) (*PollOption, error) { var resp PollOption @@ -4639,6 +5121,14 @@ func UnmarshalVoiceNote(data json.RawMessage) (*VoiceNote, error) { return &resp, err } +func UnmarshalAnimatedEmoji(data json.RawMessage) (*AnimatedEmoji, error) { + var resp AnimatedEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalContact(data json.RawMessage) (*Contact, error) { var resp Contact @@ -4735,8 +5225,8 @@ func UnmarshalBotCommand(data json.RawMessage) (*BotCommand, error) { return &resp, err } -func UnmarshalBotInfo(data json.RawMessage) (*BotInfo, error) { - var resp BotInfo +func UnmarshalBotCommands(data json.RawMessage) (*BotCommands, error) { + var resp BotCommands err := json.Unmarshal(data, &resp) @@ -5031,6 +5521,86 @@ func UnmarshalSupergroupMembersFilterBots(data json.RawMessage) (*SupergroupMemb return &resp, err } +func UnmarshalChatInviteLink(data json.RawMessage) (*ChatInviteLink, error) { + var resp ChatInviteLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinks(data json.RawMessage) (*ChatInviteLinks, error) { + var resp ChatInviteLinks + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinkCount(data json.RawMessage) (*ChatInviteLinkCount, error) { + var resp ChatInviteLinkCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinkCounts(data json.RawMessage) (*ChatInviteLinkCounts, error) { + var resp ChatInviteLinkCounts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinkMember(data json.RawMessage) (*ChatInviteLinkMember, error) { + var resp ChatInviteLinkMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinkMembers(data json.RawMessage) (*ChatInviteLinkMembers, error) { + var resp ChatInviteLinkMembers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinkInfo(data json.RawMessage) (*ChatInviteLinkInfo, error) { + var resp ChatInviteLinkInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinRequest(data json.RawMessage) (*ChatJoinRequest, error) { + var resp ChatJoinRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinRequests(data json.RawMessage) (*ChatJoinRequests, error) { + var resp ChatJoinRequests + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinRequestsInfo(data json.RawMessage) (*ChatJoinRequestsInfo, error) { + var resp ChatJoinRequestsInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBasicGroup(data json.RawMessage) (*BasicGroup, error) { var resp BasicGroup @@ -5151,6 +5721,14 @@ func UnmarshalMessageForwardOriginChannel(data json.RawMessage) (*MessageForward return &resp, err } +func UnmarshalMessageForwardOriginMessageImport(data json.RawMessage) (*MessageForwardOriginMessageImport, error) { + var resp MessageForwardOriginMessageImport + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageForwardInfo(data json.RawMessage) (*MessageForwardInfo, error) { var resp MessageForwardInfo @@ -5215,6 +5793,46 @@ func UnmarshalFoundMessages(data json.RawMessage) (*FoundMessages, error) { return &resp, err } +func UnmarshalMessagePosition(data json.RawMessage) (*MessagePosition, error) { + var resp MessagePosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePositions(data json.RawMessage) (*MessagePositions, error) { + var resp MessagePositions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageCalendarDay(data json.RawMessage) (*MessageCalendarDay, error) { + var resp MessageCalendarDay + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageCalendar(data json.RawMessage) (*MessageCalendar, error) { + var resp MessageCalendar + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error) { + var resp SponsoredMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalNotificationSettingsScopePrivateChats(data json.RawMessage) (*NotificationSettingsScopePrivateChats, error) { var resp NotificationSettingsScopePrivateChats @@ -5383,6 +6001,14 @@ func UnmarshalChatPosition(data json.RawMessage) (*ChatPosition, error) { return &resp, err } +func UnmarshalVideoChat(data json.RawMessage) (*VideoChat, error) { + var resp VideoChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChat(data json.RawMessage) (*Chat, error) { var resp Chat @@ -5415,22 +6041,6 @@ func UnmarshalChatsNearby(data json.RawMessage) (*ChatsNearby, error) { return &resp, err } -func UnmarshalChatInviteLink(data json.RawMessage) (*ChatInviteLink, error) { - var resp ChatInviteLink - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatInviteLinkInfo(data json.RawMessage) (*ChatInviteLinkInfo, error) { - var resp ChatInviteLinkInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalPublicChatTypeHasUsername(data json.RawMessage) (*PublicChatTypeHasUsername, error) { var resp PublicChatTypeHasUsername @@ -5463,6 +6073,14 @@ func UnmarshalChatActionBarReportUnrelatedLocation(data json.RawMessage) (*ChatA return &resp, err } +func UnmarshalChatActionBarInviteMembers(data json.RawMessage) (*ChatActionBarInviteMembers, error) { + var resp ChatActionBarInviteMembers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatActionBarReportAddBlock(data json.RawMessage) (*ChatActionBarReportAddBlock, error) { var resp ChatActionBarReportAddBlock @@ -5487,6 +6105,14 @@ func UnmarshalChatActionBarSharePhoneNumber(data json.RawMessage) (*ChatActionBa return &resp, err } +func UnmarshalChatActionBarJoinRequest(data json.RawMessage) (*ChatActionBarJoinRequest, error) { + var resp ChatActionBarJoinRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButtonTypeText(data json.RawMessage) (*KeyboardButtonTypeText, error) { var resp KeyboardButtonTypeText @@ -5583,6 +6209,14 @@ func UnmarshalInlineKeyboardButtonTypeBuy(data json.RawMessage) (*InlineKeyboard return &resp, err } +func UnmarshalInlineKeyboardButtonTypeUser(data json.RawMessage) (*InlineKeyboardButtonTypeUser, error) { + var resp InlineKeyboardButtonTypeUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInlineKeyboardButton(data json.RawMessage) (*InlineKeyboardButton, error) { var resp InlineKeyboardButton @@ -6215,14 +6849,6 @@ func UnmarshalInputCredentialsNew(data json.RawMessage) (*InputCredentialsNew, e return &resp, err } -func UnmarshalInputCredentialsAndroidPay(data json.RawMessage) (*InputCredentialsAndroidPay, error) { - var resp InputCredentialsAndroidPay - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInputCredentialsApplePay(data json.RawMessage) (*InputCredentialsApplePay, error) { var resp InputCredentialsApplePay @@ -6231,6 +6857,14 @@ func UnmarshalInputCredentialsApplePay(data json.RawMessage) (*InputCredentialsA return &resp, err } +func UnmarshalInputCredentialsGooglePay(data json.RawMessage) (*InputCredentialsGooglePay, error) { + var resp InputCredentialsGooglePay + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPaymentsProviderStripe(data json.RawMessage) (*PaymentsProviderStripe, error) { var resp PaymentsProviderStripe @@ -6239,6 +6873,14 @@ func UnmarshalPaymentsProviderStripe(data json.RawMessage) (*PaymentsProviderStr return &resp, err } +func UnmarshalPaymentFormTheme(data json.RawMessage) (*PaymentFormTheme, error) { + var resp PaymentFormTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPaymentForm(data json.RawMessage) (*PaymentForm, error) { var resp PaymentForm @@ -6967,6 +7609,14 @@ func UnmarshalMessageContact(data json.RawMessage) (*MessageContact, error) { return &resp, err } +func UnmarshalMessageAnimatedEmoji(data json.RawMessage) (*MessageAnimatedEmoji, error) { + var resp MessageAnimatedEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageDice(data json.RawMessage) (*MessageDice, error) { var resp MessageDice @@ -7007,6 +7657,38 @@ func UnmarshalMessageCall(data json.RawMessage) (*MessageCall, error) { return &resp, err } +func UnmarshalMessageVideoChatScheduled(data json.RawMessage) (*MessageVideoChatScheduled, error) { + var resp MessageVideoChatScheduled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageVideoChatStarted(data json.RawMessage) (*MessageVideoChatStarted, error) { + var resp MessageVideoChatStarted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageVideoChatEnded(data json.RawMessage) (*MessageVideoChatEnded, error) { + var resp MessageVideoChatEnded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageInviteVideoChatParticipants(data json.RawMessage) (*MessageInviteVideoChatParticipants, error) { + var resp MessageInviteVideoChatParticipants + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageBasicGroupChatCreate(data json.RawMessage) (*MessageBasicGroupChatCreate, error) { var resp MessageBasicGroupChatCreate @@ -7063,6 +7745,14 @@ func UnmarshalMessageChatJoinByLink(data json.RawMessage) (*MessageChatJoinByLin return &resp, err } +func UnmarshalMessageChatJoinByRequest(data json.RawMessage) (*MessageChatJoinByRequest, error) { + var resp MessageChatJoinByRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageChatDeleteMember(data json.RawMessage) (*MessageChatDeleteMember, error) { var resp MessageChatDeleteMember @@ -7103,6 +7793,14 @@ func UnmarshalMessageScreenshotTaken(data json.RawMessage) (*MessageScreenshotTa return &resp, err } +func UnmarshalMessageChatSetTheme(data json.RawMessage) (*MessageChatSetTheme, error) { + var resp MessageChatSetTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageChatSetTtl(data json.RawMessage) (*MessageChatSetTtl, error) { var resp MessageChatSetTtl @@ -7327,6 +8025,14 @@ func UnmarshalTextEntityTypeMentionName(data json.RawMessage) (*TextEntityTypeMe return &resp, err } +func UnmarshalTextEntityTypeMediaTimestamp(data json.RawMessage) (*TextEntityTypeMediaTimestamp, error) { + var resp TextEntityTypeMediaTimestamp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputThumbnail(data json.RawMessage) (*InputThumbnail, error) { var resp InputThumbnail @@ -7583,22 +8289,6 @@ func UnmarshalSearchMessagesFilterChatPhoto(data json.RawMessage) (*SearchMessag return &resp, err } -func UnmarshalSearchMessagesFilterCall(data json.RawMessage) (*SearchMessagesFilterCall, error) { - var resp SearchMessagesFilterCall - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterMissedCall(data json.RawMessage) (*SearchMessagesFilterMissedCall, error) { - var resp SearchMessagesFilterMissedCall - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalSearchMessagesFilterVideoNote(data json.RawMessage) (*SearchMessagesFilterVideoNote, error) { var resp SearchMessagesFilterVideoNote @@ -7703,6 +8393,14 @@ func UnmarshalChatActionUploadingDocument(data json.RawMessage) (*ChatActionUplo return &resp, err } +func UnmarshalChatActionChoosingSticker(data json.RawMessage) (*ChatActionChoosingSticker, error) { + var resp ChatActionChoosingSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatActionChoosingLocation(data json.RawMessage) (*ChatActionChoosingLocation, error) { var resp ChatActionChoosingLocation @@ -7743,6 +8441,14 @@ func UnmarshalChatActionUploadingVideoNote(data json.RawMessage) (*ChatActionUpl return &resp, err } +func UnmarshalChatActionWatchingAnimations(data json.RawMessage) (*ChatActionWatchingAnimations, error) { + var resp ChatActionWatchingAnimations + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatActionCancel(data json.RawMessage) (*ChatActionCancel, error) { var resp ChatActionCancel @@ -7919,6 +8625,14 @@ func UnmarshalCallId(data json.RawMessage) (*CallId, error) { return &resp, err } +func UnmarshalGroupCallId(data json.RawMessage) (*GroupCallId, error) { + var resp GroupCallId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCallStatePending(data json.RawMessage) (*CallStatePending, error) { var resp CallStatePending @@ -7967,6 +8681,70 @@ func UnmarshalCallStateError(data json.RawMessage) (*CallStateError, error) { return &resp, err } +func UnmarshalGroupCallVideoQualityThumbnail(data json.RawMessage) (*GroupCallVideoQualityThumbnail, error) { + var resp GroupCallVideoQualityThumbnail + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallVideoQualityMedium(data json.RawMessage) (*GroupCallVideoQualityMedium, error) { + var resp GroupCallVideoQualityMedium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallVideoQualityFull(data json.RawMessage) (*GroupCallVideoQualityFull, error) { + var resp GroupCallVideoQualityFull + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallRecentSpeaker(data json.RawMessage) (*GroupCallRecentSpeaker, error) { + var resp GroupCallRecentSpeaker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCall(data json.RawMessage) (*GroupCall, error) { + var resp GroupCall + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallVideoSourceGroup(data json.RawMessage) (*GroupCallVideoSourceGroup, error) { + var resp GroupCallVideoSourceGroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallParticipantVideoInfo(data json.RawMessage) (*GroupCallParticipantVideoInfo, error) { + var resp GroupCallParticipantVideoInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallParticipant(data json.RawMessage) (*GroupCallParticipant, error) { + var resp GroupCallParticipant + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCallProblemEcho(data json.RawMessage) (*CallProblemEcho, error) { var resp CallProblemEcho @@ -8399,6 +9177,22 @@ func UnmarshalChatEventMemberJoined(data json.RawMessage) (*ChatEventMemberJoine return &resp, err } +func UnmarshalChatEventMemberJoinedByInviteLink(data json.RawMessage) (*ChatEventMemberJoinedByInviteLink, error) { + var resp ChatEventMemberJoinedByInviteLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMemberJoinedByRequest(data json.RawMessage) (*ChatEventMemberJoinedByRequest, error) { + var resp ChatEventMemberJoinedByRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { var resp ChatEventMemberLeft @@ -8495,6 +9289,14 @@ func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlo return &resp, err } +func UnmarshalChatEventMessageTtlChanged(data json.RawMessage) (*ChatEventMessageTtlChanged, error) { + var resp ChatEventMessageTtlChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) { var resp ChatEventSignMessagesToggled @@ -8503,6 +9305,14 @@ func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSign return &resp, err } +func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { + var resp ChatEventHasProtectedContentToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { var resp ChatEventStickerSetChanged @@ -8527,6 +9337,70 @@ func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*Chat return &resp, err } +func UnmarshalChatEventInviteLinkEdited(data json.RawMessage) (*ChatEventInviteLinkEdited, error) { + var resp ChatEventInviteLinkEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventInviteLinkRevoked(data json.RawMessage) (*ChatEventInviteLinkRevoked, error) { + var resp ChatEventInviteLinkRevoked + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventInviteLinkDeleted(data json.RawMessage) (*ChatEventInviteLinkDeleted, error) { + var resp ChatEventInviteLinkDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatCreated(data json.RawMessage) (*ChatEventVideoChatCreated, error) { + var resp ChatEventVideoChatCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatEnded(data json.RawMessage) (*ChatEventVideoChatEnded, error) { + var resp ChatEventVideoChatEnded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatParticipantIsMutedToggled(data json.RawMessage) (*ChatEventVideoChatParticipantIsMutedToggled, error) { + var resp ChatEventVideoChatParticipantIsMutedToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data json.RawMessage) (*ChatEventVideoChatParticipantVolumeLevelChanged, error) { + var resp ChatEventVideoChatParticipantVolumeLevelChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { + var resp ChatEventVideoChatMuteNewParticipantsToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEvent(data json.RawMessage) (*ChatEvent, error) { var resp ChatEvent @@ -8719,6 +9593,14 @@ func UnmarshalBackgroundFillGradient(data json.RawMessage) (*BackgroundFillGradi return &resp, err } +func UnmarshalBackgroundFillFreeformGradient(data json.RawMessage) (*BackgroundFillFreeformGradient, error) { + var resp BackgroundFillFreeformGradient + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBackgroundTypeWallpaper(data json.RawMessage) (*BackgroundTypeWallpaper, error) { var resp BackgroundTypeWallpaper @@ -8775,6 +9657,22 @@ func UnmarshalInputBackgroundRemote(data json.RawMessage) (*InputBackgroundRemot return &resp, err } +func UnmarshalThemeSettings(data json.RawMessage) (*ThemeSettings, error) { + var resp ThemeSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatTheme(data json.RawMessage) (*ChatTheme, error) { + var resp ChatTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalHashtags(data json.RawMessage) (*Hashtags, error) { var resp Hashtags @@ -8855,6 +9753,78 @@ func UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data json.RawMessag return &resp, err } +func UnmarshalCheckStickerSetNameResultOk(data json.RawMessage) (*CheckStickerSetNameResultOk, error) { + var resp CheckStickerSetNameResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCheckStickerSetNameResultNameInvalid(data json.RawMessage) (*CheckStickerSetNameResultNameInvalid, error) { + var resp CheckStickerSetNameResultNameInvalid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCheckStickerSetNameResultNameOccupied(data json.RawMessage) (*CheckStickerSetNameResultNameOccupied, error) { + var resp CheckStickerSetNameResultNameOccupied + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalResetPasswordResultOk(data json.RawMessage) (*ResetPasswordResultOk, error) { + var resp ResetPasswordResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalResetPasswordResultPending(data json.RawMessage) (*ResetPasswordResultPending, error) { + var resp ResetPasswordResultPending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalResetPasswordResultDeclined(data json.RawMessage) (*ResetPasswordResultDeclined, error) { + var resp ResetPasswordResultDeclined + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageFileTypePrivate(data json.RawMessage) (*MessageFileTypePrivate, error) { + var resp MessageFileTypePrivate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageFileTypeGroup(data json.RawMessage) (*MessageFileTypeGroup, error) { + var resp MessageFileTypeGroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageFileTypeUnknown(data json.RawMessage) (*MessageFileTypeUnknown, error) { + var resp MessageFileTypeUnknown + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentHidden(data json.RawMessage) (*PushMessageContentHidden, error) { var resp PushMessageContentHidden @@ -9031,6 +10001,14 @@ func UnmarshalPushMessageContentChatChangeTitle(data json.RawMessage) (*PushMess return &resp, err } +func UnmarshalPushMessageContentChatSetTheme(data json.RawMessage) (*PushMessageContentChatSetTheme, error) { + var resp PushMessageContentChatSetTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentChatDeleteMember(data json.RawMessage) (*PushMessageContentChatDeleteMember, error) { var resp PushMessageContentChatDeleteMember @@ -9047,6 +10025,14 @@ func UnmarshalPushMessageContentChatJoinByLink(data json.RawMessage) (*PushMessa return &resp, err } +func UnmarshalPushMessageContentChatJoinByRequest(data json.RawMessage) (*PushMessageContentChatJoinByRequest, error) { + var resp PushMessageContentChatJoinByRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentMessageForwards(data json.RawMessage) (*PushMessageContentMessageForwards, error) { var resp PushMessageContentMessageForwards @@ -9455,6 +10441,14 @@ func UnmarshalChatReportReasonUnrelatedLocation(data json.RawMessage) (*ChatRepo return &resp, err } +func UnmarshalChatReportReasonFake(data json.RawMessage) (*ChatReportReasonFake, error) { + var resp ChatReportReasonFake + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCustom, error) { var resp ChatReportReasonCustom @@ -9463,6 +10457,198 @@ func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCus return &resp, err } +func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLinkTypeActiveSessions, error) { + var resp InternalLinkTypeActiveSessions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeAuthenticationCode(data json.RawMessage) (*InternalLinkTypeAuthenticationCode, error) { + var resp InternalLinkTypeAuthenticationCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeBackground(data json.RawMessage) (*InternalLinkTypeBackground, error) { + var resp InternalLinkTypeBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeBotStart(data json.RawMessage) (*InternalLinkTypeBotStart, error) { + var resp InternalLinkTypeBotStart + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeBotStartInGroup(data json.RawMessage) (*InternalLinkTypeBotStartInGroup, error) { + var resp InternalLinkTypeBotStartInGroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*InternalLinkTypeChangePhoneNumber, error) { + var resp InternalLinkTypeChangePhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTypeChatInvite, error) { + var resp InternalLinkTypeChatInvite + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeFilterSettings(data json.RawMessage) (*InternalLinkTypeFilterSettings, error) { + var resp InternalLinkTypeFilterSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeGame(data json.RawMessage) (*InternalLinkTypeGame, error) { + var resp InternalLinkTypeGame + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkTypeLanguagePack, error) { + var resp InternalLinkTypeLanguagePack + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeMessage(data json.RawMessage) (*InternalLinkTypeMessage, error) { + var resp InternalLinkTypeMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeMessageDraft(data json.RawMessage) (*InternalLinkTypeMessageDraft, error) { + var resp InternalLinkTypeMessageDraft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypePassportDataRequest(data json.RawMessage) (*InternalLinkTypePassportDataRequest, error) { + var resp InternalLinkTypePassportDataRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypePhoneNumberConfirmation(data json.RawMessage) (*InternalLinkTypePhoneNumberConfirmation, error) { + var resp InternalLinkTypePhoneNumberConfirmation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeProxy(data json.RawMessage) (*InternalLinkTypeProxy, error) { + var resp InternalLinkTypeProxy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypePublicChat(data json.RawMessage) (*InternalLinkTypePublicChat, error) { + var resp InternalLinkTypePublicChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeQrCodeAuthentication(data json.RawMessage) (*InternalLinkTypeQrCodeAuthentication, error) { + var resp InternalLinkTypeQrCodeAuthentication + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeSettings, error) { + var resp InternalLinkTypeSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeStickerSet(data json.RawMessage) (*InternalLinkTypeStickerSet, error) { + var resp InternalLinkTypeStickerSet + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeTheme(data json.RawMessage) (*InternalLinkTypeTheme, error) { + var resp InternalLinkTypeTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeThemeSettings(data json.RawMessage) (*InternalLinkTypeThemeSettings, error) { + var resp InternalLinkTypeThemeSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeUnknownDeepLink(data json.RawMessage) (*InternalLinkTypeUnknownDeepLink, error) { + var resp InternalLinkTypeUnknownDeepLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeUnsupportedProxy(data json.RawMessage) (*InternalLinkTypeUnsupportedProxy, error) { + var resp InternalLinkTypeUnsupportedProxy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeVideoChat(data json.RawMessage) (*InternalLinkTypeVideoChat, error) { + var resp InternalLinkTypeVideoChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageLink(data json.RawMessage) (*MessageLink, error) { var resp MessageLink @@ -9887,6 +11073,14 @@ func UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data json.RawMessage) return &resp, err } +func UnmarshalSuggestedActionCheckPassword(data json.RawMessage) (*SuggestedActionCheckPassword, error) { + var resp SuggestedActionCheckPassword + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSuggestedActionCheckPhoneNumber(data json.RawMessage) (*SuggestedActionCheckPhoneNumber, error) { var resp SuggestedActionCheckPhoneNumber @@ -9895,6 +11089,30 @@ func UnmarshalSuggestedActionCheckPhoneNumber(data json.RawMessage) (*SuggestedA return &resp, err } +func UnmarshalSuggestedActionViewChecksHint(data json.RawMessage) (*SuggestedActionViewChecksHint, error) { + var resp SuggestedActionViewChecksHint + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionConvertToBroadcastGroup(data json.RawMessage) (*SuggestedActionConvertToBroadcastGroup, error) { + var resp SuggestedActionConvertToBroadcastGroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionSetPassword(data json.RawMessage) (*SuggestedActionSetPassword, error) { + var resp SuggestedActionSetPassword + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCount(data json.RawMessage) (*Count, error) { var resp Count @@ -10095,6 +11313,86 @@ func UnmarshalMessageStatistics(data json.RawMessage) (*MessageStatistics, error return &resp, err } +func UnmarshalPoint(data json.RawMessage) (*Point, error) { + var resp Point + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalVectorPathCommandLine(data json.RawMessage) (*VectorPathCommandLine, error) { + var resp VectorPathCommandLine + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalVectorPathCommandCubicBezierCurve(data json.RawMessage) (*VectorPathCommandCubicBezierCurve, error) { + var resp VectorPathCommandCubicBezierCurve + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotCommandScopeDefault(data json.RawMessage) (*BotCommandScopeDefault, error) { + var resp BotCommandScopeDefault + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotCommandScopeAllPrivateChats(data json.RawMessage) (*BotCommandScopeAllPrivateChats, error) { + var resp BotCommandScopeAllPrivateChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotCommandScopeAllGroupChats(data json.RawMessage) (*BotCommandScopeAllGroupChats, error) { + var resp BotCommandScopeAllGroupChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotCommandScopeAllChatAdministrators(data json.RawMessage) (*BotCommandScopeAllChatAdministrators, error) { + var resp BotCommandScopeAllChatAdministrators + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotCommandScopeChat(data json.RawMessage) (*BotCommandScopeChat, error) { + var resp BotCommandScopeChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotCommandScopeChatAdministrators(data json.RawMessage) (*BotCommandScopeChatAdministrators, error) { + var resp BotCommandScopeChatAdministrators + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotCommandScopeChatMember(data json.RawMessage) (*BotCommandScopeChatMember, error) { + var resp BotCommandScopeChatMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateAuthorizationState(data json.RawMessage) (*UpdateAuthorizationState, error) { var resp UpdateAuthorizationState @@ -10239,38 +11537,6 @@ func UnmarshalUpdateChatPosition(data json.RawMessage) (*UpdateChatPosition, err return &resp, err } -func UnmarshalUpdateChatIsMarkedAsUnread(data json.RawMessage) (*UpdateChatIsMarkedAsUnread, error) { - var resp UpdateChatIsMarkedAsUnread - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatIsBlocked(data json.RawMessage) (*UpdateChatIsBlocked, error) { - var resp UpdateChatIsBlocked - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatHasScheduledMessages(data json.RawMessage) (*UpdateChatHasScheduledMessages, error) { - var resp UpdateChatHasScheduledMessages - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatDefaultDisableNotification(data json.RawMessage) (*UpdateChatDefaultDisableNotification, error) { - var resp UpdateChatDefaultDisableNotification - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateChatReadInbox(data json.RawMessage) (*UpdateChatReadInbox, error) { var resp UpdateChatReadInbox @@ -10287,8 +11553,32 @@ func UnmarshalUpdateChatReadOutbox(data json.RawMessage) (*UpdateChatReadOutbox, return &resp, err } -func UnmarshalUpdateChatUnreadMentionCount(data json.RawMessage) (*UpdateChatUnreadMentionCount, error) { - var resp UpdateChatUnreadMentionCount +func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, error) { + var resp UpdateChatActionBar + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMessage, error) { + var resp UpdateChatDraftMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatMessageSender(data json.RawMessage) (*UpdateChatMessageSender, error) { + var resp UpdateChatMessageSender + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatMessageTtl(data json.RawMessage) (*UpdateChatMessageTtl, error) { + var resp UpdateChatMessageTtl err := json.Unmarshal(data, &resp) @@ -10303,16 +11593,8 @@ func UnmarshalUpdateChatNotificationSettings(data json.RawMessage) (*UpdateChatN return &resp, err } -func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) { - var resp UpdateScopeNotificationSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, error) { - var resp UpdateChatActionBar +func UnmarshalUpdateChatPendingJoinRequests(data json.RawMessage) (*UpdateChatPendingJoinRequests, error) { + var resp UpdateChatPendingJoinRequests err := json.Unmarshal(data, &resp) @@ -10327,8 +11609,64 @@ func UnmarshalUpdateChatReplyMarkup(data json.RawMessage) (*UpdateChatReplyMarku return &resp, err } -func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMessage, error) { - var resp UpdateChatDraftMessage +func UnmarshalUpdateChatTheme(data json.RawMessage) (*UpdateChatTheme, error) { + var resp UpdateChatTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatUnreadMentionCount(data json.RawMessage) (*UpdateChatUnreadMentionCount, error) { + var resp UpdateChatUnreadMentionCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatVideoChat(data json.RawMessage) (*UpdateChatVideoChat, error) { + var resp UpdateChatVideoChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatDefaultDisableNotification(data json.RawMessage) (*UpdateChatDefaultDisableNotification, error) { + var resp UpdateChatDefaultDisableNotification + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatHasProtectedContent(data json.RawMessage) (*UpdateChatHasProtectedContent, error) { + var resp UpdateChatHasProtectedContent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatHasScheduledMessages(data json.RawMessage) (*UpdateChatHasScheduledMessages, error) { + var resp UpdateChatHasScheduledMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatIsBlocked(data json.RawMessage) (*UpdateChatIsBlocked, error) { + var resp UpdateChatIsBlocked + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatIsMarkedAsUnread(data json.RawMessage) (*UpdateChatIsMarkedAsUnread, error) { + var resp UpdateChatIsMarkedAsUnread err := json.Unmarshal(data, &resp) @@ -10351,6 +11689,14 @@ func UnmarshalUpdateChatOnlineMemberCount(data json.RawMessage) (*UpdateChatOnli return &resp, err } +func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) { + var resp UpdateScopeNotificationSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNotification(data json.RawMessage) (*UpdateNotification, error) { var resp UpdateNotification @@ -10391,8 +11737,8 @@ func UnmarshalUpdateDeleteMessages(data json.RawMessage) (*UpdateDeleteMessages, return &resp, err } -func UnmarshalUpdateUserChatAction(data json.RawMessage) (*UpdateUserChatAction, error) { - var resp UpdateUserChatAction +func UnmarshalUpdateChatAction(data json.RawMessage) (*UpdateChatAction, error) { + var resp UpdateChatAction err := json.Unmarshal(data, &resp) @@ -10503,6 +11849,22 @@ func UnmarshalUpdateCall(data json.RawMessage) (*UpdateCall, error) { return &resp, err } +func UnmarshalUpdateGroupCall(data json.RawMessage) (*UpdateGroupCall, error) { + var resp UpdateGroupCall + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateGroupCallParticipant(data json.RawMessage) (*UpdateGroupCallParticipant, error) { + var resp UpdateGroupCallParticipant + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNewCallSignalingData(data json.RawMessage) (*UpdateNewCallSignalingData, error) { var resp UpdateNewCallSignalingData @@ -10599,6 +11961,14 @@ func UnmarshalUpdateSelectedBackground(data json.RawMessage) (*UpdateSelectedBac return &resp, err } +func UnmarshalUpdateChatThemes(data json.RawMessage) (*UpdateChatThemes, error) { + var resp UpdateChatThemes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateLanguagePackStrings(data json.RawMessage) (*UpdateLanguagePackStrings, error) { var resp UpdateLanguagePackStrings @@ -10639,6 +12009,14 @@ func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) return &resp, err } +func UnmarshalUpdateAnimatedEmojiMessageClicked(data json.RawMessage) (*UpdateAnimatedEmojiMessageClicked, error) { + var resp UpdateAnimatedEmojiMessageClicked + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateAnimationSearchParameters(data json.RawMessage) (*UpdateAnimationSearchParameters, error) { var resp UpdateAnimationSearchParameters @@ -10735,6 +12113,22 @@ func UnmarshalUpdatePollAnswer(data json.RawMessage) (*UpdatePollAnswer, error) return &resp, err } +func UnmarshalUpdateChatMember(data json.RawMessage) (*UpdateChatMember, error) { + var resp UpdateChatMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateNewChatJoinRequest(data json.RawMessage) (*UpdateNewChatJoinRequest, error) { + var resp UpdateNewChatJoinRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdates(data json.RawMessage) (*Updates, error) { var resp Updates @@ -10869,6 +12263,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAuthenticationCodeTypeFlashCall: return UnmarshalAuthenticationCodeTypeFlashCall(data) + case TypeAuthenticationCodeTypeMissedCall: + return UnmarshalAuthenticationCodeTypeMissedCall(data) + case TypeAuthenticationCodeInfo: return UnmarshalAuthenticationCodeInfo(data) @@ -10992,6 +12389,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMaskPosition: return UnmarshalMaskPosition(data) + case TypeClosedVectorPath: + return UnmarshalClosedVectorPath(data) + case TypePollOption: return UnmarshalPollOption(data) @@ -11025,6 +12425,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeVoiceNote: return UnmarshalVoiceNote(data) + case TypeAnimatedEmoji: + return UnmarshalAnimatedEmoji(data) + case TypeContact: return UnmarshalContact(data) @@ -11061,8 +12464,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBotCommand: return UnmarshalBotCommand(data) - case TypeBotInfo: - return UnmarshalBotInfo(data) + case TypeBotCommands: + return UnmarshalBotCommands(data) case TypeChatLocation: return UnmarshalChatLocation(data) @@ -11172,6 +12575,36 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSupergroupMembersFilterBots: return UnmarshalSupergroupMembersFilterBots(data) + case TypeChatInviteLink: + return UnmarshalChatInviteLink(data) + + case TypeChatInviteLinks: + return UnmarshalChatInviteLinks(data) + + case TypeChatInviteLinkCount: + return UnmarshalChatInviteLinkCount(data) + + case TypeChatInviteLinkCounts: + return UnmarshalChatInviteLinkCounts(data) + + case TypeChatInviteLinkMember: + return UnmarshalChatInviteLinkMember(data) + + case TypeChatInviteLinkMembers: + return UnmarshalChatInviteLinkMembers(data) + + case TypeChatInviteLinkInfo: + return UnmarshalChatInviteLinkInfo(data) + + case TypeChatJoinRequest: + return UnmarshalChatJoinRequest(data) + + case TypeChatJoinRequests: + return UnmarshalChatJoinRequests(data) + + case TypeChatJoinRequestsInfo: + return UnmarshalChatJoinRequestsInfo(data) + case TypeBasicGroup: return UnmarshalBasicGroup(data) @@ -11217,6 +12650,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageForwardOriginChannel: return UnmarshalMessageForwardOriginChannel(data) + case TypeMessageForwardOriginMessageImport: + return UnmarshalMessageForwardOriginMessageImport(data) + case TypeMessageForwardInfo: return UnmarshalMessageForwardInfo(data) @@ -11241,6 +12677,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFoundMessages: return UnmarshalFoundMessages(data) + case TypeMessagePosition: + return UnmarshalMessagePosition(data) + + case TypeMessagePositions: + return UnmarshalMessagePositions(data) + + case TypeMessageCalendarDay: + return UnmarshalMessageCalendarDay(data) + + case TypeMessageCalendar: + return UnmarshalMessageCalendar(data) + + case TypeSponsoredMessage: + return UnmarshalSponsoredMessage(data) + case TypeNotificationSettingsScopePrivateChats: return UnmarshalNotificationSettingsScopePrivateChats(data) @@ -11304,6 +12755,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatPosition: return UnmarshalChatPosition(data) + case TypeVideoChat: + return UnmarshalVideoChat(data) + case TypeChat: return UnmarshalChat(data) @@ -11316,12 +12770,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatsNearby: return UnmarshalChatsNearby(data) - case TypeChatInviteLink: - return UnmarshalChatInviteLink(data) - - case TypeChatInviteLinkInfo: - return UnmarshalChatInviteLinkInfo(data) - case TypePublicChatTypeHasUsername: return UnmarshalPublicChatTypeHasUsername(data) @@ -11334,6 +12782,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatActionBarReportUnrelatedLocation: return UnmarshalChatActionBarReportUnrelatedLocation(data) + case TypeChatActionBarInviteMembers: + return UnmarshalChatActionBarInviteMembers(data) + case TypeChatActionBarReportAddBlock: return UnmarshalChatActionBarReportAddBlock(data) @@ -11343,6 +12794,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatActionBarSharePhoneNumber: return UnmarshalChatActionBarSharePhoneNumber(data) + case TypeChatActionBarJoinRequest: + return UnmarshalChatActionBarJoinRequest(data) + case TypeKeyboardButtonTypeText: return UnmarshalKeyboardButtonTypeText(data) @@ -11379,6 +12833,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInlineKeyboardButtonTypeBuy: return UnmarshalInlineKeyboardButtonTypeBuy(data) + case TypeInlineKeyboardButtonTypeUser: + return UnmarshalInlineKeyboardButtonTypeUser(data) + case TypeInlineKeyboardButton: return UnmarshalInlineKeyboardButton(data) @@ -11616,15 +13073,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputCredentialsNew: return UnmarshalInputCredentialsNew(data) - case TypeInputCredentialsAndroidPay: - return UnmarshalInputCredentialsAndroidPay(data) - case TypeInputCredentialsApplePay: return UnmarshalInputCredentialsApplePay(data) + case TypeInputCredentialsGooglePay: + return UnmarshalInputCredentialsGooglePay(data) + case TypePaymentsProviderStripe: return UnmarshalPaymentsProviderStripe(data) + case TypePaymentFormTheme: + return UnmarshalPaymentFormTheme(data) + case TypePaymentForm: return UnmarshalPaymentForm(data) @@ -11898,6 +13358,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageContact: return UnmarshalMessageContact(data) + case TypeMessageAnimatedEmoji: + return UnmarshalMessageAnimatedEmoji(data) + case TypeMessageDice: return UnmarshalMessageDice(data) @@ -11913,6 +13376,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageCall: return UnmarshalMessageCall(data) + case TypeMessageVideoChatScheduled: + return UnmarshalMessageVideoChatScheduled(data) + + case TypeMessageVideoChatStarted: + return UnmarshalMessageVideoChatStarted(data) + + case TypeMessageVideoChatEnded: + return UnmarshalMessageVideoChatEnded(data) + + case TypeMessageInviteVideoChatParticipants: + return UnmarshalMessageInviteVideoChatParticipants(data) + case TypeMessageBasicGroupChatCreate: return UnmarshalMessageBasicGroupChatCreate(data) @@ -11934,6 +13409,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageChatJoinByLink: return UnmarshalMessageChatJoinByLink(data) + case TypeMessageChatJoinByRequest: + return UnmarshalMessageChatJoinByRequest(data) + case TypeMessageChatDeleteMember: return UnmarshalMessageChatDeleteMember(data) @@ -11949,6 +13427,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageScreenshotTaken: return UnmarshalMessageScreenshotTaken(data) + case TypeMessageChatSetTheme: + return UnmarshalMessageChatSetTheme(data) + case TypeMessageChatSetTtl: return UnmarshalMessageChatSetTtl(data) @@ -12033,6 +13514,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypeMentionName: return UnmarshalTextEntityTypeMentionName(data) + case TypeTextEntityTypeMediaTimestamp: + return UnmarshalTextEntityTypeMediaTimestamp(data) + case TypeInputThumbnail: return UnmarshalInputThumbnail(data) @@ -12129,12 +13613,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesFilterChatPhoto: return UnmarshalSearchMessagesFilterChatPhoto(data) - case TypeSearchMessagesFilterCall: - return UnmarshalSearchMessagesFilterCall(data) - - case TypeSearchMessagesFilterMissedCall: - return UnmarshalSearchMessagesFilterMissedCall(data) - case TypeSearchMessagesFilterVideoNote: return UnmarshalSearchMessagesFilterVideoNote(data) @@ -12174,6 +13652,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatActionUploadingDocument: return UnmarshalChatActionUploadingDocument(data) + case TypeChatActionChoosingSticker: + return UnmarshalChatActionChoosingSticker(data) + case TypeChatActionChoosingLocation: return UnmarshalChatActionChoosingLocation(data) @@ -12189,6 +13670,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatActionUploadingVideoNote: return UnmarshalChatActionUploadingVideoNote(data) + case TypeChatActionWatchingAnimations: + return UnmarshalChatActionWatchingAnimations(data) + case TypeChatActionCancel: return UnmarshalChatActionCancel(data) @@ -12255,6 +13739,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCallId: return UnmarshalCallId(data) + case TypeGroupCallId: + return UnmarshalGroupCallId(data) + case TypeCallStatePending: return UnmarshalCallStatePending(data) @@ -12273,6 +13760,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCallStateError: return UnmarshalCallStateError(data) + case TypeGroupCallVideoQualityThumbnail: + return UnmarshalGroupCallVideoQualityThumbnail(data) + + case TypeGroupCallVideoQualityMedium: + return UnmarshalGroupCallVideoQualityMedium(data) + + case TypeGroupCallVideoQualityFull: + return UnmarshalGroupCallVideoQualityFull(data) + + case TypeGroupCallRecentSpeaker: + return UnmarshalGroupCallRecentSpeaker(data) + + case TypeGroupCall: + return UnmarshalGroupCall(data) + + case TypeGroupCallVideoSourceGroup: + return UnmarshalGroupCallVideoSourceGroup(data) + + case TypeGroupCallParticipantVideoInfo: + return UnmarshalGroupCallParticipantVideoInfo(data) + + case TypeGroupCallParticipant: + return UnmarshalGroupCallParticipant(data) + case TypeCallProblemEcho: return UnmarshalCallProblemEcho(data) @@ -12435,6 +13946,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventMemberJoined: return UnmarshalChatEventMemberJoined(data) + case TypeChatEventMemberJoinedByInviteLink: + return UnmarshalChatEventMemberJoinedByInviteLink(data) + + case TypeChatEventMemberJoinedByRequest: + return UnmarshalChatEventMemberJoinedByRequest(data) + case TypeChatEventMemberLeft: return UnmarshalChatEventMemberLeft(data) @@ -12471,9 +13988,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventSlowModeDelayChanged: return UnmarshalChatEventSlowModeDelayChanged(data) + case TypeChatEventMessageTtlChanged: + return UnmarshalChatEventMessageTtlChanged(data) + case TypeChatEventSignMessagesToggled: return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) + case TypeChatEventStickerSetChanged: return UnmarshalChatEventStickerSetChanged(data) @@ -12483,6 +14006,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventIsAllHistoryAvailableToggled: return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventInviteLinkEdited: + return UnmarshalChatEventInviteLinkEdited(data) + + case TypeChatEventInviteLinkRevoked: + return UnmarshalChatEventInviteLinkRevoked(data) + + case TypeChatEventInviteLinkDeleted: + return UnmarshalChatEventInviteLinkDeleted(data) + + case TypeChatEventVideoChatCreated: + return UnmarshalChatEventVideoChatCreated(data) + + case TypeChatEventVideoChatEnded: + return UnmarshalChatEventVideoChatEnded(data) + + case TypeChatEventVideoChatParticipantIsMutedToggled: + return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) + + case TypeChatEventVideoChatParticipantVolumeLevelChanged: + return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) + + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEvent: return UnmarshalChatEvent(data) @@ -12555,6 +14102,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBackgroundFillGradient: return UnmarshalBackgroundFillGradient(data) + case TypeBackgroundFillFreeformGradient: + return UnmarshalBackgroundFillFreeformGradient(data) + case TypeBackgroundTypeWallpaper: return UnmarshalBackgroundTypeWallpaper(data) @@ -12576,6 +14126,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputBackgroundRemote: return UnmarshalInputBackgroundRemote(data) + case TypeThemeSettings: + return UnmarshalThemeSettings(data) + + case TypeChatTheme: + return UnmarshalChatTheme(data) + case TypeHashtags: return UnmarshalHashtags(data) @@ -12606,6 +14162,33 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCheckChatUsernameResultPublicGroupsUnavailable: return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data) + case TypeCheckStickerSetNameResultOk: + return UnmarshalCheckStickerSetNameResultOk(data) + + case TypeCheckStickerSetNameResultNameInvalid: + return UnmarshalCheckStickerSetNameResultNameInvalid(data) + + case TypeCheckStickerSetNameResultNameOccupied: + return UnmarshalCheckStickerSetNameResultNameOccupied(data) + + case TypeResetPasswordResultOk: + return UnmarshalResetPasswordResultOk(data) + + case TypeResetPasswordResultPending: + return UnmarshalResetPasswordResultPending(data) + + case TypeResetPasswordResultDeclined: + return UnmarshalResetPasswordResultDeclined(data) + + case TypeMessageFileTypePrivate: + return UnmarshalMessageFileTypePrivate(data) + + case TypeMessageFileTypeGroup: + return UnmarshalMessageFileTypeGroup(data) + + case TypeMessageFileTypeUnknown: + return UnmarshalMessageFileTypeUnknown(data) + case TypePushMessageContentHidden: return UnmarshalPushMessageContentHidden(data) @@ -12672,12 +14255,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentChatChangeTitle: return UnmarshalPushMessageContentChatChangeTitle(data) + case TypePushMessageContentChatSetTheme: + return UnmarshalPushMessageContentChatSetTheme(data) + case TypePushMessageContentChatDeleteMember: return UnmarshalPushMessageContentChatDeleteMember(data) case TypePushMessageContentChatJoinByLink: return UnmarshalPushMessageContentChatJoinByLink(data) + case TypePushMessageContentChatJoinByRequest: + return UnmarshalPushMessageContentChatJoinByRequest(data) + case TypePushMessageContentMessageForwards: return UnmarshalPushMessageContentMessageForwards(data) @@ -12831,9 +14420,84 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatReportReasonUnrelatedLocation: return UnmarshalChatReportReasonUnrelatedLocation(data) + case TypeChatReportReasonFake: + return UnmarshalChatReportReasonFake(data) + case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) + case TypeInternalLinkTypeActiveSessions: + return UnmarshalInternalLinkTypeActiveSessions(data) + + case TypeInternalLinkTypeAuthenticationCode: + return UnmarshalInternalLinkTypeAuthenticationCode(data) + + case TypeInternalLinkTypeBackground: + return UnmarshalInternalLinkTypeBackground(data) + + case TypeInternalLinkTypeBotStart: + return UnmarshalInternalLinkTypeBotStart(data) + + case TypeInternalLinkTypeBotStartInGroup: + return UnmarshalInternalLinkTypeBotStartInGroup(data) + + case TypeInternalLinkTypeChangePhoneNumber: + return UnmarshalInternalLinkTypeChangePhoneNumber(data) + + case TypeInternalLinkTypeChatInvite: + return UnmarshalInternalLinkTypeChatInvite(data) + + case TypeInternalLinkTypeFilterSettings: + return UnmarshalInternalLinkTypeFilterSettings(data) + + case TypeInternalLinkTypeGame: + return UnmarshalInternalLinkTypeGame(data) + + case TypeInternalLinkTypeLanguagePack: + return UnmarshalInternalLinkTypeLanguagePack(data) + + case TypeInternalLinkTypeMessage: + return UnmarshalInternalLinkTypeMessage(data) + + case TypeInternalLinkTypeMessageDraft: + return UnmarshalInternalLinkTypeMessageDraft(data) + + case TypeInternalLinkTypePassportDataRequest: + return UnmarshalInternalLinkTypePassportDataRequest(data) + + case TypeInternalLinkTypePhoneNumberConfirmation: + return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + + case TypeInternalLinkTypeProxy: + return UnmarshalInternalLinkTypeProxy(data) + + case TypeInternalLinkTypePublicChat: + return UnmarshalInternalLinkTypePublicChat(data) + + case TypeInternalLinkTypeQrCodeAuthentication: + return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + + case TypeInternalLinkTypeSettings: + return UnmarshalInternalLinkTypeSettings(data) + + case TypeInternalLinkTypeStickerSet: + return UnmarshalInternalLinkTypeStickerSet(data) + + case TypeInternalLinkTypeTheme: + return UnmarshalInternalLinkTypeTheme(data) + + case TypeInternalLinkTypeThemeSettings: + return UnmarshalInternalLinkTypeThemeSettings(data) + + case TypeInternalLinkTypeUnknownDeepLink: + return UnmarshalInternalLinkTypeUnknownDeepLink(data) + + case TypeInternalLinkTypeUnsupportedProxy: + return UnmarshalInternalLinkTypeUnsupportedProxy(data) + + case TypeInternalLinkTypeVideoChat: + return UnmarshalInternalLinkTypeVideoChat(data) + case TypeMessageLink: return UnmarshalMessageLink(data) @@ -12993,9 +14657,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedActionEnableArchiveAndMuteNewChats: return UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data) + case TypeSuggestedActionCheckPassword: + return UnmarshalSuggestedActionCheckPassword(data) + case TypeSuggestedActionCheckPhoneNumber: return UnmarshalSuggestedActionCheckPhoneNumber(data) + case TypeSuggestedActionViewChecksHint: + return UnmarshalSuggestedActionViewChecksHint(data) + + case TypeSuggestedActionConvertToBroadcastGroup: + return UnmarshalSuggestedActionConvertToBroadcastGroup(data) + + case TypeSuggestedActionSetPassword: + return UnmarshalSuggestedActionSetPassword(data) + case TypeCount: return UnmarshalCount(data) @@ -13071,6 +14747,36 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageStatistics: return UnmarshalMessageStatistics(data) + case TypePoint: + return UnmarshalPoint(data) + + case TypeVectorPathCommandLine: + return UnmarshalVectorPathCommandLine(data) + + case TypeVectorPathCommandCubicBezierCurve: + return UnmarshalVectorPathCommandCubicBezierCurve(data) + + case TypeBotCommandScopeDefault: + return UnmarshalBotCommandScopeDefault(data) + + case TypeBotCommandScopeAllPrivateChats: + return UnmarshalBotCommandScopeAllPrivateChats(data) + + case TypeBotCommandScopeAllGroupChats: + return UnmarshalBotCommandScopeAllGroupChats(data) + + case TypeBotCommandScopeAllChatAdministrators: + return UnmarshalBotCommandScopeAllChatAdministrators(data) + + case TypeBotCommandScopeChat: + return UnmarshalBotCommandScopeChat(data) + + case TypeBotCommandScopeChatAdministrators: + return UnmarshalBotCommandScopeChatAdministrators(data) + + case TypeBotCommandScopeChatMember: + return UnmarshalBotCommandScopeChatMember(data) + case TypeUpdateAuthorizationState: return UnmarshalUpdateAuthorizationState(data) @@ -13125,41 +14831,56 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatPosition: return UnmarshalUpdateChatPosition(data) - case TypeUpdateChatIsMarkedAsUnread: - return UnmarshalUpdateChatIsMarkedAsUnread(data) - - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(data) - - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(data) - - case TypeUpdateChatDefaultDisableNotification: - return UnmarshalUpdateChatDefaultDisableNotification(data) - case TypeUpdateChatReadInbox: return UnmarshalUpdateChatReadInbox(data) case TypeUpdateChatReadOutbox: return UnmarshalUpdateChatReadOutbox(data) - case TypeUpdateChatUnreadMentionCount: - return UnmarshalUpdateChatUnreadMentionCount(data) + case TypeUpdateChatActionBar: + return UnmarshalUpdateChatActionBar(data) + + case TypeUpdateChatDraftMessage: + return UnmarshalUpdateChatDraftMessage(data) + + case TypeUpdateChatMessageSender: + return UnmarshalUpdateChatMessageSender(data) + + case TypeUpdateChatMessageTtl: + return UnmarshalUpdateChatMessageTtl(data) case TypeUpdateChatNotificationSettings: return UnmarshalUpdateChatNotificationSettings(data) - case TypeUpdateScopeNotificationSettings: - return UnmarshalUpdateScopeNotificationSettings(data) - - case TypeUpdateChatActionBar: - return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatPendingJoinRequests: + return UnmarshalUpdateChatPendingJoinRequests(data) case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(data) - case TypeUpdateChatDraftMessage: - return UnmarshalUpdateChatDraftMessage(data) + case TypeUpdateChatTheme: + return UnmarshalUpdateChatTheme(data) + + case TypeUpdateChatUnreadMentionCount: + return UnmarshalUpdateChatUnreadMentionCount(data) + + case TypeUpdateChatVideoChat: + return UnmarshalUpdateChatVideoChat(data) + + case TypeUpdateChatDefaultDisableNotification: + return UnmarshalUpdateChatDefaultDisableNotification(data) + + case TypeUpdateChatHasProtectedContent: + return UnmarshalUpdateChatHasProtectedContent(data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(data) + + case TypeUpdateChatIsBlocked: + return UnmarshalUpdateChatIsBlocked(data) + + case TypeUpdateChatIsMarkedAsUnread: + return UnmarshalUpdateChatIsMarkedAsUnread(data) case TypeUpdateChatFilters: return UnmarshalUpdateChatFilters(data) @@ -13167,6 +14888,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) + case TypeUpdateScopeNotificationSettings: + return UnmarshalUpdateScopeNotificationSettings(data) + case TypeUpdateNotification: return UnmarshalUpdateNotification(data) @@ -13182,8 +14906,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateDeleteMessages: return UnmarshalUpdateDeleteMessages(data) - case TypeUpdateUserChatAction: - return UnmarshalUpdateUserChatAction(data) + case TypeUpdateChatAction: + return UnmarshalUpdateChatAction(data) case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(data) @@ -13224,6 +14948,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateCall: return UnmarshalUpdateCall(data) + case TypeUpdateGroupCall: + return UnmarshalUpdateGroupCall(data) + + case TypeUpdateGroupCallParticipant: + return UnmarshalUpdateGroupCallParticipant(data) + case TypeUpdateNewCallSignalingData: return UnmarshalUpdateNewCallSignalingData(data) @@ -13260,6 +14990,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(data) + case TypeUpdateChatThemes: + return UnmarshalUpdateChatThemes(data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(data) @@ -13275,6 +15008,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) + case TypeUpdateAnimatedEmojiMessageClicked: + return UnmarshalUpdateAnimatedEmojiMessageClicked(data) + case TypeUpdateAnimationSearchParameters: return UnmarshalUpdateAnimationSearchParameters(data) @@ -13311,6 +15047,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdatePollAnswer: return UnmarshalUpdatePollAnswer(data) + case TypeUpdateChatMember: + return UnmarshalUpdateChatMember(data) + + case TypeUpdateNewChatJoinRequest: + return UnmarshalUpdateNewChatJoinRequest(data) + case TypeUpdates: return UnmarshalUpdates(data) diff --git a/data/td_api.json b/data/td_api.json index b12d47e..fd374de 100755 --- a/data/td_api.json +++ b/data/td_api.json @@ -197,7 +197,7 @@ }, { "name": "authenticationCodeTypeFlashCall", - "description": "An authentication code is delivered by an immediately cancelled call to the specified phone number. The number from which the call was made is the code", + "description": "An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically", "class": "AuthenticationCodeType", "properties": [ { @@ -207,6 +207,23 @@ } ] }, + { + "name": "authenticationCodeTypeMissedCall", + "description": "An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user", + "class": "AuthenticationCodeType", + "properties": [ + { + "name": "phone_number_prefix", + "type": "string", + "description": "Prefix of the phone number from which the call will be made" + }, + { + "name": "length", + "type": "int32", + "description": "Number of digits in the code, excluding the prefix" + } + ] + }, { "name": "authenticationCodeInfo", "description": "Information about the authentication code that was sent", @@ -220,17 +237,17 @@ { "name": "type", "type": "AuthenticationCodeType", - "description": "Describes the way the code was sent to the user" + "description": "The way the code was sent to the user" }, { "name": "next_type", "type": "AuthenticationCodeType", - "description": "Describes the way the next code will be sent to the user; may be null" + "description": "The way the next code will be sent to the user; may be null" }, { "name": "timeout", "type": "int32", - "description": "Timeout before the code should be re-sent, in seconds" + "description": "Timeout before the code can be re-sent, in seconds" } ] }, @@ -426,7 +443,7 @@ }, { "name": "authorizationStateClosed", - "description": "TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to with error code 500. To continue working, one should create a new instance of the TDLib client", + "description": "TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to with error code 500. To continue working, one must create a new instance of the TDLib client", "class": "AuthorizationState", "properties": [] }, @@ -459,6 +476,11 @@ "name": "recovery_email_address_code_info", "type": "emailAddressAuthenticationCodeInfo", "description": "Information about the recovery email address to which the confirmation email was sent; may be null" + }, + { + "name": "pending_reset_date", + "type": "int32", + "description": "If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword" } ] }, @@ -504,7 +526,7 @@ { "name": "can_be_downloaded", "type": "Bool", - "description": "True, if it is possible to try to download or generate the file" + "description": "True, if it is possible to download or generate the file" }, { "name": "can_be_deleted", @@ -529,12 +551,12 @@ { "name": "downloaded_prefix_size", "type": "int32", - "description": "If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix" + "description": "If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes" }, { "name": "downloaded_size", "type": "int32", - "description": "Total downloaded file bytes. Should be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage" + "description": "Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage" } ] }, @@ -546,7 +568,7 @@ { "name": "id", "type": "string", - "description": "Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and \"#url#\" as the conversion string. Application 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 must generate the file by downloading it to the specified location" }, { "name": "unique_id", @@ -566,7 +588,7 @@ { "name": "uploaded_size", "type": "int32", - "description": "Size of the remote available part of the file; 0 if unknown" + "description": "Size of the remote available part of the file, in bytes; 0 if unknown" } ] }, @@ -583,12 +605,12 @@ { "name": "size", "type": "int32", - "description": "File size; 0 if unknown" + "description": "File size, in bytes; 0 if unknown" }, { "name": "expected_size", "type": "int32", - "description": "Expected file size in case the exact file size is unknown, but an approximate size is known. Can be used to show download/upload progress" + "description": "Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress" }, { "name": "local", @@ -651,12 +673,12 @@ { "name": "conversion", "type": "string", - "description": "String specifying the conversion applied to the original file; should be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage" + "description": "String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage" }, { "name": "expected_size", "type": "int32", - "description": "Expected size of the generated file; 0 if unknown" + "description": "Expected size of the generated file, in bytes; 0 if unknown" } ] }, @@ -688,7 +710,7 @@ { "name": "progressive_sizes", "type": "vector\u003cint32\u003e", - "description": "Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image" + "description": "Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes" } ] }, @@ -779,37 +801,37 @@ }, { "name": "maskPointForehead", - "description": "A mask should be placed relatively to the forehead", + "description": "The mask is placed relatively to the forehead", "class": "MaskPoint", "properties": [] }, { "name": "maskPointEyes", - "description": "A mask should be placed relatively to the eyes", + "description": "The mask is placed relatively to the eyes", "class": "MaskPoint", "properties": [] }, { "name": "maskPointMouth", - "description": "A mask should be placed relatively to the mouth", + "description": "The mask is placed relatively to the mouth", "class": "MaskPoint", "properties": [] }, { "name": "maskPointChin", - "description": "A mask should be placed relatively to the chin", + "description": "The mask is placed relatively to the chin", "class": "MaskPoint", "properties": [] }, { "name": "maskPosition", - "description": "Position on a photo where a mask should be placed", + "description": "Position on a photo where a mask is placed", "class": "MaskPosition", "properties": [ { "name": "point", "type": "MaskPoint", - "description": "Part of the face, relative to which the mask should be placed" + "description": "Part of the face, relative to which the mask is placed" }, { "name": "x_shift", @@ -828,6 +850,18 @@ } ] }, + { + "name": "closedVectorPath", + "description": "Represents a closed vector path. The path begins at the end point of the last command", + "class": "ClosedVectorPath", + "properties": [ + { + "name": "commands", + "type": "vector\u003cVectorPathCommand\u003e", + "description": "List of vector path commands" + } + ] + }, { "name": "pollOption", "description": "Describes one answer option of a poll", @@ -836,7 +870,7 @@ { "name": "text", "type": "string", - "description": "Option text, 1-100 characters" + "description": "Option text; 1-100 characters" }, { "name": "voter_count", @@ -846,7 +880,7 @@ { "name": "vote_percentage", "type": "int32", - "description": "The percentage of votes for this option, 0-100" + "description": "The percentage of votes for this option; 0-100" }, { "name": "is_chosen", @@ -885,7 +919,7 @@ { "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" + "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" } ] }, @@ -979,7 +1013,7 @@ { "name": "album_cover_thumbnail", "type": "thumbnail", - "description": "The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null" + "description": "The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null" }, { "name": "audio", @@ -1080,7 +1114,12 @@ { "name": "mask_position", "type": "maskPosition", - "description": "Position where the mask should be placed; may be null" + "description": "Position where the mask is placed; may be null" + }, + { + "name": "outline", + "type": "vector\u003cclosedVectorPath\u003e", + "description": "Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner" }, { "name": "thumbnail", @@ -1132,7 +1171,7 @@ { "name": "supports_streaming", "type": "Bool", - "description": "True, if the video should be tried to be streamed" + "description": "True, if the video is supposed to be streamed" }, { "name": "minithumbnail", @@ -1210,6 +1249,28 @@ } ] }, + { + "name": "animatedEmoji", + "description": "Describes an animated representation of an emoji", + "class": "AnimatedEmoji", + "properties": [ + { + "name": "sticker", + "type": "sticker", + "description": "Animated sticker for the emoji" + }, + { + "name": "fitzpatrick_type", + "type": "int32", + "description": "Emoji modifier fitzpatrick type; 0-6; 0 if none" + }, + { + "name": "sound", + "type": "file", + "description": "File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container" + } + ] + }, { "name": "contact", "description": "Describes a user contact", @@ -1237,7 +1298,7 @@ }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user, if known; otherwise 0" } ] @@ -1287,7 +1348,7 @@ { "name": "provider", "type": "string", - "description": "Provider of the venue database; as defined by the sender. Currently only \"foursquare\" and \"gplaces\" (Google Places) need to be supported" + "description": "Provider of the venue database; as defined by the sender. Currently, only \"foursquare\" and \"gplaces\" (Google Places) need to be supported" }, { "name": "id", @@ -1356,7 +1417,7 @@ { "name": "question", "type": "string", - "description": "Poll question, 1-300 characters" + "description": "Poll question; 1-300 characters" }, { "name": "options", @@ -1370,7 +1431,7 @@ }, { "name": "recent_voter_user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "User identifiers of recent voters, if the poll is non-anonymous" }, { @@ -1391,7 +1452,7 @@ { "name": "close_date", "type": "int32", - "description": "Point in time (Unix timestamp) when the poll will be automatically closed" + "description": "Point in time (Unix timestamp) when the poll will automatically be closed" }, { "name": "is_closed", @@ -1420,6 +1481,11 @@ "type": "file", "description": "A big (640x640) user profile photo. The file can be downloaded only before the photo is changed" }, + { + "name": "minithumbnail", + "type": "minithumbnail", + "description": "User profile photo minithumbnail; may be null" + }, { "name": "has_animation", "type": "Bool", @@ -1442,6 +1508,11 @@ "type": "file", "description": "A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed" }, + { + "name": "minithumbnail", + "type": "minithumbnail", + "description": "Chat photo minithumbnail; may be null" + }, { "name": "has_animation", "type": "Bool", @@ -1489,7 +1560,7 @@ { "name": "need_location", "type": "Bool", - "description": "True, if the location of the user should be sent with every inline query to this bot" + "description": "True, if the location of the user is expected to be sent with every inline query to this bot" } ] }, @@ -1517,19 +1588,19 @@ ] }, { - "name": "botInfo", - "description": "Provides information about a bot and its supported commands", - "class": "BotInfo", + "name": "botCommands", + "description": "Contains a list of bot commands", + "class": "BotCommands", "properties": [ { - "name": "description", - "type": "string", - "description": "Long description shown on the user info page" + "name": "bot_user_id", + "type": "int53", + "description": "Bot's user identifier" }, { "name": "commands", "type": "vector\u003cbotCommand\u003e", - "description": "A list of commands supported by the bot" + "description": "List of bot commands" } ] }, @@ -1629,7 +1700,7 @@ { "name": "chat_photo_id", "type": "int64", - "description": "Identifier of the profile photo to reuse" + "description": "Identifier of the current user's profile photo to reuse" } ] }, @@ -1669,7 +1740,7 @@ "properties": [ { "name": "id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -1732,6 +1803,11 @@ "type": "Bool", "description": "True, if many users reported this user as a scam" }, + { + "name": "is_fake", + "type": "Bool", + "description": "True, if many users reported this user as a fake account" + }, { "name": "have_access", "type": "Bool", @@ -1779,6 +1855,11 @@ "type": "Bool", "description": "True, if the user can't be called due to their privacy settings" }, + { + "name": "has_private_forwards", + "type": "Bool", + "description": "True, if the user can't be linked in forwarded messages due to their privacy settings" + }, { "name": "need_phone_number_privacy_exception", "type": "Bool", @@ -1792,7 +1873,12 @@ { "name": "share_text", "type": "string", - "description": "For bots, the text that is included with the link when users share the bot" + "description": "For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot" + }, + { + "name": "description", + "type": "string", + "description": "For bots, the text shown in the chat with the bot if the chat is empty" }, { "name": "group_in_common_count", @@ -1800,9 +1886,9 @@ "description": "Number of group chats where both the other user and the current user are a member; 0 for the current user" }, { - "name": "bot_info", - "type": "botInfo", - "description": "If the user is a bot, information about the bot; may be null" + "name": "commands", + "type": "vector\u003cbotCommand\u003e", + "description": "For bots, list of the bot commands" } ] }, @@ -1818,7 +1904,7 @@ }, { "name": "user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "A list of user identifiers" } ] @@ -1830,7 +1916,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier of the administrator" }, { @@ -1906,7 +1992,7 @@ }, { "name": "chatMemberStatusCreator", - "description": "The user is the owner of a chat and has all the administrator privileges", + "description": "The user is the owner of the chat and has all the administrator privileges", "class": "ChatMemberStatus", "properties": [ { @@ -1928,7 +2014,7 @@ }, { "name": "chatMemberStatusAdministrator", - "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", + "description": "The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges", "class": "ChatMemberStatus", "properties": [ { @@ -1941,6 +2027,11 @@ "type": "Bool", "description": "True, if the current user can edit the administrator privileges for the called user" }, + { + "name": "can_manage_chat", + "type": "Bool", + "description": "True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only" + }, { "name": "can_change_info", "type": "Bool", @@ -1969,18 +2060,23 @@ { "name": "can_restrict_members", "type": "Bool", - "description": "True, if the administrator can restrict, ban, or unban chat members" + "description": "True, if the administrator can restrict, ban, or unban chat members; always true for channels" }, { "name": "can_pin_messages", "type": "Bool", - "description": "True, if the administrator can pin messages; applicable to groups only" + "description": "True, if the administrator can pin messages; applicable to basic groups and supergroups only" }, { "name": "can_promote_members", "type": "Bool", "description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them" }, + { + "name": "can_manage_video_chats", + "type": "Bool", + "description": "True, if the administrator can manage video chats" + }, { "name": "is_anonymous", "type": "Bool", @@ -1990,7 +2086,7 @@ }, { "name": "chatMemberStatusMember", - "description": "The user is a member of a chat, without any additional privileges or restrictions", + "description": "The user is a member of the chat, without any additional privileges or restrictions", "class": "ChatMemberStatus", "properties": [] }, @@ -2018,35 +2114,35 @@ }, { "name": "chatMemberStatusLeft", - "description": "The user is not a chat member", + "description": "The user or the chat is not a chat member", "class": "ChatMemberStatus", "properties": [] }, { "name": "chatMemberStatusBanned", - "description": "The user was banned (and hence is not a member of the chat). Implies the user can't return to the chat or view messages", + "description": "The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat", "class": "ChatMemberStatus", "properties": [ { "name": "banned_until_date", "type": "int32", - "description": "Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever" + "description": "Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups" } ] }, { "name": "chatMember", - "description": "A user with information about joining/leaving a chat", + "description": "Describes a user or a chat as a member of another chat", "class": "ChatMember", "properties": [ { - "name": "user_id", - "type": "int32", - "description": "User identifier of the chat member" + "name": "member_id", + "type": "MessageSender", + "description": "Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels" }, { "name": "inviter_user_id", - "type": "int32", + "type": "int53", "description": "Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown" }, { @@ -2058,11 +2154,6 @@ "name": "status", "type": "ChatMemberStatus", "description": "Status of the member in the chat" - }, - { - "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 the chat member" } ] }, @@ -2214,6 +2305,276 @@ "class": "SupergroupMembersFilter", "properties": [] }, + { + "name": "chatInviteLink", + "description": "Contains a chat invite link", + "class": "ChatInviteLink", + "properties": [ + { + "name": "invite_link", + "type": "string", + "description": "Chat invite link" + }, + { + "name": "name", + "type": "string", + "description": "Name of the link" + }, + { + "name": "creator_user_id", + "type": "int53", + "description": "User identifier of an administrator created the link" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the link was created" + }, + { + "name": "edit_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown" + }, + { + "name": "expiration_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the link will expire; 0 if never" + }, + { + "name": "member_limit", + "type": "int32", + "description": "The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval" + }, + { + "name": "member_count", + "type": "int32", + "description": "Number of chat members, which joined the chat using the link" + }, + { + "name": "pending_join_request_count", + "type": "int32", + "description": "Number of pending join requests created using this link" + }, + { + "name": "creates_join_request", + "type": "Bool", + "description": "True, if the link only creates join request. If true, total number of joining members will be unlimited" + }, + { + "name": "is_primary", + "type": "Bool", + "description": "True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time" + }, + { + "name": "is_revoked", + "type": "Bool", + "description": "True, if the link was revoked" + } + ] + }, + { + "name": "chatInviteLinks", + "description": "Contains a list of chat invite links", + "class": "ChatInviteLinks", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total count of chat invite links found" + }, + { + "name": "invite_links", + "type": "vector\u003cchatInviteLink\u003e", + "description": "List of invite links" + } + ] + }, + { + "name": "chatInviteLinkCount", + "description": "Describes a chat administrator with a number of active and revoked chat invite links", + "class": "ChatInviteLinkCount", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Administrator's user identifier" + }, + { + "name": "invite_link_count", + "type": "int32", + "description": "Number of active invite links" + }, + { + "name": "revoked_invite_link_count", + "type": "int32", + "description": "Number of revoked invite links" + } + ] + }, + { + "name": "chatInviteLinkCounts", + "description": "Contains a list of chat invite link counts", + "class": "ChatInviteLinkCounts", + "properties": [ + { + "name": "invite_link_counts", + "type": "vector\u003cchatInviteLinkCount\u003e", + "description": "List of invite link counts" + } + ] + }, + { + "name": "chatInviteLinkMember", + "description": "Describes a chat member joined a chat via an invite link", + "class": "ChatInviteLinkMember", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "joined_chat_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the user joined the chat" + }, + { + "name": "approver_user_id", + "type": "int53", + "description": "User identifier of the chat administrator, approved user join request" + } + ] + }, + { + "name": "chatInviteLinkMembers", + "description": "Contains a list of chat members joined a chat via an invite link", + "class": "ChatInviteLinkMembers", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total count of chat members found" + }, + { + "name": "members", + "type": "vector\u003cchatInviteLinkMember\u003e", + "description": "List of chat members, joined a chat via an invite link" + } + ] + }, + { + "name": "chatInviteLinkInfo", + "description": "Contains information about a chat invite link", + "class": "ChatInviteLinkInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "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", + "type": "ChatType", + "description": "Type of the chat" + }, + { + "name": "title", + "type": "string", + "description": "Title of the chat" + }, + { + "name": "photo", + "type": "chatPhotoInfo", + "description": "Chat photo; may be null" + }, + { + "name": "description", + "type": "string", + "description": "Chat description" + }, + { + "name": "member_count", + "type": "int32", + "description": "Number of members in the chat" + }, + { + "name": "member_user_ids", + "type": "vector\u003cint53\u003e", + "description": "User identifiers of some chat members that may be known to the current user" + }, + { + "name": "creates_join_request", + "type": "Bool", + "description": "True, if the link only creates join request" + }, + { + "name": "is_public", + "type": "Bool", + "description": "True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup" + } + ] + }, + { + "name": "chatJoinRequest", + "description": "Describes a user that sent a join request and waits for administrator approval", + "class": "ChatJoinRequest", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the user sent the join request" + }, + { + "name": "bio", + "type": "string", + "description": "A short bio of the user" + } + ] + }, + { + "name": "chatJoinRequests", + "description": "Contains a list of requests to join a chat", + "class": "ChatJoinRequests", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total count of requests found" + }, + { + "name": "requests", + "type": "vector\u003cchatJoinRequest\u003e", + "description": "List of the requests" + } + ] + }, + { + "name": "chatJoinRequestsInfo", + "description": "Contains information about pending join requests for a chat", + "class": "ChatJoinRequestsInfo", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Total number of pending join requests" + }, + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of at most 3 users sent the newest pending join requests" + } + ] + }, { "name": "basicGroup", "description": "Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)", @@ -2221,7 +2582,7 @@ "properties": [ { "name": "id", - "type": "int32", + "type": "int53", "description": "Group identifier" }, { @@ -2241,7 +2602,7 @@ }, { "name": "upgraded_to_supergroup_id", - "type": "int32", + "type": "int53", "description": "Identifier of the supergroup to which this group was upgraded; 0 if none" } ] @@ -2259,11 +2620,11 @@ { "name": "description", "type": "string", - "description": "Group description" + "description": "Group description. Updated only after the basic group is opened" }, { "name": "creator_user_id", - "type": "int32", + "type": "int53", "description": "User identifier of the creator of the group; 0 if unknown" }, { @@ -2273,8 +2634,13 @@ }, { "name": "invite_link", - "type": "string", - "description": "Invite link for this group; available only after it has been generated at least once and only for the group creator" + "type": "chatInviteLink", + "description": "Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened" + }, + { + "name": "bot_commands", + "type": "vector\u003cbotCommands\u003e", + "description": "List of commands of bots in the group" } ] }, @@ -2285,7 +2651,7 @@ "properties": [ { "name": "id", - "type": "int32", + "type": "int53", "description": "Supergroup or channel identifier" }, { @@ -2306,7 +2672,7 @@ { "name": "member_count", "type": "int32", - "description": "Number of members in the supergroup or channel; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules" + "description": "Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules" }, { "name": "has_linked_chat", @@ -2321,7 +2687,7 @@ { "name": "sign_messages", "type": "Bool", - "description": "True, if messages sent to the channel should contain information about the sender. This field is only applicable to channels" + "description": "True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels" }, { "name": "is_slow_mode_enabled", @@ -2333,6 +2699,11 @@ "type": "Bool", "description": "True, if the supergroup is a channel" }, + { + "name": "is_broadcast_group", + "type": "Bool", + "description": "True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members" + }, { "name": "is_verified", "type": "Bool", @@ -2346,7 +2717,12 @@ { "name": "is_scam", "type": "Bool", - "description": "True, if many users reported this supergroup as a scam" + "description": "True, if many users reported this supergroup or channel as a scam" + }, + { + "name": "is_fake", + "type": "Bool", + "description": "True, if many users reported this supergroup or channel as a fake account" } ] }, @@ -2442,12 +2818,17 @@ }, { "name": "invite_link", - "type": "string", - "description": "Invite link for this chat" + "type": "chatInviteLink", + "description": "Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only" + }, + { + "name": "bot_commands", + "type": "vector\u003cbotCommands\u003e", + "description": "List of commands of bots in the group" }, { "name": "upgraded_from_basic_group_id", - "type": "int32", + "type": "int53", "description": "Identifier of the basic group from which supergroup was upgraded; 0 if none" }, { @@ -2487,7 +2868,7 @@ }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the chat partner" }, { @@ -2500,11 +2881,6 @@ "type": "Bool", "description": "True, if the chat was created by the current user; otherwise false" }, - { - "name": "ttl", - "type": "int32", - "description": "Current message Time To Live setting (self-destruct timer) for the chat, in seconds" - }, { "name": "key_hash", "type": "bytes", @@ -2513,7 +2889,7 @@ { "name": "layer", "type": "int32", - "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" + "description": "Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer \u003e= 101" } ] }, @@ -2524,7 +2900,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user that sent the message" } ] @@ -2565,14 +2941,14 @@ "properties": [ { "name": "sender_user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user that originally sent the message" } ] }, { "name": "messageForwardOriginChat", - "description": "The message was originally sent by an anonymous chat administrator on behalf of the chat", + "description": "The message was originally sent on behalf of a chat", "class": "MessageForwardOrigin", "properties": [ { @@ -2583,7 +2959,7 @@ { "name": "author_signature", "type": "string", - "description": "Original message author signature" + "description": "For messages originally sent by an anonymous chat administrator, original message author signature" } ] }, @@ -2621,6 +2997,18 @@ } ] }, + { + "name": "messageForwardOriginMessageImport", + "description": "The message was imported from an exported message history", + "class": "MessageForwardOrigin", + "properties": [ + { + "name": "sender_name", + "type": "string", + "description": "Name of the sender" + } + ] + }, { "name": "messageForwardInfo", "description": "Contains information about a forwarded message", @@ -2664,9 +3052,9 @@ "description": "Number of times the message was directly or indirectly replied" }, { - "name": "recent_repliers", + "name": "recent_replier_ids", "type": "vector\u003cMessageSender\u003e", - "description": "Recent repliers to the message; available in channels with a discussion supergroup" + "description": "Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available" }, { "name": "last_read_inbox_message_id", @@ -2703,7 +3091,7 @@ { "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" + "description": "Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself" } ] }, @@ -2733,6 +3121,11 @@ "type": "Bool", "description": "True, if the message can be re-sent" }, + { + "name": "need_another_sender", + "type": "Bool", + "description": "True, if the message can be re-sent only on behalf of a different sender" + }, { "name": "retry_after", "type": "double", @@ -2751,9 +3144,9 @@ "description": "Message identifier; unique for the chat to which the message belongs" }, { - "name": "sender", + "name": "sender_id", "type": "MessageSender", - "description": "The sender of the message" + "description": "Identifier of the sender of the message" }, { "name": "chat_id", @@ -2763,12 +3156,12 @@ { "name": "sending_state", "type": "MessageSendingState", - "description": "Information about the sending state of the message; may be null" + "description": "The sending state of the message; may be null" }, { "name": "scheduling_state", "type": "MessageSchedulingState", - "description": "Information about the scheduling state of the message; may be null" + "description": "The scheduling state of the message; may be null" }, { "name": "is_outgoing", @@ -2790,6 +3183,11 @@ "type": "Bool", "description": "True, if the message can be forwarded" }, + { + "name": "can_be_saved", + "type": "Bool", + "description": "True, if content of the message can be saved locally or copied" + }, { "name": "can_be_deleted_only_for_self", "type": "Bool", @@ -2810,6 +3208,21 @@ "type": "Bool", "description": "True, if the message thread info is available" }, + { + "name": "can_get_viewers", + "type": "Bool", + "description": "True, if chat members already viewed the message can be received through getMessageViewers" + }, + { + "name": "can_get_media_timestamp_links", + "type": "Bool", + "description": "True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description" + }, + { + "name": "has_timestamped_media", + "type": "Bool", + "description": "True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message" + }, { "name": "is_channel_post", "type": "Bool", @@ -2863,11 +3276,11 @@ { "name": "ttl_expires_in", "type": "double", - "description": "Time left before the message expires, in seconds" + "description": "Time left before the message expires, in seconds. If the TTL timer isn't started yet, equals to the value of the ttl field" }, { "name": "via_bot_user_id", - "type": "int32", + "type": "int53", "description": "If non-zero, the user identifier of the bot through which this message was sent" }, { @@ -2878,7 +3291,7 @@ { "name": "media_album_id", "type": "int64", - "description": "Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums" + "description": "Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums" }, { "name": "restriction_reason", @@ -2936,6 +3349,106 @@ } ] }, + { + "name": "messagePosition", + "description": "Contains information about a message in a specific position", + "class": "MessagePosition", + "properties": [ + { + "name": "position", + "type": "int32", + "description": "0-based message position in the full list of suitable messages" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the message was sent" + } + ] + }, + { + "name": "messagePositions", + "description": "Contains a list of message positions", + "class": "MessagePositions", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Total count of messages found" + }, + { + "name": "positions", + "type": "vector\u003cmessagePosition\u003e", + "description": "List of message positions" + } + ] + }, + { + "name": "messageCalendarDay", + "description": "Contains information about found messages sent on a specific day", + "class": "MessageCalendarDay", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Total number of found messages sent on the day" + }, + { + "name": "message", + "type": "message", + "description": "First message sent on the day" + } + ] + }, + { + "name": "messageCalendar", + "description": "Contains information about found messages, split by days according to the option \"utc_time_offset\"", + "class": "MessageCalendar", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Total number of found messages" + }, + { + "name": "days", + "type": "vector\u003cmessageCalendarDay\u003e", + "description": "Information about messages sent" + } + ] + }, + { + "name": "sponsoredMessage", + "description": "Describes a sponsored message", + "class": "SponsoredMessage", + "properties": [ + { + "name": "message_id", + "type": "int53", + "description": "Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages" + }, + { + "name": "sponsor_chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "link", + "type": "InternalLinkType", + "description": "An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead" + }, + { + "name": "content", + "type": "MessageContent", + "description": "Content of the message. Currently, can be only of the type messageText" + } + ] + }, { "name": "notificationSettingsScopePrivateChats", "description": "Notification settings applied to all private and secret chats when the corresponding chat setting has a default value", @@ -2987,7 +3500,7 @@ { "name": "show_preview", "type": "Bool", - "description": "True, if message content should be displayed in notifications" + "description": "True, if message content must be displayed in notifications" }, { "name": "use_default_disable_pinned_message_notifications", @@ -3029,7 +3542,7 @@ { "name": "show_preview", "type": "Bool", - "description": "True, if message content should be displayed in notifications" + "description": "True, if message content must be displayed in notifications" }, { "name": "disable_pinned_message_notifications", @@ -3061,7 +3574,7 @@ { "name": "input_message_text", "type": "InputMessageContent", - "description": "Content of the message draft; this should always be of type inputMessageText" + "description": "Content of the message draft; must be of the type inputMessageText" } ] }, @@ -3072,31 +3585,31 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" } ] }, { "name": "chatTypeBasicGroup", - "description": "A basic group (i.e., a chat with 0-200 other users)", + "description": "A basic group (a chat with 0-200 other users)", "class": "ChatType", "properties": [ { "name": "basic_group_id", - "type": "int32", + "type": "int53", "description": "Basic group identifier" } ] }, { "name": "chatTypeSupergroup", - "description": "A supergroup (i.e. a chat with up to GetOption(\"supergroup_max_size\") other users), or channel (with unlimited members)", + "description": "A supergroup or channel (with unlimited members)", "class": "ChatType", "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "Supergroup or channel identifier" }, { @@ -3118,7 +3631,7 @@ }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier of the secret chat peer" } ] @@ -3136,7 +3649,7 @@ { "name": "icon_name", "type": "string", - "description": "The icon name for short filter representation. If non-empty, must be one of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\". If empty, use getChatFilterDefaultIconName to get default icon name for the filter" + "description": "The chosen icon name for short filter representation. If non-empty, must be one of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\". If empty, use getChatFilterDefaultIconName to get default icon name for the filter" }, { "name": "pinned_chat_ids", @@ -3213,7 +3726,7 @@ { "name": "icon_name", "type": "string", - "description": "The icon name for short filter representation. One of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\"" + "description": "The chosen or default icon name for short filter representation. One of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\"" } ] }, @@ -3332,6 +3845,28 @@ } ] }, + { + "name": "videoChat", + "description": "Describes a video chat", + "class": "VideoChat", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall" + }, + { + "name": "has_participants", + "type": "Bool", + "description": "True, if the video chat has participants" + }, + { + "name": "default_participant_id", + "type": "MessageSender", + "description": "Default group call participant identifier to join the video chat; may be null" + } + ] + }, { "name": "chat", "description": "A chat. (Can be a private chat, basic group, supergroup, or secret chat)", @@ -3372,6 +3907,16 @@ "type": "vector\u003cchatPosition\u003e", "description": "Positions of the chat in chat lists" }, + { + "name": "message_sender_id", + "type": "MessageSender", + "description": "Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender" + }, + { + "name": "has_protected_content", + "type": "Bool", + "description": "True, if chat content can't be saved locally, forwarded, or copied" + }, { "name": "is_marked_as_unread", "type": "Bool", @@ -3400,7 +3945,7 @@ { "name": "can_be_reported", "type": "Bool", - "description": "True, if the chat can be reported to Telegram moderators through reportChat" + "description": "True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto" }, { "name": "default_disable_notification", @@ -3432,10 +3977,30 @@ "type": "chatNotificationSettings", "description": "Notification settings for this chat" }, + { + "name": "message_ttl", + "type": "int32", + "description": "Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats" + }, + { + "name": "theme_name", + "type": "string", + "description": "If non-empty, name of a theme, set for the chat" + }, { "name": "action_bar", "type": "ChatActionBar", - "description": "Describes actions which should be possible to do through a chat action bar; may be null" + "description": "Information about actions which must be possible to do through the chat action bar; may be null" + }, + { + "name": "video_chat", + "type": "videoChat", + "description": "Information about video chat of the chat" + }, + { + "name": "pending_join_requests", + "type": "chatJoinRequestsInfo", + "description": "Information about pending join requests; may be null" }, { "name": "reply_markup_message_id", @@ -3450,7 +4015,7 @@ { "name": "client_data", "type": "string", - "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" + "description": "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" } ] }, @@ -3505,65 +4070,6 @@ } ] }, - { - "name": "chatInviteLink", - "description": "Contains a chat invite link", - "class": "ChatInviteLink", - "properties": [ - { - "name": "invite_link", - "type": "string", - "description": "Chat invite link" - } - ] - }, - { - "name": "chatInviteLinkInfo", - "description": "Contains information about a chat invite link", - "class": "ChatInviteLinkInfo", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "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", - "type": "ChatType", - "description": "Contains information about the type of the chat" - }, - { - "name": "title", - "type": "string", - "description": "Title of the chat" - }, - { - "name": "photo", - "type": "chatPhotoInfo", - "description": "Chat photo; may be null" - }, - { - "name": "member_count", - "type": "int32", - "description": "Number of members in the chat" - }, - { - "name": "member_user_ids", - "type": "vector\u003cint32\u003e", - "description": "User identifiers of some chat members that may be known to the current user" - }, - { - "name": "is_public", - "type": "Bool", - "description": "True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup" - } - ] - }, { "name": "publicChatTypeHasUsername", "description": "The chat is public, because it has username", @@ -3594,9 +4100,15 @@ "class": "ChatActionBar", "properties": [] }, + { + "name": "chatActionBarInviteMembers", + "description": "The chat is a recently created group chat to which new members can be invited", + "class": "ChatActionBar", + "properties": [] + }, { "name": "chatActionBarReportAddBlock", - "description": "The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method blockUser, or the other user can be added to the contact list using the method addContact", + "description": "The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact", "class": "ChatActionBar", "properties": [ { @@ -3623,9 +4135,31 @@ "class": "ChatActionBar", "properties": [] }, + { + "name": "chatActionBarJoinRequest", + "description": "The chat is a private chat with an administrator of a chat to which the user sent join request", + "class": "ChatActionBar", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Title of the chat to which the join request was sent" + }, + { + "name": "is_channel", + "type": "Bool", + "description": "True, if the join request was sent to a channel chat" + }, + { + "name": "request_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the join request was sent" + } + ] + }, { "name": "keyboardButtonTypeText", - "description": "A simple button, with text that should be sent when the button is pressed", + "description": "A simple button, with text that must be sent when the button is pressed", "class": "KeyboardButtonType", "properties": [] }, @@ -3689,7 +4223,7 @@ }, { "name": "inlineKeyboardButtonTypeLoginUrl", - "description": "A button that opens a specified URL and automatically logs in in current user if they allowed to do that", + "description": "A button that opens a specified URL and automatically authorize the current user if allowed to do so", "class": "InlineKeyboardButtonType", "properties": [ { @@ -3699,7 +4233,7 @@ }, { "name": "id", - "type": "int32", + "type": "int53", "description": "Unique button identifier" }, { @@ -3752,7 +4286,7 @@ { "name": "in_current_chat", "type": "Bool", - "description": "True, if the inline query should be sent from the current chat" + "description": "True, if the inline query must be sent from the current chat" } ] }, @@ -3762,6 +4296,18 @@ "class": "InlineKeyboardButtonType", "properties": [] }, + { + "name": "inlineKeyboardButtonTypeUser", + "description": "A button with a user reference to be handled in the same way as textEntityTypeMentionName entities", + "class": "InlineKeyboardButtonType", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + } + ] + }, { "name": "inlineKeyboardButton", "description": "Represents a single button in an inline keyboard", @@ -3800,6 +4346,11 @@ "name": "is_personal", "type": "Bool", "description": "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" + }, + { + "name": "input_field_placeholder", + "type": "string", + "description": "If non-empty, the placeholder to be shown in the input field when the reply is active; 0-64 characters" } ] }, @@ -3827,6 +4378,11 @@ "name": "is_personal", "type": "Bool", "description": "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" + }, + { + "name": "input_field_placeholder", + "type": "string", + "description": "If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters" } ] }, @@ -3876,7 +4432,7 @@ }, { "name": "bot_user_id", - "type": "int32", + "type": "int53", "description": "User identifier of a bot linked with the website" }, { @@ -3904,7 +4460,12 @@ { "name": "reply_info", "type": "messageReplyInfo", - "description": "Contains information about the message thread" + "description": "Information about the message thread" + }, + { + "name": "unread_message_count", + "type": "int32", + "description": "Approximate number of unread messages in the message thread" }, { "name": "messages", @@ -4095,12 +4656,12 @@ { "name": "width", "type": "int32", - "description": "Width of a bounding box in which the image should be shown; 0 if unknown" + "description": "Width of a bounding box in which the image must be shown; 0 if unknown" }, { "name": "height", "type": "int32", - "description": "Height of a bounding box in which the image should be shown; 0 if unknown" + "description": "Height of a bounding box in which the image must be shown; 0 if unknown" } ] }, @@ -4151,7 +4712,7 @@ { "name": "anchor_name", "type": "string", - "description": "The anchor name. If the name is empty, the link should bring back to top" + "description": "The anchor name. If the name is empty, the link must bring back to top" }, { "name": "url", @@ -4208,37 +4769,37 @@ }, { "name": "pageBlockHorizontalAlignmentLeft", - "description": "The content should be left-aligned", + "description": "The content must be left-aligned", "class": "PageBlockHorizontalAlignment", "properties": [] }, { "name": "pageBlockHorizontalAlignmentCenter", - "description": "The content should be center-aligned", + "description": "The content must be center-aligned", "class": "PageBlockHorizontalAlignment", "properties": [] }, { "name": "pageBlockHorizontalAlignmentRight", - "description": "The content should be right-aligned", + "description": "The content must be right-aligned", "class": "PageBlockHorizontalAlignment", "properties": [] }, { "name": "pageBlockVerticalAlignmentTop", - "description": "The content should be top-aligned", + "description": "The content must be top-aligned", "class": "PageBlockVerticalAlignment", "properties": [] }, { "name": "pageBlockVerticalAlignmentMiddle", - "description": "The content should be middle-aligned", + "description": "The content must be middle-aligned", "class": "PageBlockVerticalAlignment", "properties": [] }, { "name": "pageBlockVerticalAlignmentBottom", - "description": "The content should be bottom-aligned", + "description": "The content must be bottom-aligned", "class": "PageBlockVerticalAlignment", "properties": [] }, @@ -4250,7 +4811,7 @@ { "name": "text", "type": "RichText", - "description": "Cell text; may be null. If the text is null, then the cell should be invisible" + "description": "Cell text; may be null. If the text is null, then the cell must be invisible" }, { "name": "is_header", @@ -4260,12 +4821,12 @@ { "name": "colspan", "type": "int32", - "description": "The number of columns the cell should span" + "description": "The number of columns the cell spans" }, { "name": "rowspan", "type": "int32", - "description": "The number of rows the cell should span" + "description": "The number of rows the cell spans" }, { "name": "align", @@ -4418,7 +4979,7 @@ { "name": "language", "type": "string", - "description": "Programming language for which the text should be formatted" + "description": "Programming language for which the text needs to be formatted" } ] }, @@ -4516,7 +5077,7 @@ { "name": "need_autoplay", "type": "Bool", - "description": "True, if the animation should be played automatically" + "description": "True, if the animation must be played automatically" } ] }, @@ -4577,12 +5138,12 @@ { "name": "need_autoplay", "type": "Bool", - "description": "True, if the video should be played automatically" + "description": "True, if the video must be played automatically" }, { "name": "is_looped", "type": "Bool", - "description": "True, if the video should be looped" + "description": "True, if the video must be looped" } ] }, @@ -4653,12 +5214,12 @@ { "name": "is_full_width", "type": "Bool", - "description": "True, if the block should be full width" + "description": "True, if the block must be full width" }, { "name": "allow_scrolling", "type": "Bool", - "description": "True, if scrolling should be allowed" + "description": "True, if scrolling needs to be allowed" } ] }, @@ -4751,7 +5312,7 @@ { "name": "username", "type": "string", - "description": "Chat username, by which all other information about the chat should be resolved" + "description": "Chat username, by which all other information about the chat can be resolved" } ] }, @@ -4871,7 +5432,7 @@ { "name": "version", "type": "int32", - "description": "Version of the instant view, currently can be 1 or 2" + "description": "Version of the instant view; currently, can be 1 or 2" }, { "name": "is_rtl", @@ -4882,6 +5443,11 @@ "name": "is_full", "type": "Bool", "description": "True, if the instant view contains the full page. A network request might be needed to get the full web page instant view" + }, + { + "name": "feedback_link", + "type": "InternalLinkType", + "description": "An internal link to be opened to leave feedback about the instant view" } ] }, @@ -4968,7 +5534,7 @@ { "name": "document", "type": "document", - "description": "Preview of the content as a document, if available (currently only available for small PDF files and ZIP archives); may be null" + "description": "Preview of the content as a document, if available; may be null" }, { "name": "sticker", @@ -4993,7 +5559,7 @@ { "name": "instant_view_version", "type": "int32", - "description": "Version of instant view, available for the web page (currently can be 1 or 2), 0 if none" + "description": "Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none" } ] }, @@ -5020,7 +5586,7 @@ { "name": "is_hidden", "type": "Bool", - "description": "True, if the country should be hidden from the list of all countries" + "description": "True, if the country must be hidden from the list of all countries" }, { "name": "calling_codes", @@ -5059,7 +5625,7 @@ { "name": "formatted_phone_number", "type": "string", - "description": "The phone number without country calling code formatted accordingly to local rules" + "description": "The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user" } ] }, @@ -5147,7 +5713,7 @@ { "name": "amount", "type": "int53", - "description": "Currency amount in minimal quantity of the currency" + "description": "Currency amount in the smallest units of the currency" } ] }, @@ -5166,6 +5732,16 @@ "type": "vector\u003clabeledPricePart\u003e", "description": "A list of objects used to calculate the total price of the product" }, + { + "name": "max_tip_amount", + "type": "int53", + "description": "The maximum allowed amount of tip in the smallest units of the currency" + }, + { + "name": "suggested_tip_amounts", + "type": "vector\u003cint53\u003e", + "description": "Suggested amounts of tip in the smallest units of the currency" + }, { "name": "is_test", "type": "Bool", @@ -5294,7 +5870,7 @@ { "name": "data", "type": "string", - "description": "Contains JSON-encoded data with a credential identifier from the payment provider" + "description": "JSON-encoded data with the credential identifier from the payment provider" }, { "name": "allow_save", @@ -5304,8 +5880,8 @@ ] }, { - "name": "inputCredentialsAndroidPay", - "description": "Applies if a user enters new credentials using Android Pay", + "name": "inputCredentialsApplePay", + "description": "Applies if a user enters new credentials using Apple Pay", "class": "InputCredentials", "properties": [ { @@ -5316,8 +5892,8 @@ ] }, { - "name": "inputCredentialsApplePay", - "description": "Applies if a user enters new credentials using Apple Pay", + "name": "inputCredentialsGooglePay", + "description": "Applies if a user enters new credentials using Google Pay", "class": "InputCredentials", "properties": [ { @@ -5354,11 +5930,53 @@ } ] }, + { + "name": "paymentFormTheme", + "description": "Theme colors for a payment form", + "class": "PaymentFormTheme", + "properties": [ + { + "name": "background_color", + "type": "int32", + "description": "A color of the payment form background in the RGB24 format" + }, + { + "name": "text_color", + "type": "int32", + "description": "A color of text in the RGB24 format" + }, + { + "name": "hint_color", + "type": "int32", + "description": "A color of hints in the RGB24 format" + }, + { + "name": "link_color", + "type": "int32", + "description": "A color of links in the RGB24 format" + }, + { + "name": "button_color", + "type": "int32", + "description": "A color of the buttons in the RGB24 format" + }, + { + "name": "button_text_color", + "type": "int32", + "description": "A color of text on the buttons in the RGB24 format" + } + ] + }, { "name": "paymentForm", "description": "Contains information about an invoice payment form", "class": "PaymentForm", "properties": [ + { + "name": "id", + "type": "int64", + "description": "The payment form identifier" + }, { "name": "invoice", "type": "invoice", @@ -5369,10 +5987,20 @@ "type": "string", "description": "Payment form URL" }, + { + "name": "seller_bot_user_id", + "type": "int53", + "description": "User identifier of the seller bot" + }, + { + "name": "payments_provider_user_id", + "type": "int53", + "description": "User identifier of the payment provider bot" + }, { "name": "payments_provider", "type": "paymentsProviderStripe", - "description": "Contains information about the payment provider, if available, to support it natively without the need for opening the URL; may be null" + "description": "Information about the payment provider, if available, to support it natively without the need for opening the URL; may be null" }, { "name": "saved_order_info", @@ -5382,7 +6010,7 @@ { "name": "saved_credentials", "type": "savedCredentials", - "description": "Contains information about saved card credentials; may be null" + "description": "Information about saved card credentials; may be null" }, { "name": "can_save_credentials", @@ -5421,7 +6049,7 @@ { "name": "success", "type": "Bool", - "description": "True, if the payment request was successful; otherwise the verification_url will be not empty" + "description": "True, if the payment request was successful; otherwise the verification_url will be non-empty" }, { "name": "verification_url", @@ -5435,25 +6063,45 @@ "description": "Contains information about a successful payment", "class": "PaymentReceipt", "properties": [ + { + "name": "title", + "type": "string", + "description": "Product title" + }, + { + "name": "description", + "type": "string", + "description": "Product description" + }, + { + "name": "photo", + "type": "photo", + "description": "Product photo; may be null" + }, { "name": "date", "type": "int32", "description": "Point in time (Unix timestamp) when the payment was made" }, + { + "name": "seller_bot_user_id", + "type": "int53", + "description": "User identifier of the seller bot" + }, { "name": "payments_provider_user_id", - "type": "int32", + "type": "int53", "description": "User identifier of the payment provider bot" }, { "name": "invoice", "type": "invoice", - "description": "Contains information about the invoice" + "description": "Information about the invoice" }, { "name": "order_info", "type": "orderInfo", - "description": "Contains order information; may be null" + "description": "Order information; may be null" }, { "name": "shipping_option", @@ -5463,7 +6111,12 @@ { "name": "credentials_title", "type": "string", - "description": "Title of the saved credentials" + "description": "Title of the saved credentials chosen by the buyer" + }, + { + "name": "tip_amount", + "type": "int53", + "description": "The amount of tip chosen by the buyer in the smallest units of the currency" } ] }, @@ -5570,17 +6223,17 @@ { "name": "day", "type": "int32", - "description": "Day of the month, 1-31" + "description": "Day of the month; 1-31" }, { "name": "month", "type": "int32", - "description": "Month, 1-12" + "description": "Month; 1-12" }, { "name": "year", "type": "int32", - "description": "Year, 1-9999" + "description": "Year; 1-9999" } ] }, @@ -5654,7 +6307,7 @@ { "name": "expiry_date", "type": "date", - "description": "Document expiry date; may be null" + "description": "Document expiry date; may be null if not applicable" }, { "name": "front_side", @@ -5664,7 +6317,7 @@ { "name": "reverse_side", "type": "datedFile", - "description": "Reverse side of the document; only for driver license and identity card" + "description": "Reverse side of the document; only for driver license and identity card; may be null" }, { "name": "selfie", @@ -5691,7 +6344,7 @@ { "name": "expiry_date", "type": "date", - "description": "Document expiry date, if available" + "description": "Document expiry date; pass null if not applicable" }, { "name": "front_side", @@ -5701,12 +6354,12 @@ { "name": "reverse_side", "type": "InputFile", - "description": "Reverse side of the document; only for driver license and identity card" + "description": "Reverse side of the document; only for driver license and identity card; pass null otherwise" }, { "name": "selfie", "type": "InputFile", - "description": "Selfie with the document, if available" + "description": "Selfie with the document; pass null if unavailable" }, { "name": "translation", @@ -6219,7 +6872,7 @@ { "name": "required_elements", "type": "vector\u003cpassportRequiredElement\u003e", - "description": "Information about the Telegram Passport elements that must be provided to complete the form" + "description": "Telegram Passport elements that must be provided to complete the form" }, { "name": "privacy_policy_url", @@ -6695,6 +7348,23 @@ } ] }, + { + "name": "messageAnimatedEmoji", + "description": "A message with an animated emoji", + "class": "MessageContent", + "properties": [ + { + "name": "animated_emoji", + "type": "animatedEmoji", + "description": "The animated emoji" + }, + { + "name": "emoji", + "type": "string", + "description": "The corresponding emoji" + } + ] + }, { "name": "messageDice", "description": "A dice message. The dice value is randomly generated by the server", @@ -6779,7 +7449,7 @@ { "name": "total_amount", "type": "int53", - "description": "Product total price in the minimal quantity of the currency" + "description": "Product total price in the smallest units of the currency" }, { "name": "start_parameter", @@ -6794,7 +7464,7 @@ { "name": "need_shipping_address", "type": "Bool", - "description": "True, if the shipping address should be specified" + "description": "True, if the shipping address must be specified" }, { "name": "receipt_message_id", @@ -6825,6 +7495,64 @@ } ] }, + { + "name": "messageVideoChatScheduled", + "description": "A new video chat was scheduled", + "class": "MessageContent", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Identifier of the video chat. The video chat can be received through the method getGroupCall" + }, + { + "name": "start_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the group call is supposed to be started by an administrator" + } + ] + }, + { + "name": "messageVideoChatStarted", + "description": "A newly created video chat", + "class": "MessageContent", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Identifier of the video chat. The video chat can be received through the method getGroupCall" + } + ] + }, + { + "name": "messageVideoChatEnded", + "description": "A message with information about an ended video chat", + "class": "MessageContent", + "properties": [ + { + "name": "duration", + "type": "int32", + "description": "Call duration, in seconds" + } + ] + }, + { + "name": "messageInviteVideoChatParticipants", + "description": "A message with information about an invite to a video chat", + "class": "MessageContent", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Identifier of the video chat. The video chat can be received through the method getGroupCall" + }, + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Invited user identifiers" + } + ] + }, { "name": "messageBasicGroupChatCreate", "description": "A newly created basic group", @@ -6837,7 +7565,7 @@ }, { "name": "member_user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "User identifiers of members in the basic group" } ] @@ -6891,14 +7619,20 @@ "properties": [ { "name": "member_user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "User identifiers of the new members" } ] }, { "name": "messageChatJoinByLink", - "description": "A new member joined the chat by invite link", + "description": "A new member joined the chat via an invite link", + "class": "MessageContent", + "properties": [] + }, + { + "name": "messageChatJoinByRequest", + "description": "A new member was accepted to the chat by an administrator", "class": "MessageContent", "properties": [] }, @@ -6909,7 +7643,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier of the deleted chat member" } ] @@ -6921,7 +7655,7 @@ "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "Identifier of the supergroup to which the basic group was upgraded" } ] @@ -6938,7 +7672,7 @@ }, { "name": "basic_group_id", - "type": "int32", + "type": "int53", "description": "The identifier of the original basic group" } ] @@ -6961,15 +7695,27 @@ "class": "MessageContent", "properties": [] }, + { + "name": "messageChatSetTheme", + "description": "A theme in the chat has been changed", + "class": "MessageContent", + "properties": [ + { + "name": "theme_name", + "type": "string", + "description": "If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one" + } + ] + }, { "name": "messageChatSetTtl", - "description": "The TTL (Time To Live) setting messages in a secret chat has been changed", + "description": "The TTL (Time To Live) setting for messages in the chat has been changed", "class": "MessageContent", "properties": [ { "name": "ttl", "type": "int32", - "description": "New TTL" + "description": "New message TTL" } ] }, @@ -7012,6 +7758,11 @@ "description": "A payment has been completed", "class": "MessageContent", "properties": [ + { + "name": "invoice_chat_id", + "type": "int53", + "description": "Identifier of the chat, containing the corresponding invoice message; 0 if unknown" + }, { "name": "invoice_message_id", "type": "int53", @@ -7025,7 +7776,7 @@ { "name": "total_amount", "type": "int53", - "description": "Total price for the product, in the minimal quantity of the currency" + "description": "Total price for the product, in the smallest units of the currency" } ] }, @@ -7034,11 +7785,6 @@ "description": "A payment has been completed; for bots only", "class": "MessageContent", "properties": [ - { - "name": "invoice_message_id", - "type": "int53", - "description": "Identifier of the message with the corresponding invoice; can be an identifier of a deleted message" - }, { "name": "currency", "type": "string", @@ -7047,7 +7793,7 @@ { "name": "total_amount", "type": "int53", - "description": "Total price for the product, in the minimal quantity of the currency" + "description": "Total price for the product, in the smallest units of the currency" }, { "name": "invoice_payload", @@ -7129,14 +7875,14 @@ "class": "MessageContent", "properties": [ { - "name": "traveler", + "name": "traveler_id", "type": "MessageSender", - "description": "The user or chat, which triggered the proximity alert" + "description": "The identifier of a user or chat that triggered the proximity alert" }, { - "name": "watcher", + "name": "watcher_id", "type": "MessageSender", - "description": "The user or chat, which subscribed for the proximity alert" + "description": "The identifier of a user or chat that subscribed for the proximity alert" }, { "name": "distance", @@ -7165,13 +7911,13 @@ }, { "name": "textEntityTypeCashtag", - "description": "A cashtag text, beginning with \"$\" and consisting of capital english letters (i.e. \"$USD\")", + "description": "A cashtag text, beginning with \"$\" and consisting of capital English letters (e.g., \"$USD\")", "class": "TextEntityType", "properties": [] }, { "name": "textEntityTypeBotCommand", - "description": "A bot command, beginning with \"/\". This shouldn't be highlighted if there are no bots in the chat", + "description": "A bot command, beginning with \"/\"", "class": "TextEntityType", "properties": [] }, @@ -7266,11 +8012,23 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the mentioned user" } ] }, + { + "name": "textEntityTypeMediaTimestamp", + "description": "A media timestamp", + "class": "TextEntityType", + "properties": [ + { + "name": "media_timestamp", + "type": "int32", + "description": "Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message" + } + ] + }, { "name": "inputThumbnail", "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", @@ -7329,19 +8087,19 @@ { "name": "scheduling_state", "type": "MessageSchedulingState", - "description": "Message scheduling state. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled" + "description": "Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled" } ] }, { "name": "messageCopyOptions", - "description": "Options to be used when a message content is copied without a link to the original message", + "description": "Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied", "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" + "description": "True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local" }, { "name": "replace_caption", @@ -7351,7 +8109,7 @@ { "name": "new_caption", "type": "formattedText", - "description": "New message caption. Ignored if replace_caption is false" + "description": "New message caption; pass null to copy message without caption. Ignored if replace_caption is false" } ] }, @@ -7368,12 +8126,12 @@ { "name": "disable_web_page_preview", "type": "Bool", - "description": "True, if rich web page previews for URLs in the message text should be disabled" + "description": "True, if rich web page previews for URLs in the message text must be disabled" }, { "name": "clear_draft", "type": "Bool", - "description": "True, if a chat message draft should be deleted" + "description": "True, if a chat message draft must be deleted" } ] }, @@ -7390,7 +8148,7 @@ { "name": "thumbnail", "type": "inputThumbnail", - "description": "Animation thumbnail, if available" + "description": "Animation thumbnail; pass null to skip thumbnail uploading" }, { "name": "added_sticker_file_ids", @@ -7415,7 +8173,7 @@ { "name": "caption", "type": "formattedText", - "description": "Animation caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Animation caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" } ] }, @@ -7432,7 +8190,7 @@ { "name": "album_cover_thumbnail", "type": "inputThumbnail", - "description": "Thumbnail of the cover for the album, if available" + "description": "Thumbnail of the cover for the album; pass null to skip thumbnail uploading" }, { "name": "duration", @@ -7452,7 +8210,7 @@ { "name": "caption", "type": "formattedText", - "description": "Audio caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Audio caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" } ] }, @@ -7469,7 +8227,7 @@ { "name": "thumbnail", "type": "inputThumbnail", - "description": "Document thumbnail, if available" + "description": "Document thumbnail; pass null to skip thumbnail uploading" }, { "name": "disable_content_type_detection", @@ -7479,7 +8237,7 @@ { "name": "caption", "type": "formattedText", - "description": "Document caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Document caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" } ] }, @@ -7496,7 +8254,7 @@ { "name": "thumbnail", "type": "inputThumbnail", - "description": "Photo thumbnail to be sent, this is sent to the other party in secret chats only" + "description": "Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats" }, { "name": "added_sticker_file_ids", @@ -7516,7 +8274,7 @@ { "name": "caption", "type": "formattedText", - "description": "Photo caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Photo caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" }, { "name": "ttl", @@ -7538,7 +8296,7 @@ { "name": "thumbnail", "type": "inputThumbnail", - "description": "Sticker thumbnail, if available" + "description": "Sticker thumbnail; pass null to skip thumbnail uploading" }, { "name": "width", @@ -7549,6 +8307,11 @@ "name": "height", "type": "int32", "description": "Sticker height" + }, + { + "name": "emoji", + "type": "string", + "description": "Emoji used to choose the sticker" } ] }, @@ -7565,7 +8328,7 @@ { "name": "thumbnail", "type": "inputThumbnail", - "description": "Video thumbnail, if available" + "description": "Video thumbnail; pass null to skip thumbnail uploading" }, { "name": "added_sticker_file_ids", @@ -7590,12 +8353,12 @@ { "name": "supports_streaming", "type": "Bool", - "description": "True, if the video should be tried to be streamed" + "description": "True, if the video is supposed to be streamed" }, { "name": "caption", "type": "formattedText", - "description": "Video caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Video caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" }, { "name": "ttl", @@ -7617,7 +8380,7 @@ { "name": "thumbnail", "type": "inputThumbnail", - "description": "Video thumbnail, if available" + "description": "Video thumbnail; pass null to skip thumbnail uploading" }, { "name": "duration", @@ -7654,7 +8417,7 @@ { "name": "caption", "type": "formattedText", - "description": "Voice note caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Voice note caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" } ] }, @@ -7671,7 +8434,7 @@ { "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" + "description": "Period for which the location can be updated, in seconds; must be between 60 and 86400 for a live location and 0 otherwise" }, { "name": "heading", @@ -7722,7 +8485,7 @@ { "name": "clear_draft", "type": "Bool", - "description": "True, if a chat message draft should be deleted" + "description": "True, if the chat message draft must be deleted" } ] }, @@ -7733,7 +8496,7 @@ "properties": [ { "name": "bot_user_id", - "type": "int32", + "type": "int53", "description": "User identifier of the bot that owns the game" }, { @@ -7745,7 +8508,7 @@ }, { "name": "inputMessageInvoice", - "description": "A message with an invoice; can be used only by bots and only in private chats", + "description": "A message with an invoice; can be used only by bots", "class": "InputMessageContent", "properties": [ { @@ -7801,7 +8564,7 @@ { "name": "start_parameter", "type": "string", - "description": "Unique invoice bot start_parameter for the generation of this invoice" + "description": "Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message" } ] }, @@ -7813,7 +8576,7 @@ { "name": "question", "type": "string", - "description": "Poll question, 1-255 characters (up to 300 characters for bots)" + "description": "Poll question; 1-255 characters (up to 300 characters for bots)" }, { "name": "options", @@ -7838,7 +8601,7 @@ { "name": "close_date", "type": "int32", - "description": "Point in time (Unix timestamp) when the poll will be automatically closed; for bots only" + "description": "Point in time (Unix timestamp) when the poll will automatically be closed; for bots only" }, { "name": "is_closed", @@ -7865,12 +8628,12 @@ { "name": "in_game_share", "type": "Bool", - "description": "True, if a game message should be shared within a launched game; applies only to game messages" + "description": "True, if a game message is being shared from a launched game; applies only to game messages" }, { "name": "copy_options", "type": "messageCopyOptions", - "description": "Options to be used to copy content of the message without a link to the original message" + "description": "Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual" } ] }, @@ -7934,18 +8697,6 @@ "class": "SearchMessagesFilter", "properties": [] }, - { - "name": "searchMessagesFilterCall", - "description": "Returns only call messages", - "class": "SearchMessagesFilter", - "properties": [] - }, - { - "name": "searchMessagesFilterMissedCall", - "description": "Returns only incoming call messages with missed/declined discard reasons", - "class": "SearchMessagesFilter", - "properties": [] - }, { "name": "searchMessagesFilterVideoNote", "description": "Returns only video note messages", @@ -8048,6 +8799,12 @@ } ] }, + { + "name": "chatActionChoosingSticker", + "description": "The user is picking a sticker to send", + "class": "ChatAction", + "properties": [] + }, { "name": "chatActionChoosingLocation", "description": "The user is picking a location or venue to send", @@ -8084,9 +8841,21 @@ } ] }, + { + "name": "chatActionWatchingAnimations", + "description": "The user is watching animations sent by the other party by clicking on an animated emoji", + "class": "ChatAction", + "properties": [ + { + "name": "emoji", + "type": "string", + "description": "The animated emoji" + } + ] + }, { "name": "chatActionCancel", - "description": "The user has cancelled the previous action", + "description": "The user has canceled the previous action", "class": "ChatAction", "properties": [] }, @@ -8187,6 +8956,11 @@ "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": "thumbnail_outline", + "type": "vector\u003cclosedVectorPath\u003e", + "description": "Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner" + }, { "name": "is_installed", "type": "Bool", @@ -8254,10 +9028,15 @@ "type": "thumbnail", "description": "Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null" }, + { + "name": "thumbnail_outline", + "type": "vector\u003cclosedVectorPath\u003e", + "description": "Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner" + }, { "name": "is_installed", "type": "Bool", - "description": "True, if the sticker set has been installed by current user" + "description": "True, if the sticker set has been installed by the current user" }, { "name": "is_archived", @@ -8292,7 +9071,7 @@ { "name": "covers", "type": "vector\u003csticker\u003e", - "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" + "description": "Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested" } ] }, @@ -8321,7 +9100,7 @@ }, { "name": "callDiscardReasonMissed", - "description": "The call was ended before the conversation started. It was cancelled by the caller or missed by the other party", + "description": "The call was ended before the conversation started. It was canceled by the caller or missed by the other party", "class": "CallDiscardReason", "properties": [] }, @@ -8371,7 +9150,7 @@ { "name": "library_versions", "type": "vector\u003cstring\u003e", - "description": "List of supported libtgvoip versions" + "description": "List of supported tgcalls versions" } ] }, @@ -8458,6 +9237,18 @@ } ] }, + { + "name": "groupCallId", + "description": "Contains the group call identifier", + "class": "GroupCallId", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Group call identifier" + } + ] + }, { "name": "callStatePending", "description": "The call is pending, waiting to be accepted by a user", @@ -8537,12 +9328,12 @@ { "name": "need_rating", "type": "Bool", - "description": "True, if the call rating should be sent to the server" + "description": "True, if the call rating must be sent to the server" }, { "name": "need_debug_information", "type": "Bool", - "description": "True, if the call debug information should be sent to the server" + "description": "True, if the call debug information must be sent to the server" } ] }, @@ -8558,6 +9349,279 @@ } ] }, + { + "name": "groupCallVideoQualityThumbnail", + "description": "The worst available video quality", + "class": "GroupCallVideoQuality", + "properties": [] + }, + { + "name": "groupCallVideoQualityMedium", + "description": "The medium video quality", + "class": "GroupCallVideoQuality", + "properties": [] + }, + { + "name": "groupCallVideoQualityFull", + "description": "The best available video quality", + "class": "GroupCallVideoQuality", + "properties": [] + }, + { + "name": "groupCallRecentSpeaker", + "description": "Describes a recently speaking participant in a group call", + "class": "GroupCallRecentSpeaker", + "properties": [ + { + "name": "participant_id", + "type": "MessageSender", + "description": "Group call participant identifier" + }, + { + "name": "is_speaking", + "type": "Bool", + "description": "True, is the user has spoken recently" + } + ] + }, + { + "name": "groupCall", + "description": "Describes a group call", + "class": "GroupCall", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "title", + "type": "string", + "description": "Group call title" + }, + { + "name": "scheduled_start_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended" + }, + { + "name": "enabled_start_notification", + "type": "Bool", + "description": "True, if the group call is scheduled and the current user will receive a notification when the group call will start" + }, + { + "name": "is_active", + "type": "Bool", + "description": "True, if the call is active" + }, + { + "name": "is_joined", + "type": "Bool", + "description": "True, if the call is joined" + }, + { + "name": "need_rejoin", + "type": "Bool", + "description": "True, if user was kicked from the call because of network loss and the call needs to be rejoined" + }, + { + "name": "can_be_managed", + "type": "Bool", + "description": "True, if the current user can manage the group call" + }, + { + "name": "participant_count", + "type": "int32", + "description": "Number of participants in the group call" + }, + { + "name": "loaded_all_participants", + "type": "Bool", + "description": "True, if all group call participants are loaded" + }, + { + "name": "recent_speakers", + "type": "vector\u003cgroupCallRecentSpeaker\u003e", + "description": "At most 3 recently speaking users in the group call" + }, + { + "name": "is_my_video_enabled", + "type": "Bool", + "description": "True, if the current user's video is enabled" + }, + { + "name": "is_my_video_paused", + "type": "Bool", + "description": "True, if the current user's video is paused" + }, + { + "name": "can_enable_video", + "type": "Bool", + "description": "True, if the current user can broadcast video or share screen" + }, + { + "name": "mute_new_participants", + "type": "Bool", + "description": "True, if only group call administrators can unmute new participants" + }, + { + "name": "can_toggle_mute_new_participants", + "type": "Bool", + "description": "True, if the current user can enable or disable mute_new_participants setting" + }, + { + "name": "record_duration", + "type": "int32", + "description": "Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on" + }, + { + "name": "is_video_recorded", + "type": "Bool", + "description": "True, if a video file is being recorded for the call" + }, + { + "name": "duration", + "type": "int32", + "description": "Call duration, in seconds; for ended calls only" + } + ] + }, + { + "name": "groupCallVideoSourceGroup", + "description": "Describes a group of video synchronization source identifiers", + "class": "GroupCallVideoSourceGroup", + "properties": [ + { + "name": "semantics", + "type": "string", + "description": "The semantics of sources, one of \"SIM\" or \"FID\"" + }, + { + "name": "source_ids", + "type": "vector\u003cint32\u003e", + "description": "The list of synchronization source identifiers" + } + ] + }, + { + "name": "groupCallParticipantVideoInfo", + "description": "Contains information about a group call participant's video channel", + "class": "GroupCallParticipantVideoInfo", + "properties": [ + { + "name": "source_groups", + "type": "vector\u003cgroupCallVideoSourceGroup\u003e", + "description": "List of synchronization source groups of the video" + }, + { + "name": "endpoint_id", + "type": "string", + "description": "Video channel endpoint identifier" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "True if the video is paused. This flag needs to be ignored, if new video frames are received" + } + ] + }, + { + "name": "groupCallParticipant", + "description": "Represents a group call participant", + "class": "GroupCallParticipant", + "properties": [ + { + "name": "participant_id", + "type": "MessageSender", + "description": "Identifier of the group call participant" + }, + { + "name": "audio_source_id", + "type": "int32", + "description": "User's audio channel synchronization source identifier" + }, + { + "name": "screen_sharing_audio_source_id", + "type": "int32", + "description": "User's screen sharing audio channel synchronization source identifier" + }, + { + "name": "video_info", + "type": "groupCallParticipantVideoInfo", + "description": "Information about user's video channel; may be null if there is no active video" + }, + { + "name": "screen_sharing_video_info", + "type": "groupCallParticipantVideoInfo", + "description": "Information about user's screen sharing video channel; may be null if there is no active screen sharing video" + }, + { + "name": "bio", + "type": "string", + "description": "The participant user's bio or the participant chat's description" + }, + { + "name": "is_current_user", + "type": "Bool", + "description": "True, if the participant is the current user" + }, + { + "name": "is_speaking", + "type": "Bool", + "description": "True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking" + }, + { + "name": "is_hand_raised", + "type": "Bool", + "description": "True, if the participant hand is raised" + }, + { + "name": "can_be_muted_for_all_users", + "type": "Bool", + "description": "True, if the current user can mute the participant for all other group call participants" + }, + { + "name": "can_be_unmuted_for_all_users", + "type": "Bool", + "description": "True, if the current user can allow the participant to unmute themselves or unmute the participant (if the participant is the current user)" + }, + { + "name": "can_be_muted_for_current_user", + "type": "Bool", + "description": "True, if the current user can mute the participant only for self" + }, + { + "name": "can_be_unmuted_for_current_user", + "type": "Bool", + "description": "True, if the current user can unmute the participant for self" + }, + { + "name": "is_muted_for_all_users", + "type": "Bool", + "description": "True, if the participant is muted for all users" + }, + { + "name": "is_muted_for_current_user", + "type": "Bool", + "description": "True, if the participant is muted for the current user" + }, + { + "name": "can_unmute_self", + "type": "Bool", + "description": "True, if the participant is muted for all users, but can unmute themselves" + }, + { + "name": "volume_level", + "type": "int32", + "description": "Participant's volume level; 1-20000 in hundreds of percents" + }, + { + "name": "order", + "type": "string", + "description": "User's order in the group call participant list. Orders must be compared lexicographically. The bigger is order, the higher is user in the list. If order is empty, the user must be removed from the participant list" + } + ] + }, { "name": "callProblemEcho", "description": "The user heard their own voice", @@ -8624,7 +9688,7 @@ }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Peer user identifier" }, { @@ -8652,7 +9716,12 @@ { "name": "allow_flash_call", "type": "Bool", - "description": "Pass true if the authentication code may be sent via flash call to the specified phone number" + "description": "Pass true if the authentication code may be sent via a flash call to the specified phone number" + }, + { + "name": "allow_missed_call", + "type": "Bool", + "description": "Pass true if the authentication code may be sent via a missed call to the specified phone number" }, { "name": "is_current_phone_number", @@ -8663,6 +9732,11 @@ "name": "allow_sms_retriever_api", "type": "Bool", "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" + }, + { + "name": "authentication_tokens", + "type": "vector\u003cstring\u003e", + "description": "List of up to 20 authentication tokens, recently received in updateOption(\"authentication_token\") in previously logged out sessions" } ] }, @@ -8729,7 +9803,7 @@ "properties": [ { "name": "user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "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" }, { @@ -8753,7 +9827,7 @@ }, { "name": "inputInlineQueryResultAnimation", - "description": "Represents a link to an animated GIF or an animated (i.e. without sound) H.264/MPEG-4 AVC video", + "description": "Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video", "class": "InputInlineQueryResult", "properties": [ { @@ -8804,12 +9878,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -8861,12 +9935,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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, InputMessageLocation, InputMessageVenue or InputMessageContact" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -8903,12 +9977,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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, InputMessageAudio, InputMessageLocation, InputMessageVenue or InputMessageContact" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAudio, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -8945,12 +10019,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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, InputMessageLocation, InputMessageVenue or InputMessageContact" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -9002,12 +10076,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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, InputMessageDocument, InputMessageLocation, InputMessageVenue or InputMessageContact" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageDocument, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -9029,7 +10103,7 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "Message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null" } ] }, @@ -9076,12 +10150,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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, InputMessageLocation, InputMessageVenue or InputMessageContact" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -9128,12 +10202,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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, InputMessagePhoto, InputMessageLocation, InputMessageVenue or InputMessageContact" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -9170,12 +10244,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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, inputMessageSticker, InputMessageLocation, InputMessageVenue or InputMessageContact" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -9212,12 +10286,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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, InputMessageLocation, InputMessageVenue or InputMessageContact" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -9274,12 +10348,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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, InputMessageVideo, InputMessageLocation, InputMessageVenue or InputMessageContact" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVideo, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -9311,12 +10385,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The message reply markup. Must be of type replyMarkupInlineKeyboard or null" + "description": "The message reply markup; pass null if none. 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, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue or InputMessageContact" + "description": "The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVoiceNote, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact" } ] }, @@ -9627,7 +10701,7 @@ { "name": "switch_pm_text", "type": "string", - "description": "If non-empty, this text should be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter" + "description": "If non-empty, this text must be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter" }, { "name": "switch_pm_parameter", @@ -9690,7 +10764,7 @@ { "name": "show_alert", "type": "Bool", - "description": "True, if an alert should be shown to the user instead of a toast notification" + "description": "True, if an alert must be shown to the user instead of a toast notification" }, { "name": "url", @@ -9723,7 +10797,7 @@ }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -9816,6 +10890,35 @@ "class": "ChatEventAction", "properties": [] }, + { + "name": "chatEventMemberJoinedByInviteLink", + "description": "A new member joined the chat via an invite link", + "class": "ChatEventAction", + "properties": [ + { + "name": "invite_link", + "type": "chatInviteLink", + "description": "Invite link used to join the chat" + } + ] + }, + { + "name": "chatEventMemberJoinedByRequest", + "description": "A new member was accepted to the chat by an administrator", + "class": "ChatEventAction", + "properties": [ + { + "name": "approver_user_id", + "type": "int53", + "description": "User identifier of the chat administrator, approved user join request" + }, + { + "name": "invite_link", + "type": "chatInviteLink", + "description": "Invite link used to join the chat; may be null" + } + ] + }, { "name": "chatEventMemberLeft", "description": "A member left the chat", @@ -9829,7 +10932,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "New member user identifier" }, { @@ -9846,8 +10949,8 @@ "properties": [ { "name": "user_id", - "type": "int32", - "description": "Chat member user identifier" + "type": "int53", + "description": "Affected chat member user identifier" }, { "name": "old_status", @@ -9867,9 +10970,9 @@ "class": "ChatEventAction", "properties": [ { - "name": "user_id", - "type": "int32", - "description": "Chat member user identifier" + "name": "member_id", + "type": "MessageSender", + "description": "Affected chat member identifier" }, { "name": "old_status", @@ -10005,12 +11108,29 @@ { "name": "old_slow_mode_delay", "type": "int32", - "description": "Previous value of slow_mode_delay" + "description": "Previous value of slow_mode_delay, in seconds" }, { "name": "new_slow_mode_delay", "type": "int32", - "description": "New value of slow_mode_delay" + "description": "New value of slow_mode_delay, in seconds" + } + ] + }, + { + "name": "chatEventMessageTtlChanged", + "description": "The message TTL was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_message_ttl", + "type": "int32", + "description": "Previous value of message_ttl" + }, + { + "name": "new_message_ttl", + "type": "int32", + "description": "New value of message_ttl" } ] }, @@ -10026,6 +11146,18 @@ } ] }, + { + "name": "chatEventHasProtectedContentToggled", + "description": "The has_protected_content setting of a channel was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "has_protected_content", + "type": "Bool", + "description": "New value of has_protected_content" + } + ] + }, { "name": "chatEventStickerSetChanged", "description": "The supergroup sticker set was changed", @@ -10072,6 +11204,117 @@ } ] }, + { + "name": "chatEventInviteLinkEdited", + "description": "A chat invite link was edited", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_invite_link", + "type": "chatInviteLink", + "description": "Previous information about the invite link" + }, + { + "name": "new_invite_link", + "type": "chatInviteLink", + "description": "New information about the invite link" + } + ] + }, + { + "name": "chatEventInviteLinkRevoked", + "description": "A chat invite link was revoked", + "class": "ChatEventAction", + "properties": [ + { + "name": "invite_link", + "type": "chatInviteLink", + "description": "The invite link" + } + ] + }, + { + "name": "chatEventInviteLinkDeleted", + "description": "A revoked chat invite link was deleted", + "class": "ChatEventAction", + "properties": [ + { + "name": "invite_link", + "type": "chatInviteLink", + "description": "The invite link" + } + ] + }, + { + "name": "chatEventVideoChatCreated", + "description": "A video chat was created", + "class": "ChatEventAction", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Identifier of the video chat. The video chat can be received through the method getGroupCall" + } + ] + }, + { + "name": "chatEventVideoChatEnded", + "description": "A video chat was ended", + "class": "ChatEventAction", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Identifier of the video chat. The video chat can be received through the method getGroupCall" + } + ] + }, + { + "name": "chatEventVideoChatParticipantIsMutedToggled", + "description": "A video chat participant was muted or unmuted", + "class": "ChatEventAction", + "properties": [ + { + "name": "participant_id", + "type": "MessageSender", + "description": "Identifier of the affected group call participant" + }, + { + "name": "is_muted", + "type": "Bool", + "description": "New value of is_muted" + } + ] + }, + { + "name": "chatEventVideoChatParticipantVolumeLevelChanged", + "description": "A video chat participant volume level was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "participant_id", + "type": "MessageSender", + "description": "Identifier of the affected group call participant" + }, + { + "name": "volume_level", + "type": "int32", + "description": "New value of volume_level; 1-20000 in hundreds of percents" + } + ] + }, + { + "name": "chatEventVideoChatMuteNewParticipantsToggled", + "description": "The mute_new_participants setting of a video chat was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "mute_new_participants", + "type": "Bool", + "description": "New value of the mute_new_participants setting" + } + ] + }, { "name": "chatEvent", "description": "Represents a chat event", @@ -10088,14 +11331,14 @@ "description": "Point in time (Unix timestamp) when the event happened" }, { - "name": "user_id", - "type": "int32", - "description": "Identifier of the user who performed the action that triggered the event" + "name": "member_id", + "type": "MessageSender", + "description": "Identifier of the user or chat who performed the action" }, { "name": "action", "type": "ChatEventAction", - "description": "Action performed by the user" + "description": "The action" } ] }, @@ -10119,52 +11362,62 @@ { "name": "message_edits", "type": "Bool", - "description": "True, if message edits should be returned" + "description": "True, if message edits need to be returned" }, { "name": "message_deletions", "type": "Bool", - "description": "True, if message deletions should be returned" + "description": "True, if message deletions need to be returned" }, { "name": "message_pins", "type": "Bool", - "description": "True, if pin/unpin events should be returned" + "description": "True, if pin/unpin events need to be returned" }, { "name": "member_joins", "type": "Bool", - "description": "True, if members joining events should be returned" + "description": "True, if members joining events need to be returned" }, { "name": "member_leaves", "type": "Bool", - "description": "True, if members leaving events should be returned" + "description": "True, if members leaving events need to be returned" }, { "name": "member_invites", "type": "Bool", - "description": "True, if invited member events should be returned" + "description": "True, if invited member events need to be returned" }, { "name": "member_promotions", "type": "Bool", - "description": "True, if member promotion/demotion events should be returned" + "description": "True, if member promotion/demotion events need to be returned" }, { "name": "member_restrictions", "type": "Bool", - "description": "True, if member restricted/unrestricted/banned/unbanned events should be returned" + "description": "True, if member restricted/unrestricted/banned/unbanned events need to be returned" }, { "name": "info_changes", "type": "Bool", - "description": "True, if changes in chat information should be returned" + "description": "True, if changes in chat information need to be returned" }, { "name": "setting_changes", "type": "Bool", - "description": "True, if changes in chat settings should be returned" + "description": "True, if changes in chat settings need to be returned" + }, + { + "name": "invite_link_changes", + "type": "Bool", + "description": "True, if changes to invite links need to be returned" + }, + { + "name": "video_chat_changes", + "type": "Bool", + "description": "True, if video chat actions need to be returned" } ] }, @@ -10219,7 +11472,7 @@ }, { "name": "languagePackStringValueDeleted", - "description": "A deleted language pack string, the value should be taken from the built-in english language pack", + "description": "A deleted language pack string, the value must be taken from the built-in English language pack", "class": "LanguagePackStringValue", "properties": [] }, @@ -10236,7 +11489,7 @@ { "name": "value", "type": "LanguagePackStringValue", - "description": "String value" + "description": "String value; pass null if the string needs to be taken from the built-in English language pack" } ] }, @@ -10265,7 +11518,7 @@ { "name": "base_language_pack_id", "type": "string", - "description": "Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it should be fetched from base language pack. Unsupported in custom language packs" + "description": "Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs" }, { "name": "name", @@ -10344,12 +11597,12 @@ { "name": "token", "type": "string", - "description": "Device registration token; may be empty to de-register a device" + "description": "Device registration token; may be empty to deregister a device" }, { "name": "encrypt", "type": "Bool", - "description": "True, if push notifications should be additionally encrypted" + "description": "True, if push notifications must be additionally encrypted" } ] }, @@ -10361,7 +11614,7 @@ { "name": "device_token", "type": "string", - "description": "Device token; may be empty to de-register a device" + "description": "Device token; may be empty to deregister a device" }, { "name": "is_app_sandbox", @@ -10378,7 +11631,7 @@ { "name": "device_token", "type": "string", - "description": "Device token; may be empty to de-register a device" + "description": "Device token; may be empty to deregister a device" }, { "name": "is_app_sandbox", @@ -10388,7 +11641,7 @@ { "name": "encrypt", "type": "Bool", - "description": "True, if push notifications should be additionally encrypted" + "description": "True, if push notifications must be additionally encrypted" } ] }, @@ -10400,7 +11653,7 @@ { "name": "access_token", "type": "string", - "description": "The access token that will be used to send notifications; may be empty to de-register a device" + "description": "The access token that will be used to send notifications; may be empty to deregister a device" } ] }, @@ -10412,7 +11665,7 @@ { "name": "channel_uri", "type": "string", - "description": "Push notification channel URI; may be empty to de-register a device" + "description": "Push notification channel URI; may be empty to deregister a device" } ] }, @@ -10424,7 +11677,7 @@ { "name": "channel_uri", "type": "string", - "description": "Push notification channel URI; may be empty to de-register a device" + "description": "Push notification channel URI; may be empty to deregister a device" } ] }, @@ -10436,7 +11689,7 @@ { "name": "endpoint", "type": "string", - "description": "Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device" + "description": "Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device" }, { "name": "p256dh_base64url", @@ -10458,7 +11711,7 @@ { "name": "endpoint", "type": "string", - "description": "Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device" + "description": "Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device" } ] }, @@ -10470,7 +11723,7 @@ { "name": "token", "type": "string", - "description": "Token; may be empty to de-register a device" + "description": "Token; may be empty to deregister a device" } ] }, @@ -10482,7 +11735,7 @@ { "name": "token", "type": "string", - "description": "Token; may be empty to de-register a device" + "description": "Token; may be empty to deregister a device" } ] }, @@ -10494,7 +11747,7 @@ { "name": "reg_id", "type": "string", - "description": "Push service registration identifier; may be empty to de-register a device" + "description": "Push service registration identifier; may be empty to deregister a device" } ] }, @@ -10540,7 +11793,19 @@ { "name": "rotation_angle", "type": "int32", - "description": "Clockwise rotation angle of the gradient, in degrees; 0-359. Should be always divisible by 45" + "description": "Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45" + } + ] + }, + { + "name": "backgroundFillFreeformGradient", + "description": "Describes a freeform gradient fill of a background", + "class": "BackgroundFill", + "properties": [ + { + "name": "colors", + "type": "vector\u003cint32\u003e", + "description": "A list of 3 or 4 colors of the freeform gradients in the RGB24 format" } ] }, @@ -10569,12 +11834,17 @@ { "name": "fill", "type": "BackgroundFill", - "description": "Description of the background fill" + "description": "Fill of the background" }, { "name": "intensity", "type": "int32", - "description": "Intensity of the pattern when it is shown above the filled background, 0-100" + "description": "Intensity of the pattern when it is shown above the filled background; 0-100." + }, + { + "name": "is_inverted", + "type": "Bool", + "description": "True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only" }, { "name": "is_moving", @@ -10591,7 +11861,7 @@ { "name": "fill", "type": "BackgroundFill", - "description": "Description of the background fill" + "description": "The background fill" } ] }, @@ -10668,6 +11938,60 @@ } ] }, + { + "name": "themeSettings", + "description": "Describes theme settings", + "class": "ThemeSettings", + "properties": [ + { + "name": "accent_color", + "type": "int32", + "description": "Theme accent color in ARGB format" + }, + { + "name": "background", + "type": "background", + "description": "The background to be used in chats; may be null" + }, + { + "name": "outgoing_message_fill", + "type": "BackgroundFill", + "description": "The fill to be used as a background for outgoing messages" + }, + { + "name": "animate_outgoing_message_fill", + "type": "Bool", + "description": "If true, the freeform gradient fill needs to be animated on every sent message" + }, + { + "name": "outgoing_message_accent_color", + "type": "int32", + "description": "Accent color of outgoing messages in ARGB format" + } + ] + }, + { + "name": "chatTheme", + "description": "Describes a chat theme", + "class": "ChatTheme", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Theme name" + }, + { + "name": "light_settings", + "type": "themeSettings", + "description": "Theme settings for a light chat theme" + }, + { + "name": "dark_settings", + "type": "themeSettings", + "description": "Theme settings for a dark chat theme" + } + ] + }, { "name": "hashtags", "description": "Contains a list of hashtags", @@ -10736,7 +12060,7 @@ }, { "name": "checkChatUsernameResultPublicChatsTooMuch", - "description": "The user has too much chats with username, one of them should be made private first", + "description": "The user has too much chats with username, one of them must be made private first", "class": "CheckChatUsernameResult", "properties": [] }, @@ -10746,6 +12070,84 @@ "class": "CheckChatUsernameResult", "properties": [] }, + { + "name": "checkStickerSetNameResultOk", + "description": "The name can be set", + "class": "CheckStickerSetNameResult", + "properties": [] + }, + { + "name": "checkStickerSetNameResultNameInvalid", + "description": "The name is invalid", + "class": "CheckStickerSetNameResult", + "properties": [] + }, + { + "name": "checkStickerSetNameResultNameOccupied", + "description": "The name is occupied", + "class": "CheckStickerSetNameResult", + "properties": [] + }, + { + "name": "resetPasswordResultOk", + "description": "The password was reset", + "class": "ResetPasswordResult", + "properties": [] + }, + { + "name": "resetPasswordResultPending", + "description": "The password reset request is pending", + "class": "ResetPasswordResult", + "properties": [ + { + "name": "pending_reset_date", + "type": "int32", + "description": "Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword" + } + ] + }, + { + "name": "resetPasswordResultDeclined", + "description": "The password reset request was declined", + "class": "ResetPasswordResult", + "properties": [ + { + "name": "retry_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the password reset can be retried" + } + ] + }, + { + "name": "messageFileTypePrivate", + "description": "The messages was exported from a private chat", + "class": "MessageFileType", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Name of the other party; may be empty if unrecognized" + } + ] + }, + { + "name": "messageFileTypeGroup", + "description": "The messages was exported from a group chat", + "class": "MessageFileType", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Title of the group chat; may be empty if unrecognized" + } + ] + }, + { + "name": "messageFileTypeUnknown", + "description": "The messages was exported from a chat of unknown type", + "class": "MessageFileType", + "properties": [] + }, { "name": "pushMessageContentHidden", "description": "A general message with hidden content", @@ -11089,7 +12491,7 @@ { "name": "is_returned", "type": "Bool", - "description": "True, if the user has returned to the group themself" + "description": "True, if the user has returned to the group themselves" } ] }, @@ -11111,6 +12513,18 @@ } ] }, + { + "name": "pushMessageContentChatSetTheme", + "description": "A chat theme was edited", + "class": "PushMessageContent", + "properties": [ + { + "name": "theme_name", + "type": "string", + "description": "If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one" + } + ] + }, { "name": "pushMessageContentChatDeleteMember", "description": "A chat member was deleted", @@ -11129,13 +12543,19 @@ { "name": "is_left", "type": "Bool", - "description": "True, if the user has left the group themself" + "description": "True, if the user has left the group themselves" } ] }, { "name": "pushMessageContentChatJoinByLink", - "description": "A new member joined the chat by invite link", + "description": "A new member joined the chat via an invite link", + "class": "PushMessageContent", + "properties": [] + }, + { + "name": "pushMessageContentChatJoinByRequest", + "description": "A new member was accepted to the chat by an administrator", "class": "PushMessageContent", "properties": [] }, @@ -11224,9 +12644,9 @@ "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", + "name": "sender_id", "type": "MessageSender", - "description": "The sender of the message. Corresponding user or chat may be inaccessible" + "description": "Identifier of the sender of the message. Corresponding user or chat may be inaccessible" }, { "name": "sender_name", @@ -11472,7 +12892,7 @@ "properties": [ { "name": "user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "The user identifiers, total number of users in all rules must not exceed 1000" } ] @@ -11508,7 +12928,7 @@ "properties": [ { "name": "user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "The user identifiers, total number of users in all rules must not exceed 1000" } ] @@ -11593,13 +13013,13 @@ { "name": "days", "type": "int32", - "description": "Number of days of inactivity before the account will be flagged for deletion; should range from 30-366 days" + "description": "Number of days of inactivity before the account will be flagged for deletion; 30-366 days" } ] }, { "name": "session", - "description": "Contains information about one session in a Telegram application used by the current user. Sessions should be shown to the user in the returned order", + "description": "Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order", "class": "Session", "properties": [ { @@ -11617,6 +13037,16 @@ "type": "Bool", "description": "True, if a password is needed to complete authorization of the session" }, + { + "name": "can_accept_secret_chats", + "type": "Bool", + "description": "True, if incoming secret chats can be accepted by the session" + }, + { + "name": "can_accept_calls", + "type": "Bool", + "description": "True, if incoming calls can be accepted by the session" + }, { "name": "api_id", "type": "int32", @@ -11688,6 +13118,11 @@ "name": "sessions", "type": "vector\u003csession\u003e", "description": "List of sessions" + }, + { + "name": "inactive_session_ttl_days", + "type": "int32", + "description": "Number of days of inactivity before sessions will automatically be terminated; 1-366 days" } ] }, @@ -11708,7 +13143,7 @@ }, { "name": "bot_user_id", - "type": "int32", + "type": "int53", "description": "User identifier of a bot linked with the website" }, { @@ -11791,15 +13226,326 @@ "class": "ChatReportReason", "properties": [] }, + { + "name": "chatReportReasonFake", + "description": "The chat represents a fake account", + "class": "ChatReportReason", + "properties": [] + }, { "name": "chatReportReasonCustom", "description": "A custom reason provided by the user", "class": "ChatReportReason", + "properties": [] + }, + { + "name": "internalLinkTypeActiveSessions", + "description": "The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link", + "class": "InternalLinkType", + "properties": [] + }, + { + "name": "internalLinkTypeAuthenticationCode", + "description": "The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode", + "class": "InternalLinkType", + "properties": [ + { + "name": "code", + "type": "string", + "description": "The authentication code" + } + ] + }, + { + "name": "internalLinkTypeBackground", + "description": "The link is a link to a background. Call searchBackground with the given background name to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "background_name", + "type": "string", + "description": "Name of the background" + } + ] + }, + { + "name": "internalLinkTypeBotStart", + "description": "The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "start_parameter", + "type": "string", + "description": "The parameter to be passed to sendBotStartMessage" + } + ] + }, + { + "name": "internalLinkTypeBotStartInGroup", + "description": "The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "start_parameter", + "type": "string", + "description": "The parameter to be passed to sendBotStartMessage" + } + ] + }, + { + "name": "internalLinkTypeChangePhoneNumber", + "description": "The link is a link to the change phone number section of the app", + "class": "InternalLinkType", + "properties": [] + }, + { + "name": "internalLinkTypeChatInvite", + "description": "The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "invite_link", + "type": "string", + "description": "Internal representation of the invite link" + } + ] + }, + { + "name": "internalLinkTypeFilterSettings", + "description": "The link is a link to the filter settings section of the app", + "class": "InternalLinkType", + "properties": [] + }, + { + "name": "internalLinkTypeGame", + "description": "The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot that owns the game" + }, + { + "name": "game_short_name", + "type": "string", + "description": "Short name of the game" + } + ] + }, + { + "name": "internalLinkTypeLanguagePack", + "description": "The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "language_pack_id", + "type": "string", + "description": "Language pack identifier" + } + ] + }, + { + "name": "internalLinkTypeMessage", + "description": "The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "URL to be passed to getMessageLinkInfo" + } + ] + }, + { + "name": "internalLinkTypeMessageDraft", + "description": "The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field", + "class": "InternalLinkType", "properties": [ { "name": "text", + "type": "formattedText", + "description": "Message draft text" + }, + { + "name": "contains_link", + "type": "Bool", + "description": "True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected" + } + ] + }, + { + "name": "internalLinkTypePassportDataRequest", + "description": "The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the app, otherwise ignore it", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "User identifier of the service's bot" + }, + { + "name": "scope", "type": "string", - "description": "Report text" + "description": "Telegram Passport element types requested by the service" + }, + { + "name": "public_key", + "type": "string", + "description": "Service's public key" + }, + { + "name": "nonce", + "type": "string", + "description": "Unique request identifier provided by the service" + }, + { + "name": "callback_url", + "type": "string", + "description": "An HTTP URL to open once the request is finished or canceled with the parameter tg_passport=success or tg_passport=cancel respectively. If empty, then the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel needs to be opened instead" + } + ] + }, + { + "name": "internalLinkTypePhoneNumberConfirmation", + "description": "The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "hash", + "type": "string", + "description": "Hash value from the link" + }, + { + "name": "phone_number", + "type": "string", + "description": "Phone number value from the link" + } + ] + }, + { + "name": "internalLinkTypeProxy", + "description": "The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy", + "class": "InternalLinkType", + "properties": [ + { + "name": "server", + "type": "string", + "description": "Proxy server IP address" + }, + { + "name": "port", + "type": "int32", + "description": "Proxy server port" + }, + { + "name": "type", + "type": "ProxyType", + "description": "Type of the proxy" + } + ] + }, + { + "name": "internalLinkTypePublicChat", + "description": "The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "chat_username", + "type": "string", + "description": "Username of the chat" + } + ] + }, + { + "name": "internalLinkTypeQrCodeAuthentication", + "description": "The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to \"This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings \u003e Devices \u003e Scan QR and scan the code\" needs to be shown", + "class": "InternalLinkType", + "properties": [] + }, + { + "name": "internalLinkTypeSettings", + "description": "The link is a link to app settings", + "class": "InternalLinkType", + "properties": [] + }, + { + "name": "internalLinkTypeStickerSet", + "description": "The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set", + "class": "InternalLinkType", + "properties": [ + { + "name": "sticker_set_name", + "type": "string", + "description": "Name of the sticker set" + } + ] + }, + { + "name": "internalLinkTypeTheme", + "description": "The link is a link to a theme. TDLib has no theme support yet", + "class": "InternalLinkType", + "properties": [ + { + "name": "theme_name", + "type": "string", + "description": "Name of the theme" + } + ] + }, + { + "name": "internalLinkTypeThemeSettings", + "description": "The link is a link to the theme settings section of the app", + "class": "InternalLinkType", + "properties": [] + }, + { + "name": "internalLinkTypeUnknownDeepLink", + "description": "The link is an unknown tg: link. Call getDeepLinkInfo to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "link", + "type": "string", + "description": "Link to be passed to getDeepLinkInfo" + } + ] + }, + { + "name": "internalLinkTypeUnsupportedProxy", + "description": "The link is a link to an unsupported proxy. An alert can be shown to the user", + "class": "InternalLinkType", + "properties": [] + }, + { + "name": "internalLinkTypeVideoChat", + "description": "The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "chat_username", + "type": "string", + "description": "Username of the chat with the video chat" + }, + { + "name": "invite_hash", + "type": "string", + "description": "If non-empty, invite hash to be used to join the video chat without being muted by administrators" + }, + { + "name": "is_live_stream", + "type": "Bool", + "description": "True, if the video chat is expected to be a live stream in a channel or a broadcast group" } ] }, @@ -11840,6 +13586,11 @@ "type": "message", "description": "If found, the linked message; may be null" }, + { + "name": "media_timestamp", + "type": "int32", + "description": "Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview" + }, { "name": "for_album", "type": "Bool", @@ -11973,7 +13724,7 @@ { "name": "size", "type": "int53", - "description": "Total size of the files" + "description": "Total size of the files, in bytes" }, { "name": "count", @@ -11995,7 +13746,7 @@ { "name": "size", "type": "int53", - "description": "Total size of the files in the chat" + "description": "Total size of the files in the chat, in bytes" }, { "name": "count", @@ -12017,7 +13768,7 @@ { "name": "size", "type": "int53", - "description": "Total size of files" + "description": "Total size of files, in bytes" }, { "name": "count", @@ -12039,7 +13790,7 @@ { "name": "files_size", "type": "int53", - "description": "Approximate total size of files" + "description": "Approximate total size of files, in bytes" }, { "name": "file_count", @@ -12113,7 +13864,7 @@ { "name": "file_type", "type": "FileType", - "description": "Type of the file the data is part of" + "description": "Type of the file the data is part of; pass null if the data isn't related to files" }, { "name": "network_type", @@ -12189,22 +13940,22 @@ { "name": "max_photo_file_size", "type": "int32", - "description": "The maximum size of a photo file to be auto-downloaded" + "description": "The maximum size of a photo file to be auto-downloaded, in bytes" }, { "name": "max_video_file_size", "type": "int32", - "description": "The maximum size of a video file to be auto-downloaded" + "description": "The maximum size of a video file to be auto-downloaded, in bytes" }, { "name": "max_other_file_size", "type": "int32", - "description": "The maximum size of other file types to be auto-downloaded" + "description": "The maximum size of other file types to be auto-downloaded, in bytes" }, { "name": "video_upload_bitrate", "type": "int32", - "description": "The maximum suggested bitrate for uploaded videos" + "description": "The maximum suggested bitrate for uploaded videos, in kbit/s" }, { "name": "preload_large_videos", @@ -12225,7 +13976,7 @@ }, { "name": "autoDownloadSettingsPresets", - "description": "Contains auto-download settings presets for the user", + "description": "Contains auto-download settings presets for the current user", "class": "AutoDownloadSettingsPresets", "properties": [ { @@ -12324,7 +14075,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user" } ] @@ -12401,11 +14152,47 @@ "properties": [] }, { - "name": "suggestedActionCheckPhoneNumber", - "description": "Suggests the user to check authorization phone number and change the phone number if it is inaccessible", + "name": "suggestedActionCheckPassword", + "description": "Suggests the user to check whether they still remember their 2-step verification password", "class": "SuggestedAction", "properties": [] }, + { + "name": "suggestedActionCheckPhoneNumber", + "description": "Suggests the user to check whether authorization phone number is correct and change the phone number if it is inaccessible", + "class": "SuggestedAction", + "properties": [] + }, + { + "name": "suggestedActionViewChecksHint", + "description": "Suggests the user to view a hint about the meaning of one and two check marks on sent messages", + "class": "SuggestedAction", + "properties": [] + }, + { + "name": "suggestedActionConvertToBroadcastGroup", + "description": "Suggests the user to convert specified supergroup to a broadcast group", + "class": "SuggestedAction", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Supergroup identifier" + } + ] + }, + { + "name": "suggestedActionSetPassword", + "description": "Suggests the user to set a 2-step verification password to be able to log in again", + "class": "SuggestedAction", + "properties": [ + { + "name": "authorization_delay", + "type": "int32", + "description": "The number of days to pass between consecutive authorizations if the user declines to set password" + } + ] + }, { "name": "count", "description": "Contains a counter", @@ -12444,7 +14231,7 @@ }, { "name": "deepLinkInfo", - "description": "Contains information about a tg:// deep link", + "description": "Contains information about a tg: deep link", "class": "DeepLinkInfo", "properties": [ { @@ -12455,7 +14242,7 @@ { "name": "need_update_application", "type": "Bool", - "description": "True, if user should be asked to update the application" + "description": "True, if the user must be asked to update the application" } ] }, @@ -12595,7 +14382,7 @@ { "name": "mask_position", "type": "maskPosition", - "description": "For masks, position where the mask should be placed; may be null" + "description": "For masks, position where the mask is placed; pass null if unspecified" } ] }, @@ -12725,7 +14512,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -12736,7 +14523,7 @@ { "name": "average_character_count", "type": "int32", - "description": "Average number of characters in sent messages" + "description": "Average number of characters in sent messages; 0 if unknown" } ] }, @@ -12747,7 +14534,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Administrator user identifier" }, { @@ -12774,7 +14561,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -12965,6 +14752,122 @@ } ] }, + { + "name": "point", + "description": "A point on a Cartesian plane", + "class": "Point", + "properties": [ + { + "name": "x", + "type": "double", + "description": "The point's first coordinate" + }, + { + "name": "y", + "type": "double", + "description": "The point's second coordinate" + } + ] + }, + { + "name": "vectorPathCommandLine", + "description": "A straight line to a given point", + "class": "VectorPathCommand", + "properties": [ + { + "name": "end_point", + "type": "point", + "description": "The end point of the straight line" + } + ] + }, + { + "name": "vectorPathCommandCubicBezierCurve", + "description": "A cubic Bézier curve to a given point", + "class": "VectorPathCommand", + "properties": [ + { + "name": "start_control_point", + "type": "point", + "description": "The start control point of the curve" + }, + { + "name": "end_control_point", + "type": "point", + "description": "The end control point of the curve" + }, + { + "name": "end_point", + "type": "point", + "description": "The end point of the curve" + } + ] + }, + { + "name": "botCommandScopeDefault", + "description": "A scope covering all users", + "class": "BotCommandScope", + "properties": [] + }, + { + "name": "botCommandScopeAllPrivateChats", + "description": "A scope covering all private chats", + "class": "BotCommandScope", + "properties": [] + }, + { + "name": "botCommandScopeAllGroupChats", + "description": "A scope covering all group and supergroup chats", + "class": "BotCommandScope", + "properties": [] + }, + { + "name": "botCommandScopeAllChatAdministrators", + "description": "A scope covering all group and supergroup chat administrators", + "class": "BotCommandScope", + "properties": [] + }, + { + "name": "botCommandScopeChat", + "description": "A scope covering all members of a chat", + "class": "BotCommandScope", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ] + }, + { + "name": "botCommandScopeChatAdministrators", + "description": "A scope covering all administrators of a chat", + "class": "BotCommandScope", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ] + }, + { + "name": "botCommandScopeChatMember", + "description": "A scope covering a member of a chat", + "class": "BotCommandScope", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + } + ] + }, { "name": "updateAuthorizationState", "description": "The user authorization state has changed", @@ -13014,7 +14917,7 @@ { "name": "message", "type": "message", - "description": "Information about the sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change" + "description": "The sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change" }, { "name": "old_message_id", @@ -13031,7 +14934,7 @@ { "name": "message", "type": "message", - "description": "Contains information about the message which failed to send" + "description": "The failed to send message" }, { "name": "old_message_id", @@ -13301,77 +15204,9 @@ } ] }, - { - "name": "updateChatIsMarkedAsUnread", - "description": "A chat was marked as unread or was read", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "is_marked_as_unread", - "type": "Bool", - "description": "New value of is_marked_as_unread" - } - ] - }, - { - "name": "updateChatIsBlocked", - "description": "A chat was blocked or unblocked", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "is_blocked", - "type": "Bool", - "description": "New value of is_blocked" - } - ] - }, - { - "name": "updateChatHasScheduledMessages", - "description": "A chat's has_scheduled_messages field has changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "has_scheduled_messages", - "type": "Bool", - "description": "New value of has_scheduled_messages" - } - ] - }, - { - "name": "updateChatDefaultDisableNotification", - "description": "The value of the default disable_notification parameter, used when a message is sent to the chat, was changed", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "default_disable_notification", - "type": "Bool", - "description": "The new default_disable_notification value" - } - ] - }, { "name": "updateChatReadInbox", - "description": "Incoming messages were read or number of unread messages has been changed", + "description": "Incoming messages were read or the number of unread messages has been changed", "class": "Update", "properties": [ { @@ -13409,8 +15244,8 @@ ] }, { - "name": "updateChatUnreadMentionCount", - "description": "The chat unread_mention_count has changed", + "name": "updateChatActionBar", + "description": "The chat action bar was changed", "class": "Update", "properties": [ { @@ -13419,9 +15254,65 @@ "description": "Chat identifier" }, { - "name": "unread_mention_count", + "name": "action_bar", + "type": "ChatActionBar", + "description": "The new value of the action bar; may be null" + } + ] + }, + { + "name": "updateChatDraftMessage", + "description": "A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "draft_message", + "type": "draftMessage", + "description": "The new draft message; may be null" + }, + { + "name": "positions", + "type": "vector\u003cchatPosition\u003e", + "description": "The new chat positions in the chat lists" + } + ] + }, + { + "name": "updateChatMessageSender", + "description": "The message sender that is selected to send messages in a chat has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_sender_id", + "type": "MessageSender", + "description": "New value of message_sender_id; may be null if the user can't change message sender" + } + ] + }, + { + "name": "updateChatMessageTtl", + "description": "The message Time To Live setting for a chat was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_ttl", "type": "int32", - "description": "The number of unread mention messages left in the chat" + "description": "New value of message_ttl" } ] }, @@ -13443,25 +15334,8 @@ ] }, { - "name": "updateScopeNotificationSettings", - "description": "Notification settings for some type of chats were updated", - "class": "Update", - "properties": [ - { - "name": "scope", - "type": "NotificationSettingsScope", - "description": "Types of chats for which notification settings were updated" - }, - { - "name": "notification_settings", - "type": "scopeNotificationSettings", - "description": "The new notification settings" - } - ] - }, - { - "name": "updateChatActionBar", - "description": "The chat action bar was changed", + "name": "updateChatPendingJoinRequests", + "description": "The chat pending join requests were changed", "class": "Update", "properties": [ { @@ -13470,9 +15344,9 @@ "description": "Chat identifier" }, { - "name": "action_bar", - "type": "ChatActionBar", - "description": "The new value of the action bar; may be null" + "name": "pending_join_requests", + "type": "chatJoinRequestsInfo", + "description": "The new data about pending join requests; may be null" } ] }, @@ -13494,8 +15368,8 @@ ] }, { - "name": "updateChatDraftMessage", - "description": "A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update shouldn't be applied", + "name": "updateChatTheme", + "description": "The chat theme was changed", "class": "Update", "properties": [ { @@ -13504,14 +15378,128 @@ "description": "Chat identifier" }, { - "name": "draft_message", - "type": "draftMessage", - "description": "The new draft message; may be null" + "name": "theme_name", + "type": "string", + "description": "The new name of the chat theme; may be empty if theme was reset to default" + } + ] + }, + { + "name": "updateChatUnreadMentionCount", + "description": "The chat unread_mention_count has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" }, { - "name": "positions", - "type": "vector\u003cchatPosition\u003e", - "description": "The new chat positions in the chat lists" + "name": "unread_mention_count", + "type": "int32", + "description": "The number of unread mention messages left in the chat" + } + ] + }, + { + "name": "updateChatVideoChat", + "description": "A chat video chat state has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "video_chat", + "type": "videoChat", + "description": "New value of video_chat" + } + ] + }, + { + "name": "updateChatDefaultDisableNotification", + "description": "The value of the default disable_notification parameter, used when a message is sent to the chat, was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "default_disable_notification", + "type": "Bool", + "description": "The new default_disable_notification value" + } + ] + }, + { + "name": "updateChatHasProtectedContent", + "description": "A chat content was allowed or restricted for saving", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "has_protected_content", + "type": "Bool", + "description": "New value of has_protected_content" + } + ] + }, + { + "name": "updateChatHasScheduledMessages", + "description": "A chat's has_scheduled_messages field has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "has_scheduled_messages", + "type": "Bool", + "description": "New value of has_scheduled_messages" + } + ] + }, + { + "name": "updateChatIsBlocked", + "description": "A chat was blocked or unblocked", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "is_blocked", + "type": "Bool", + "description": "New value of is_blocked" + } + ] + }, + { + "name": "updateChatIsMarkedAsUnread", + "description": "A chat was marked as unread or was read", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "is_marked_as_unread", + "type": "Bool", + "description": "New value of is_marked_as_unread" } ] }, @@ -13544,6 +15532,23 @@ } ] }, + { + "name": "updateScopeNotificationSettings", + "description": "Notification settings for some type of chats were updated", + "class": "Update", + "properties": [ + { + "name": "scope", + "type": "NotificationSettingsScope", + "description": "Types of chats for which notification settings were updated" + }, + { + "name": "notification_settings", + "type": "scopeNotificationSettings", + "description": "The new notification settings" + } + ] + }, { "name": "updateNotification", "description": "A notification was changed", @@ -13589,7 +15594,7 @@ { "name": "is_silent", "type": "Bool", - "description": "True, if the notifications should be shown without sound" + "description": "True, if the notifications must be shown without sound" }, { "name": "total_count", @@ -13665,8 +15670,8 @@ ] }, { - "name": "updateUserChatAction", - "description": "User activity in the chat has changed", + "name": "updateChatAction", + "description": "A message sender activity in the chat has changed", "class": "Update", "properties": [ { @@ -13680,14 +15685,14 @@ "description": "If not 0, a message thread identifier in which the action was performed" }, { - "name": "user_id", - "type": "int32", - "description": "Identifier of a user performing an action" + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of a message sender performing the action" }, { "name": "action", "type": "ChatAction", - "description": "The action description" + "description": "The action" } ] }, @@ -13698,7 +15703,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -13758,12 +15763,12 @@ }, { "name": "updateUserFullInfo", - "description": "Some data from userFullInfo has been changed", + "description": "Some data in userFullInfo has been changed", "class": "Update", "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -13775,12 +15780,12 @@ }, { "name": "updateBasicGroupFullInfo", - "description": "Some data from basicGroupFullInfo has been changed", + "description": "Some data in basicGroupFullInfo has been changed", "class": "Update", "properties": [ { "name": "basic_group_id", - "type": "int32", + "type": "int53", "description": "Identifier of a basic group" }, { @@ -13792,12 +15797,12 @@ }, { "name": "updateSupergroupFullInfo", - "description": "Some data from supergroupFullInfo has been changed", + "description": "Some data in supergroupFullInfo has been changed", "class": "Update", "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "Identifier of the supergroup or channel" }, { @@ -13809,13 +15814,13 @@ }, { "name": "updateServiceNotification", - "description": "Service notification from the server. Upon receiving this the application must show a popup with the content of the notification", + "description": "A service notification from the server was received. Upon receiving this the application must show a popup with the content of the notification", "class": "Update", "properties": [ { "name": "type", "type": "string", - "description": "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" + "description": "Notification type. If type begins with \"AUTH_KEY_DROP_\", then two buttons \"Cancel\" and \"Log out\" must be shown under notification; if user presses the second, all local data must be destroyed using Destroy method" }, { "name": "content", @@ -13854,12 +15859,12 @@ { "name": "destination_path", "type": "string", - "description": "The path to a file that should be created and where the new file should be generated" + "description": "The path to a file that must be created and where the new file is generated" }, { "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 application" + "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 must be downloaded by the application" } ] }, @@ -13887,6 +15892,35 @@ } ] }, + { + "name": "updateGroupCall", + "description": "Information about a group call was updated", + "class": "Update", + "properties": [ + { + "name": "group_call", + "type": "groupCall", + "description": "New data about a group call" + } + ] + }, + { + "name": "updateGroupCallParticipant", + "description": "Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined", + "class": "Update", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Identifier of group call" + }, + { + "name": "participant", + "type": "groupCallParticipant", + "description": "New data about a participant" + } + ] + }, { "name": "updateNewCallSignalingData", "description": "New call signaling data arrived", @@ -14096,6 +16130,18 @@ } ] }, + { + "name": "updateChatThemes", + "description": "The list of available chat themes has changed", + "class": "Update", + "properties": [ + { + "name": "chat_themes", + "type": "vector\u003cchatTheme\u003e", + "description": "The new list of chat themes" + } + ] + }, { "name": "updateLanguagePackStrings", "description": "Some language pack strings have been updated", @@ -14132,7 +16178,7 @@ }, { "name": "updateTermsOfService", - "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\"", + "description": "New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason \"Decline ToS update\"", "class": "Update", "properties": [ { @@ -14171,6 +16217,28 @@ } ] }, + { + "name": "updateAnimatedEmojiMessageClicked", + "description": "Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "sticker", + "type": "sticker", + "description": "The animated sticker to be played" + } + ] + }, { "name": "updateAnimationSearchParameters", "description": "The parameters of animation search through GetOption(\"animation_search_bot_username\") bot has changed", @@ -14217,7 +16285,7 @@ }, { "name": "sender_user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user who sent the query" }, { @@ -14225,6 +16293,11 @@ "type": "location", "description": "User location; may be null" }, + { + "name": "chat_type", + "type": "ChatType", + "description": "The type of the chat, from which the query originated; may be null if unknown" + }, { "name": "query", "type": "string", @@ -14244,7 +16317,7 @@ "properties": [ { "name": "sender_user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user who sent the query" }, { @@ -14281,7 +16354,7 @@ }, { "name": "sender_user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user who sent the query" }, { @@ -14318,7 +16391,7 @@ }, { "name": "sender_user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user who sent the query" }, { @@ -14350,7 +16423,7 @@ }, { "name": "sender_user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user who sent the query" }, { @@ -14377,7 +16450,7 @@ }, { "name": "sender_user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user who sent the query" }, { @@ -14388,7 +16461,7 @@ { "name": "total_amount", "type": "int53", - "description": "Total price for the product, in the minimal quantity of the currency" + "description": "Total price for the product, in the smallest units of the currency" }, { "name": "invoice_payload", @@ -14465,7 +16538,7 @@ }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "The user, who changed the answer to the poll" }, { @@ -14475,6 +16548,65 @@ } ] }, + { + "name": "updateChatMember", + "description": "User rights changed in a chat; for bots only", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "actor_user_id", + "type": "int53", + "description": "Identifier of the user, changing the rights" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the user rights was changed" + }, + { + "name": "invite_link", + "type": "chatInviteLink", + "description": "If user has joined the chat using an invite link, the invite link; may be null" + }, + { + "name": "old_chat_member", + "type": "chatMember", + "description": "Previous chat member" + }, + { + "name": "new_chat_member", + "type": "chatMember", + "description": "New chat member" + } + ] + }, + { + "name": "updateNewChatJoinRequest", + "description": "A user sent a join request to a chat; for bots only", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "request", + "type": "chatJoinRequest", + "description": "Join request" + }, + { + "name": "invite_link", + "type": "chatInviteLink", + "description": "The invite link, which was used to send join request; may be null" + } + ] + }, { "name": "updates", "description": "Contains a list of updates", @@ -14506,7 +16638,7 @@ { "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" + "description": "The maximum size of the file to where the internal TDLib log is written before the file will automatically be rotated, in bytes" }, { "name": "redirect_stderr", @@ -14649,7 +16781,7 @@ }, { "name": "MaskPoint", - "description": "Part of the face, relative to which a mask should be placed" + "description": "Part of the face, relative to which a mask is placed" }, { "name": "PollType", @@ -14693,7 +16825,7 @@ }, { "name": "NotificationSettingsScope", - "description": "Describes the types of chats to which notification settings are applied" + "description": "Describes the types of chats to which notification settings are relevant" }, { "name": "ChatType", @@ -14713,7 +16845,7 @@ }, { "name": "ChatActionBar", - "description": "Describes actions which should be possible to do through a chat action bar" + "description": "Describes actions which must be possible to do through a chat action bar" }, { "name": "KeyboardButtonType", @@ -14811,13 +16943,17 @@ "name": "CallState", "description": "Describes the current call state" }, + { + "name": "GroupCallVideoQuality", + "description": "Describes the quality of a group call video" + }, { "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" + "description": "Contains animated stickers which must be used for dice animation rendering" }, { "name": "InputInlineQueryResult", @@ -14863,6 +16999,18 @@ "name": "CheckChatUsernameResult", "description": "Represents result of checking whether a username can be set for a chat" }, + { + "name": "CheckStickerSetNameResult", + "description": "Represents result of checking whether a name can be used for a new sticker set" + }, + { + "name": "ResetPasswordResult", + "description": "Represents result of 2-step verification password reset" + }, + { + "name": "MessageFileType", + "description": "Contains information about a file with messages exported from another app" + }, { "name": "PushMessageContent", "description": "Contains content of a push message notification" @@ -14895,6 +17043,10 @@ "name": "ChatReportReason", "description": "Describes the reason why a chat is reported" }, + { + "name": "InternalLinkType", + "description": "Describes an internal https://t.me or tg: link, which must be processed by the app in a special way" + }, { "name": "FileType", "description": "Represents the type of a file" @@ -14925,7 +17077,7 @@ }, { "name": "TextParseMode", - "description": "Describes the way the text should be parsed for TextEntities" + "description": "Describes the way the text needs to be parsed for TextEntities" }, { "name": "ProxyType", @@ -14943,6 +17095,14 @@ "name": "ChatStatistics", "description": "Contains a detailed statistics about a chat" }, + { + "name": "VectorPathCommand", + "description": "Represents a vector path command" + }, + { + "name": "BotCommandScope", + "description": "Represents the scope to which bot commands are relevant" + }, { "name": "Update", "description": "Contains notifications about data changes" @@ -14969,7 +17129,7 @@ { "name": "parameters", "type": "tdlibParameters", - "description": "Parameters" + "description": "Parameters for TDLib initialization" } ], "is_synchronous": false, @@ -15002,7 +17162,7 @@ { "name": "settings", "type": "phoneNumberAuthenticationSettings", - "description": "Settings for the authentication of the user's phone number" + "description": "Settings for the authentication of the user's phone number; pass null to use default settings" } ], "is_synchronous": false, @@ -15010,7 +17170,7 @@ }, { "name": "resendAuthenticationCode", - "description": "Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode and the next_code_type of the result is not null", + "description": "Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed", "class": "Ok", "properties": [], "is_synchronous": false, @@ -15024,7 +17184,7 @@ { "name": "code", "type": "string", - "description": "The verification code received via SMS, Telegram message, phone call, or flash call" + "description": "Authentication code to check" } ], "is_synchronous": false, @@ -15037,7 +17197,7 @@ "properties": [ { "name": "other_user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "List of user identifiers of other users currently using the application" } ], @@ -15085,6 +17245,20 @@ "is_synchronous": false, "type": 1 }, + { + "name": "checkAuthenticationPasswordRecoveryCode", + "description": "Checks whether a password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword", + "class": "Ok", + "properties": [ + { + "name": "recovery_code", + "type": "string", + "description": "Recovery code to check" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "recoverAuthenticationPassword", "description": "Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword", @@ -15094,6 +17268,16 @@ "name": "recovery_code", "type": "string", "description": "Recovery code to check" + }, + { + "name": "new_password", + "type": "string", + "description": "New password of the user; may be empty to remove the password" + }, + { + "name": "new_hint", + "type": "string", + "description": "New password hint; may be empty" } ], "is_synchronous": false, @@ -15183,7 +17367,7 @@ }, { "name": "setPassword", - "description": "Changes the password for the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed", + "description": "Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed", "class": "PasswordState", "properties": [ { @@ -15204,7 +17388,7 @@ { "name": "set_recovery_email_address", "type": "Bool", - "description": "Pass true if the recovery email address should be changed" + "description": "Pass true if the recovery email address must be changed" }, { "name": "new_recovery_email_address", @@ -15256,7 +17440,7 @@ { "name": "code", "type": "string", - "description": "Verification code" + "description": "Verification code to check" } ], "is_synchronous": false, @@ -15272,16 +17456,16 @@ }, { "name": "requestPasswordRecovery", - "description": "Requests to send a password recovery code to an email address that was previously set up", + "description": "Requests to send a 2-step verification password recovery code to an email address that was previously set up", "class": "EmailAddressAuthenticationCodeInfo", "properties": [], "is_synchronous": false, "type": 2 }, { - "name": "recoverPassword", - "description": "Recovers the password using a recovery code sent to an email address that was previously set up", - "class": "PasswordState", + "name": "checkPasswordRecoveryCode", + "description": "Checks whether a 2-step verification password recovery code sent to an email address is valid", + "class": "Ok", "properties": [ { "name": "recovery_code", @@ -15292,6 +17476,46 @@ "is_synchronous": false, "type": 2 }, + { + "name": "recoverPassword", + "description": "Recovers the 2-step verification password using a recovery code sent to an email address that was previously set up", + "class": "PasswordState", + "properties": [ + { + "name": "recovery_code", + "type": "string", + "description": "Recovery code to check" + }, + { + "name": "new_password", + "type": "string", + "description": "New password of the user; may be empty to remove the password" + }, + { + "name": "new_hint", + "type": "string", + "description": "New password hint; may be empty" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "resetPassword", + "description": "Removes 2-step verification password without previous password and access to recovery email address. The password can't be reset immediately and the request needs to be repeated after the specified time", + "class": "ResetPasswordResult", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "cancelPasswordReset", + "description": "Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date \u003e 0", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "createTemporaryPassword", "description": "Creates a new temporary password for processing payments", @@ -15305,7 +17529,7 @@ { "name": "valid_for", "type": "int32", - "description": "Time during which the temporary password will be valid, in seconds; should be between 60 and 86400" + "description": "Time during which the temporary password will be valid, in seconds; must be between 60 and 86400" } ], "is_synchronous": false, @@ -15334,7 +17558,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" } ], @@ -15348,7 +17572,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" } ], @@ -15362,7 +17586,7 @@ "properties": [ { "name": "basic_group_id", - "type": "int32", + "type": "int53", "description": "Basic group identifier" } ], @@ -15376,7 +17600,7 @@ "properties": [ { "name": "basic_group_id", - "type": "int32", + "type": "int53", "description": "Basic group identifier" } ], @@ -15390,7 +17614,7 @@ "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "Supergroup or channel identifier" } ], @@ -15404,7 +17628,7 @@ "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "Supergroup or channel identifier" } ], @@ -15490,7 +17714,7 @@ { "name": "message_id", "type": "int53", - "description": "Identifier of the message reply to which to get" + "description": "Identifier of the reply message" } ], "is_synchronous": false, @@ -15572,6 +17796,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getMessageViewers", + "description": "Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true", + "class": "Users", + "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", @@ -15599,36 +17842,45 @@ { "name": "file_type", "type": "FileType", - "description": "File type, if known" + "description": "File type; pass null if unknown" } ], "is_synchronous": false, "type": 1 }, + { + "name": "loadChats", + "description": "Loads more chats from a chat list. The loaded chats and their positions in the chat list will be sent through updates. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. Returns a 404 error if all chats have been loaded", + "class": "Ok", + "properties": [ + { + "name": "chat_list", + "type": "ChatList", + "description": "The chat list in which to load chats; pass null to load chats from the main chat list" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of chats to be loaded. For optimal performance, the number of loaded chats is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getChats", - "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", + "description": "Returns an ordered list of chats from the beginning of a chat list. For informational purposes only. Use loadChats and updates processing instead to maintain chat lists in a consistent state", "class": "Chats", "properties": [ { "name": "chat_list", "type": "ChatList", - "description": "The chat list in which to return chats" - }, - { - "name": "offset_order", - "type": "int64", - "description": "Chat order to return chats from" - }, - { - "name": "offset_chat_id", - "type": "int53", - "description": "Chat identifier to return chats from" + "description": "The chat list in which to return chats; pass null to get chats from the main chat list" }, { "name": "limit", "type": "int32", - "description": "The maximum number of chats to be returned. It is possible that fewer chats than the limit are returned even if the end of the list is not reached" + "description": "The maximum number of chats to be returned" } ], "is_synchronous": false, @@ -15636,7 +17888,7 @@ }, { "name": "searchPublicChat", - "description": "Searches a public chat by its username. Currently only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned", + "description": "Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned", "class": "Chat", "properties": [ { @@ -15650,7 +17902,7 @@ }, { "name": "searchPublicChats", - "description": "Searches public chats by looking for specified query in their username and title. Currently only private chats, supergroups and channels can be public. Returns a meaningful number of results. 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", + "description": "Searches public chats by looking for specified query in their username and title. Currently, only private chats, supergroups and channels can be public. Returns a meaningful number of results. Excludes private chats with contacts and chats from the chat list from the results", "class": "Chats", "properties": [ { @@ -15670,7 +17922,7 @@ { "name": "query", "type": "string", - "description": "Query to search for. If the query is empty, returns up to 20 recently found chats" + "description": "Query to search for. If the query is empty, returns up to 50 recently found chats" }, { "name": "limit", @@ -15702,7 +17954,7 @@ }, { "name": "searchChatsNearby", - "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", + "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 must be sent again every 25 seconds with adjusted location to not miss new chats", "class": "ChatsNearby", "properties": [ { @@ -15788,6 +18040,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getRecentlyOpenedChats", + "description": "Returns recently opened chats, this is an offline request. Returns chats in the order of last opening", + "class": "Chats", + "properties": [ + { + "name": "limit", + "type": "int32", + "description": "The maximum number of chats to be returned" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "checkChatUsername", "description": "Checks whether a username can be set for a chat", @@ -15796,7 +18062,7 @@ { "name": "chat_id", "type": "int53", - "description": "Chat identifier; should be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if chat is being created" + "description": "Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created" }, { "name": "username", @@ -15858,7 +18124,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -15877,7 +18143,7 @@ }, { "name": "getChatHistory", - "description": "Returns messages in a chat. 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. This is an offline request if only_local is true", + "description": "Returns messages in a chat. 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 TDLib. This is an offline request if only_local is true", "class": "Messages", "properties": [ { @@ -15898,7 +18164,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 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" + "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. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" }, { "name": "only_local", @@ -15911,7 +18177,7 @@ }, { "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", + "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 TDLib", "class": "Messages", "properties": [ { @@ -15937,7 +18203,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 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" + "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. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" } ], "is_synchronous": false, @@ -15945,7 +18211,7 @@ }, { "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", + "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", "class": "Ok", "properties": [ { @@ -15956,12 +18222,26 @@ { "name": "remove_from_chat_list", "type": "Bool", - "description": "Pass true if the chat should be removed from the chat list" + "description": "Pass true if the chat needs to be removed from the chat list" }, { "name": "revoke", "type": "Bool", - "description": "Pass true to try to delete chat history for all users" + "description": "Pass true to delete chat history for all users" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteChat", + "description": "Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" } ], "is_synchronous": false, @@ -15969,7 +18249,7 @@ }, { "name": "searchChatMessages", - "description": "Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages should be used instead), or without an enabled message database. For optimal performance the number of returned messages is chosen by the library", + "description": "Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit", "class": "Messages", "properties": [ { @@ -15983,9 +18263,9 @@ "description": "Query to search for" }, { - "name": "sender", + "name": "sender_id", "type": "MessageSender", - "description": "If not null, only messages sent by the specified sender will be returned. Not supported in secret chats" + "description": "Identifier of the sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats" }, { "name": "from_message_id", @@ -16000,12 +18280,12 @@ { "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 -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 -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" }, { "name": "filter", "type": "SearchMessagesFilter", - "description": "Filter for message content in the search results" + "description": "Additional filter for messages to search; pass null to search for all messages" }, { "name": "message_thread_id", @@ -16018,13 +18298,13 @@ }, { "name": "searchMessages", - "description": "Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance the number of returned messages is chosen by the library", + "description": "Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit", "class": "Messages", "properties": [ { "name": "chat_list", "type": "ChatList", - "description": "Chat list in which to search messages; pass null to search in all chats regardless of their chat list" + "description": "Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported" }, { "name": "query", @@ -16034,7 +18314,7 @@ { "name": "offset_date", "type": "int32", - "description": "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" + "description": "The date of the message starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last message" }, { "name": "offset_chat_id", @@ -16049,12 +18329,12 @@ { "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. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" }, { "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" + "description": "Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function" }, { "name": "min_date", @@ -16072,7 +18352,7 @@ }, { "name": "searchSecretMessages", - "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", + "description": "Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib", "class": "FoundMessages", "properties": [ { @@ -16083,7 +18363,7 @@ { "name": "query", "type": "string", - "description": "Query to search for. If empty, searchChatMessages should be used instead" + "description": "Query to search for. If empty, searchChatMessages must be used instead" }, { "name": "offset", @@ -16093,12 +18373,12 @@ { "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. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" }, { "name": "filter", "type": "SearchMessagesFilter", - "description": "A filter for message content in the search results" + "description": "Additional filter for messages to search; pass null to search for all messages" } ], "is_synchronous": false, @@ -16106,7 +18386,7 @@ }, { "name": "searchCallMessages", - "description": "Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library", + "description": "Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib", "class": "Messages", "properties": [ { @@ -16117,12 +18397,26 @@ { "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. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" }, { "name": "only_missed", "type": "Bool", - "description": "If true, returns only messages with missed calls" + "description": "If true, returns only messages with missed/declined calls" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteAllCallMessages", + "description": "Deletes all call messages", + "class": "Ok", + "properties": [ + { + "name": "revoke", + "type": "Bool", + "description": "Pass true to delete the messages for all users" } ], "is_synchronous": false, @@ -16149,7 +18443,7 @@ }, { "name": "getActiveLiveLocationMessages", - "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", + "description": "Returns all active live locations that need to 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, @@ -16174,6 +18468,59 @@ "is_synchronous": false, "type": 1 }, + { + "name": "getChatSparseMessagePositions", + "description": "Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database", + "class": "MessagePositions", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat in which to return information about message positions" + }, + { + "name": "filter", + "type": "SearchMessagesFilter", + "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function" + }, + { + "name": "from_message_id", + "type": "int53", + "description": "The message identifier from which to return information about message positions" + }, + { + "name": "limit", + "type": "int32", + "description": "The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatMessageCalendar", + "description": "Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option \"utc_time_offset\"", + "class": "MessageCalendar", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat in which to return information about messages" + }, + { + "name": "filter", + "type": "SearchMessagesFilter", + "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function" + }, + { + "name": "from_message_id", + "type": "int53", + "description": "The message identifier from which to return information about messages; use 0 to get results from the last message" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getChatMessageCount", "description": "Returns approximate number of messages of the specified type in the chat", @@ -16214,7 +18561,7 @@ }, { "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", + "description": "Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib", "class": "FoundMessages", "properties": [ { @@ -16235,7 +18582,21 @@ { "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" + "description": "The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatSponsoredMessage", + "description": "Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat", + "class": "SponsoredMessage", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" } ], "is_synchronous": false, @@ -16281,7 +18642,7 @@ }, { "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", + "description": "Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request", "class": "MessageLink", "properties": [ { @@ -16294,6 +18655,11 @@ "type": "int53", "description": "Identifier of the message" }, + { + "name": "media_timestamp", + "type": "int32", + "description": "If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview" + }, { "name": "for_album", "type": "Bool", @@ -16334,18 +18700,51 @@ }, { "name": "getMessageLinkInfo", - "description": "Returns information about a public or private message link", + "description": "Returns information about a public or private message link. Can be called for any internal link of the type internalLinkTypeMessage", "class": "MessageLinkInfo", "properties": [ { "name": "url", "type": "string", - "description": "The message link in the format \"https://t.me/c/...\", or \"tg://privatepost?...\", or \"https://t.me/username/...\", or \"tg://resolve?...\"" + "description": "The message link" } ], "is_synchronous": false, "type": 1 }, + { + "name": "getChatAvailableMessageSenders", + "description": "Returns list of message sender identifiers, which can be used to send messages in a chat", + "class": "MessageSenders", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setChatMessageSender", + "description": "Selects a message sender to send messages in a chat", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_sender_id", + "type": "MessageSender", + "description": "New message sender for the chat" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "sendMessage", "description": "Sends a message. Returns the sent message", @@ -16369,12 +18768,12 @@ { "name": "options", "type": "messageSendOptions", - "description": "Options to be used to send the message" + "description": "Options to be used to send the message; pass null to use default options" }, { "name": "reply_markup", "type": "ReplyMarkup", - "description": "Markup for replying to the message; for bots only" + "description": "Markup for replying to the message; pass null if none; for bots only" }, { "name": "input_message_content", @@ -16387,7 +18786,7 @@ }, { "name": "sendMessageAlbum", - "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", + "description": "Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages", "class": "Messages", "properties": [ { @@ -16408,12 +18807,12 @@ { "name": "options", "type": "messageSendOptions", - "description": "Options to be used to send the messages" + "description": "Options to be used to send the messages; pass null to use default options" }, { "name": "input_message_contents", "type": "vector\u003cInputMessageContent\u003e", - "description": "Contents of messages to be sent" + "description": "Contents of messages to be sent. At most 10 messages can be added to an album" } ], "is_synchronous": false, @@ -16426,7 +18825,7 @@ "properties": [ { "name": "bot_user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the bot" }, { @@ -16466,7 +18865,7 @@ { "name": "options", "type": "messageSendOptions", - "description": "Options to be used to send the message" + "description": "Options to be used to send the message; pass null to use default options" }, { "name": "query_id", @@ -16505,22 +18904,27 @@ { "name": "message_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order" + "description": "Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously" }, { "name": "options", "type": "messageSendOptions", - "description": "Options to be used to send the messages" + "description": "Options to be used to send the messages; pass null to use default options" }, { "name": "send_copy", "type": "Bool", - "description": "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" + "description": "If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local" }, { "name": "remove_caption", "type": "Bool", - "description": "True, if media caption of message copies needs to be removed. Ignored if send_copy is false" + "description": "If true, media caption of message copies will be removed. Ignored if send_copy is false" + }, + { + "name": "only_preview", + "type": "Bool", + "description": "If true, messages will not be forwarded and instead fake messages will be returned" } ], "is_synchronous": false, @@ -16545,25 +18949,6 @@ "is_synchronous": false, "type": 1 }, - { - "name": "sendChatSetTtlMessage", - "description": "Changes the current TTL setting (sets a new self-destruct timer) in a secret chat and sends the corresponding message", - "class": "Message", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "ttl", - "type": "int32", - "description": "New TTL value, in seconds" - } - ], - "is_synchronous": false, - "type": 1 - }, { "name": "sendChatScreenshotTakenNotification", "description": "Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats", @@ -16589,9 +18974,9 @@ "description": "Target chat" }, { - "name": "sender", + "name": "sender_id", "type": "MessageSender", - "description": "The sender sender of the message" + "description": "Identifier of the sender of the message" }, { "name": "reply_to_message_id", @@ -16630,15 +19015,15 @@ { "name": "revoke", "type": "Bool", - "description": "Pass true to try to delete messages for all chat members. Always true for supergroups, channels and secret chats" + "description": "Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats" } ], "is_synchronous": false, "type": 1 }, { - "name": "deleteChatMessagesFromUser", - "description": "Deletes all messages sent by the specified user to a chat. Supported only for supergroups; requires can_delete_messages administrator privileges", + "name": "deleteChatMessagesBySender", + "description": "Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges", "class": "Ok", "properties": [ { @@ -16647,9 +19032,38 @@ "description": "Chat identifier" }, { - "name": "user_id", + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the sender of messages to delete" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteChatMessagesByDate", + "description": "Deletes all messages between the specified dates in a chat. Supported only for private chats and basic groups. Messages sent in the last 30 seconds will not be deleted", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "min_date", "type": "int32", - "description": "User identifier" + "description": "The minimum date of the messages to delete" + }, + { + "name": "max_date", + "type": "int32", + "description": "The maximum date of the messages to delete" + }, + { + "name": "revoke", + "type": "Bool", + "description": "Pass true to delete chat messages for all users; private chats only" } ], "is_synchronous": false, @@ -16673,12 +19087,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup; for bots only" + "description": "The new message reply markup; pass null if none; for bots only" }, { "name": "input_message_content", "type": "InputMessageContent", - "description": "New text content of the message. Should be of type InputMessageText" + "description": "New text content of the message. Must be of type inputMessageText" } ], "is_synchronous": false, @@ -16702,12 +19116,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup; for bots only" + "description": "The new message reply markup; pass null if none; for bots only" }, { "name": "location", "type": "location", - "description": "New location content of the message; may be null. Pass null to stop sharing the live location" + "description": "New location content of the message; pass null to stop sharing the live location" }, { "name": "heading", @@ -16725,7 +19139,7 @@ }, { "name": "editMessageMedia", - "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", + "description": "Edits the content of a message with an animation, an audio, a document, a photo or a video, including message caption. If only the caption needs to be edited, use editMessageCaption instead. The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. Returns the edited message after the edit is completed on the server side", "class": "Message", "properties": [ { @@ -16741,12 +19155,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup; for bots only" + "description": "The new message reply markup; pass null if none; for bots only" }, { "name": "input_message_content", "type": "InputMessageContent", - "description": "New content of the message. Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePhoto or InputMessageVideo" + "description": "New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo" } ], "is_synchronous": false, @@ -16770,12 +19184,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup; for bots only" + "description": "The new message reply markup; pass null if none; for bots only" }, { "name": "caption", "type": "formattedText", - "description": "New message content caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "New message content caption; 0-GetOption(\"message_caption_length_max\") characters; pass null to remove caption" } ], "is_synchronous": false, @@ -16799,7 +19213,7 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup" + "description": "The new message reply markup; pass null if none" } ], "is_synchronous": false, @@ -16818,12 +19232,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup" + "description": "The new message reply markup; pass null if none" }, { "name": "input_message_content", "type": "InputMessageContent", - "description": "New text content of the message. Should be of type InputMessageText" + "description": "New text content of the message. Must be of type inputMessageText" } ], "is_synchronous": false, @@ -16842,12 +19256,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup" + "description": "The new message reply markup; pass null if none" }, { "name": "location", "type": "location", - "description": "New location content of the message; may be null. Pass null to stop sharing the live location" + "description": "New location content of the message; pass null to stop sharing the live location" }, { "name": "heading", @@ -16876,12 +19290,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup; for bots only" + "description": "The new message reply markup; pass null if none; for bots only" }, { "name": "input_message_content", "type": "InputMessageContent", - "description": "New content of the message. Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePhoto or InputMessageVideo" + "description": "New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo" } ], "is_synchronous": false, @@ -16900,12 +19314,12 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup" + "description": "The new message reply markup; pass null if none" }, { "name": "caption", "type": "formattedText", - "description": "New message content caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "New message content caption; pass null to remove caption; 0-GetOption(\"message_caption_length_max\") characters" } ], "is_synchronous": false, @@ -16924,7 +19338,7 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup" + "description": "The new message reply markup; pass null if none" } ], "is_synchronous": false, @@ -16948,7 +19362,7 @@ { "name": "scheduling_state", "type": "MessageSchedulingState", - "description": "The new message scheduling state. Pass null to send the message immediately" + "description": "The new message scheduling state; pass null to send the message immediately" } ], "is_synchronous": false, @@ -17140,7 +19554,7 @@ }, { "name": "getPollVoters", - "description": "Returns users voted for the specified option in a non-anonymous polls. For the optimal performance the number of returned users is chosen by the library", + "description": "Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib", "class": "Users", "properties": [ { @@ -17166,7 +19580,7 @@ { "name": "limit", "type": "int32", - "description": "The maximum number of users to be returned; must be positive and can't be greater than 50. Fewer users may be returned than specified by the limit, even if the end of the voter list has not been reached" + "description": "The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached" } ], "is_synchronous": false, @@ -17190,7 +19604,7 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "The new message reply markup; for bots only" + "description": "The new message reply markup; pass null if none; for bots only" } ], "is_synchronous": false, @@ -17227,7 +19641,7 @@ }, { "name": "button_id", - "type": "int32", + "type": "int53", "description": "Button identifier" } ], @@ -17251,7 +19665,7 @@ }, { "name": "button_id", - "type": "int32", + "type": "int53", "description": "Button identifier" }, { @@ -17270,7 +19684,7 @@ "properties": [ { "name": "bot_user_id", - "type": "int32", + "type": "int53", "description": "The identifier of the target bot" }, { @@ -17281,7 +19695,7 @@ { "name": "user_location", "type": "location", - "description": "Location of the user, only if needed" + "description": "Location of the user; pass null if unknown or the bot doesn't need user's location" }, { "name": "query", @@ -17330,7 +19744,7 @@ { "name": "switch_pm_text", "type": "string", - "description": "If non-empty, this text should be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter" + "description": "If non-empty, this text must be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter" }, { "name": "switch_pm_parameter", @@ -17383,7 +19797,7 @@ { "name": "show_alert", "type": "Bool", - "description": "If true, an alert should be shown to the user instead of a toast notification" + "description": "If true, an alert must be shown to the user instead of a toast notification" }, { "name": "url", @@ -17460,11 +19874,11 @@ { "name": "edit_message", "type": "Bool", - "description": "True, if the message should be edited" + "description": "True, if the message needs to be edited" }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -17494,11 +19908,11 @@ { "name": "edit_message", "type": "Bool", - "description": "True, if the message should be edited" + "description": "True, if the message needs to be edited" }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -17532,7 +19946,7 @@ }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" } ], @@ -17551,7 +19965,7 @@ }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" } ], @@ -17560,7 +19974,7 @@ }, { "name": "deleteChatReplyMarkup", - "description": "Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup will be changed", + "description": "Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup is changed", "class": "Ok", "properties": [ { @@ -17595,7 +20009,7 @@ { "name": "action", "type": "ChatAction", - "description": "The action description" + "description": "The action description; pass null to cancel the currently active action" } ], "is_synchronous": false, @@ -17631,7 +20045,7 @@ }, { "name": "viewMessages", - "description": "Informs TDLib that messages are being viewed by the user. Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels)", + "description": "Informs TDLib that messages are being viewed by the user. Sponsored messages must be marked as viewed only when the entire text of the message is shown on the screen (excluding the button). Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels)", "class": "Ok", "properties": [ { @@ -17652,7 +20066,7 @@ { "name": "force_read", "type": "Bool", - "description": "True, if messages in closed chats should be marked as read by the request" + "description": "True, if messages in closed chats must be marked as read by the request" } ], "is_synchronous": false, @@ -17677,6 +20091,72 @@ "is_synchronous": false, "type": 2 }, + { + "name": "clickAnimatedEmojiMessage", + "description": "Informs TDLib that a message with an animated emoji was clicked by the user. Returns a big animated sticker to be played or a 404 error if usual animation needs to be played", + "class": "Sticker", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the clicked message" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getInternalLinkType", + "description": "Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization", + "class": "InternalLinkType", + "properties": [ + { + "name": "link", + "type": "string", + "description": "The link" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getExternalLinkInfo", + "description": "Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if web page preview is disabled in secret chats", + "class": "LoginUrlInfo", + "properties": [ + { + "name": "link", + "type": "string", + "description": "The link" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getExternalLink", + "description": "Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed", + "class": "HttpUrl", + "properties": [ + { + "name": "link", + "type": "string", + "description": "The HTTP link" + }, + { + "name": "allow_write_access", + "type": "Bool", + "description": "True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "readAllChatMentions", "description": "Marks all mentions in a chat as read", @@ -17698,7 +20178,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -17717,7 +20197,7 @@ "properties": [ { "name": "basic_group_id", - "type": "int32", + "type": "int53", "description": "Basic group identifier" }, { @@ -17736,7 +20216,7 @@ "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "Supergroup or channel identifier" }, { @@ -17769,7 +20249,7 @@ "properties": [ { "name": "user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "Identifiers of users to be added to the basic group" }, { @@ -17794,7 +20274,7 @@ { "name": "is_channel", "type": "Bool", - "description": "True, if a channel chat should be created" + "description": "True, if a channel chat needs to be created" }, { "name": "description", @@ -17804,7 +20284,12 @@ { "name": "location", "type": "chatLocation", - "description": "Chat location if a location-based supergroup is being created" + "description": "Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat" + }, + { + "name": "for_import", + "type": "Bool", + "description": "True, if the supergroup is created for importing messages using importMessage" } ], "is_synchronous": false, @@ -17817,7 +20302,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the target user" } ], @@ -17970,7 +20455,7 @@ }, { "name": "setChatTitle", - "description": "Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights", + "description": "Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right", "class": "Ok", "properties": [ { @@ -17989,7 +20474,7 @@ }, { "name": "setChatPhoto", - "description": "Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info rights", + "description": "Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right", "class": "Ok", "properties": [ { @@ -18000,7 +20485,26 @@ { "name": "photo", "type": "InputChatPhoto", - "description": "New chat photo. Pass null to delete the chat photo" + "description": "New chat photo; pass null to delete the chat photo" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "setChatMessageTtl", + "description": "Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram)", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "ttl", + "type": "int32", + "description": "New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret" } ], "is_synchronous": false, @@ -18025,6 +20529,25 @@ "is_synchronous": false, "type": 1 }, + { + "name": "setChatTheme", + "description": "Changes the chat theme. Supported only in private and secret chats", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "theme_name", + "type": "string", + "description": "Name of the new chat theme; pass an empty string to return the default theme" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setChatDraftMessage", "description": "Changes the draft message in a chat", @@ -18043,7 +20566,7 @@ { "name": "draft_message", "type": "draftMessage", - "description": "New draft message; may be null" + "description": "New draft message; pass null to remove the draft" } ], "is_synchronous": false, @@ -18068,6 +20591,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "toggleChatHasProtectedContent", + "description": "Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "has_protected_content", + "type": "Bool", + "description": "True, if chat content can't be saved locally, forwarded, or copied" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "toggleChatIsMarkedAsUnread", "description": "Changes the marked as unread state of a chat", @@ -18127,7 +20669,7 @@ }, { "name": "setChatDescription", - "description": "Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info rights", + "description": "Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right", "class": "Ok", "properties": [ { @@ -18146,7 +20688,7 @@ }, { "name": "setChatDiscussionGroup", - "description": "Changes the discussion group of a channel chat; requires can_change_info rights in the channel if it is specified", + "description": "Changes the discussion group of a channel chat; requires can_change_info administrator right in the channel if it is specified", "class": "Ok", "properties": [ { @@ -18195,7 +20737,7 @@ { "name": "slow_mode_delay", "type": "int32", - "description": "New slow mode delay for the chat; must be one of 0, 10, 30, 60, 300, 900, 3600" + "description": "New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600" } ], "is_synchronous": false, @@ -18219,7 +20761,7 @@ { "name": "disable_notification", "type": "Bool", - "description": "True, if there should be no notification about the pinned message. Notifications are always disabled in channels and private chats" + "description": "True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats" }, { "name": "only_for_self", @@ -18265,7 +20807,7 @@ }, { "name": "joinChat", - "description": "Adds current user as a new member to a chat. Private and secret chats can't be joined using this method", + "description": "Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method", "class": "Ok", "properties": [ { @@ -18279,7 +20821,7 @@ }, { "name": "leaveChat", - "description": "Removes current user from chat members. Private and secret chats can't be left using this method", + "description": "Removes the current user from chat members. Private and secret chats can't be left using this method", "class": "Ok", "properties": [ { @@ -18293,7 +20835,7 @@ }, { "name": "addChatMember", - "description": "Adds a new member to a chat. Members can't be added to private or secret chats. Members will not be added until the chat state has been synchronized with the server", + "description": "Adds a new member to a chat. Members can't be added to private or secret chats", "class": "Ok", "properties": [ { @@ -18303,13 +20845,13 @@ }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user" }, { "name": "forward_limit", "type": "int32", - "description": "The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels" + "description": "The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot" } ], "is_synchronous": false, @@ -18317,7 +20859,7 @@ }, { "name": "addChatMembers", - "description": "Adds multiple new members to a chat. Currently this option is only available for supergroups and channels. This option can't be used to join a chat. Members can't be added to a channel if it has more than 200 members. Members will not be added until the chat state has been synchronized with the server", + "description": "Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members", "class": "Ok", "properties": [ { @@ -18327,8 +20869,8 @@ }, { "name": "user_ids", - "type": "vector\u003cint32\u003e", - "description": "Identifiers of the users to be added to the chat" + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the users to be added to the chat. The maximum number of added users is 20 for supergroups and 100 for channels" } ], "is_synchronous": false, @@ -18336,7 +20878,7 @@ }, { "name": "setChatMemberStatus", - "description": "Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for adding new members to the chat and transferring chat ownership; instead, use addChatMember or transferChatOwnership. The chat member status will not be changed until it has been synchronized with the server", + "description": "Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed", "class": "Ok", "properties": [ { @@ -18345,9 +20887,9 @@ "description": "Chat identifier" }, { - "name": "user_id", - "type": "int32", - "description": "User identifier" + "name": "member_id", + "type": "MessageSender", + "description": "Member identifier. Chats can be only banned and unbanned in supergroups and channels" }, { "name": "status", @@ -18358,6 +20900,35 @@ "is_synchronous": false, "type": 1 }, + { + "name": "banChatMember", + "description": "Bans a member in a chat. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "member_id", + "type": "MessageSender", + "description": "Member identifier" + }, + { + "name": "banned_until_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned" + }, + { + "name": "revoke_messages", + "type": "Bool", + "description": "Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "canTransferOwnership", "description": "Checks whether the current session can be used to transfer a chat ownership to another user", @@ -18378,7 +20949,7 @@ }, { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user" }, { @@ -18401,9 +20972,9 @@ "description": "Chat identifier" }, { - "name": "user_id", - "type": "int32", - "description": "User identifier" + "name": "member_id", + "type": "MessageSender", + "description": "Member identifier" } ], "is_synchronous": false, @@ -18427,12 +20998,12 @@ { "name": "limit", "type": "int32", - "description": "The maximum number of users to be returned" + "description": "The maximum number of users to be returned; up to 200" }, { "name": "filter", "type": "ChatMembersFilter", - "description": "The type of users to return. By default, chatMembersFilterMembers" + "description": "The type of users to search for; pass null to search among all chat members" } ], "is_synchronous": false, @@ -18474,7 +21045,7 @@ { "name": "scope", "type": "NotificationSettingsScope", - "description": "If specified, only chats from the specified scope will be returned" + "description": "If specified, only chats from the scope will be returned; pass null to return chats from all scopes" }, { "name": "compare_sound", @@ -18587,17 +21158,17 @@ { "name": "offset", "type": "int32", - "description": "The starting position from which the file should be downloaded" + "description": "The starting position from which the file needs to be downloaded" }, { "name": "limit", "type": "int32", - "description": "Number of bytes which should be downloaded starting from the \"offset\" position before the download will be automatically cancelled; use 0 to download without a limit" + "description": "Number of bytes which need to be downloaded starting from the \"offset\" position before the download will automatically be canceled; use 0 to download without a limit" }, { "name": "synchronous", "type": "Bool", - "description": "If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been cancelled or a new downloadFile request with different offset/limit parameters was sent" + "description": "If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent" } ], "is_synchronous": false, @@ -18605,7 +21176,7 @@ }, { "name": "getFileDownloadedPrefixSize", - "description": "Returns file downloaded prefix size from a given offset", + "description": "Returns file downloaded prefix size from a given offset, in bytes", "class": "Count", "properties": [ { @@ -18616,7 +21187,7 @@ { "name": "offset", "type": "int32", - "description": "Offset from which downloaded prefix size should be calculated" + "description": "Offset from which downloaded prefix size needs to be calculated" } ], "is_synchronous": false, @@ -18641,6 +21212,25 @@ "is_synchronous": false, "type": 1 }, + { + "name": "getSuggestedFileName", + "description": "Returns suggested name for saving a file in a given directory", + "class": "Text", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "Identifier of the file" + }, + { + "name": "directory", + "type": "string", + "description": "Directory in which the file is supposed to be saved" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "uploadFile", "description": "Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message", @@ -18654,7 +21244,7 @@ { "name": "file_type", "type": "FileType", - "description": "File type" + "description": "File type; pass null if unknown" }, { "name": "priority", @@ -18740,7 +21330,7 @@ { "name": "error", "type": "error", - "description": "If set, means that file generation has failed and should be terminated" + "description": "If passed, the file generation has failed and must be terminated; pass null if the file generation succeeded" } ], "is_synchronous": false, @@ -18785,8 +21375,60 @@ "type": 1 }, { - "name": "generateChatInviteLink", - "description": "Generates a new invite link for a chat; the previously generated link is revoked. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right", + "name": "getMessageFileType", + "description": "Returns information about a file with messages exported from another app", + "class": "MessageFileType", + "properties": [ + { + "name": "message_file_head", + "type": "string", + "description": "Beginning of the message file; up to 100 first lines" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getMessageImportConfirmationText", + "description": "Returns a confirmation text to be shown to the user before starting message import", + "class": "Text", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "importMessages", + "description": "Imports messages exported from another app", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right" + }, + { + "name": "message_file", + "type": "InputFile", + "description": "File with messages to import. Only inputFileLocal and inputFileGenerated are supported. The file must not be previously uploaded" + }, + { + "name": "attached_files", + "type": "vector\u003cInputFile\u003e", + "description": "Files used in the imported messages. Only inputFileLocal and inputFileGenerated are supported. The files must not be previously uploaded" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "replacePrimaryChatInviteLink", + "description": "Replaces current primary invite link for a chat with a new primary invite link. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right", "class": "ChatInviteLink", "properties": [ { @@ -18798,6 +21440,237 @@ "is_synchronous": false, "type": 1 }, + { + "name": "createChatInviteLink", + "description": "Creates a new invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat", + "class": "ChatInviteLink", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "name", + "type": "string", + "description": "Invite link name; 0-32 characters" + }, + { + "name": "expiration_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the link will expire; pass 0 if never" + }, + { + "name": "member_limit", + "type": "int32", + "description": "The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited" + }, + { + "name": "creates_join_request", + "type": "Bool", + "description": "True, if the link only creates join request. If true, member_limit must not be specified" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "editChatInviteLink", + "description": "Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links", + "class": "ChatInviteLink", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link to be edited" + }, + { + "name": "name", + "type": "string", + "description": "Invite link name; 0-32 characters" + }, + { + "name": "expiration_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the link will expire; pass 0 if never" + }, + { + "name": "member_limit", + "type": "int32", + "description": "The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited" + }, + { + "name": "creates_join_request", + "type": "Bool", + "description": "True, if the link only creates join request. If true, member_limit must not be specified" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getChatInviteLink", + "description": "Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links", + "class": "ChatInviteLink", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link to get" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatInviteLinkCounts", + "description": "Returns list of chat administrators with number of their invite links. Requires owner privileges in the chat", + "class": "ChatInviteLinkCounts", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatInviteLinks", + "description": "Returns invite links for a chat created by specified administrator. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links", + "class": "ChatInviteLinks", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "creator_user_id", + "type": "int53", + "description": "User identifier of a chat administrator. Must be an identifier of the current user for non-owner" + }, + { + "name": "is_revoked", + "type": "Bool", + "description": "Pass true if revoked links needs to be returned instead of active or expired" + }, + { + "name": "offset_date", + "type": "int32", + "description": "Creation date of an invite link starting after which to return invite links; use 0 to get results from the beginning" + }, + { + "name": "offset_invite_link", + "type": "string", + "description": "Invite link starting after which to return invite links; use empty string to get results from the beginning" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of invite links to return; up to 100" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatInviteLinkMembers", + "description": "Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links", + "class": "ChatInviteLinkMembers", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link for which to return chat members" + }, + { + "name": "offset_member", + "type": "chatInviteLinkMember", + "description": "A chat member from which to return next chat members; pass null to get results from the beginning" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of chat members to return; up to 100" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "revokeChatInviteLink", + "description": "Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links. If a primary link is revoked, then additionally to the revoked link returns new primary link", + "class": "ChatInviteLinks", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link to be revoked" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "deleteRevokedChatInviteLink", + "description": "Deletes revoked chat invite links. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link to revoke" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteAllRevokedChatInviteLinks", + "description": "Deletes all revoked chat invite links created by a given chat administrator. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "creator_user_id", + "type": "int53", + "description": "User identifier of a chat administrator, which links will be deleted. Must be an identifier of the current user for non-owner" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "checkChatInviteLink", "description": "Checks the validity of an invite link for a chat and returns information about the corresponding chat", @@ -18806,7 +21679,7 @@ { "name": "invite_link", "type": "string", - "description": "Invite link to be checked; should begin with \"https://t.me/joinchat/\", \"https://telegram.me/joinchat/\", or \"https://telegram.dog/joinchat/\"" + "description": "Invite link to be checked" } ], "is_synchronous": false, @@ -18814,13 +21687,95 @@ }, { "name": "joinChatByInviteLink", - "description": "Uses an invite link to add the current user to the chat if possible. The new member will not be added until the chat state has been synchronized with the server", + "description": "Uses an invite link to add the current user to the chat if possible", "class": "Chat", "properties": [ { "name": "invite_link", "type": "string", - "description": "Invite link to import; should begin with \"https://t.me/joinchat/\", \"https://telegram.me/joinchat/\", or \"https://telegram.dog/joinchat/\"" + "description": "Invite link to use" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatJoinRequests", + "description": "Returns pending join requests in a chat", + "class": "ChatJoinRequests", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link for which to return join requests. If empty, all join requests will be returned. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links" + }, + { + "name": "query", + "type": "string", + "description": "A query to search for in the first names, last names and usernames of the users to return" + }, + { + "name": "offset_request", + "type": "chatJoinRequest", + "description": "A chat join request from which to return next requests; pass null to get results from the beginning" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of requests to join the chat to return" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "processChatJoinRequest", + "description": "Handles a pending join request in a chat", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user that sent the request" + }, + { + "name": "approve", + "type": "Bool", + "description": "True, if the request is approved. Otherwise the request is declived" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "processChatJoinRequests", + "description": "Handles all pending join requests for a given link in a chat", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links" + }, + { + "name": "approve", + "type": "Bool", + "description": "True, if the requests are approved. Otherwise the requests are declived" } ], "is_synchronous": false, @@ -18833,13 +21788,13 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user to be called" }, { "name": "protocol", "type": "callProtocol", - "description": "Description of the call protocols supported by the application" + "description": "The call protocols supported by the application" }, { "name": "is_video", @@ -18863,7 +21818,7 @@ { "name": "protocol", "type": "callProtocol", - "description": "Description of the call protocols supported by the application" + "description": "The call protocols supported by the application" } ], "is_synchronous": false, @@ -18970,15 +21925,568 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getVideoChatAvailableParticipants", + "description": "Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined", + "class": "MessageSenders", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setVideoChatDefaultParticipant", + "description": "Changes default participant identifier, on whose behalf a video chat in the chat will be joined", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "default_participant_id", + "type": "MessageSender", + "description": "Default group call participant identifier to join the video chats" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "createVideoChat", + "description": "Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights", + "class": "GroupCallId", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier, in which the video chat will be created" + }, + { + "name": "title", + "type": "string", + "description": "Group call title; if empty, chat title will be used" + }, + { + "name": "start_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getGroupCall", + "description": "Returns information about a group call", + "class": "GroupCall", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "startScheduledGroupCall", + "description": "Starts a scheduled group call", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleGroupCallEnabledStartNotification", + "description": "Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "enabled_start_notification", + "type": "Bool", + "description": "New value of the enabled_start_notification setting" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "joinGroupCall", + "description": "Joins an active group call. Returns join response payload for tgcalls", + "class": "Text", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "participant_id", + "type": "MessageSender", + "description": "Identifier of a group call participant, which will be used to join the call; pass null to join as self; video chats only" + }, + { + "name": "audio_source_id", + "type": "int32", + "description": "Caller audio channel synchronization source identifier; received from tgcalls" + }, + { + "name": "payload", + "type": "string", + "description": "Group call join payload; received from tgcalls" + }, + { + "name": "is_muted", + "type": "Bool", + "description": "True, if the user's microphone is muted" + }, + { + "name": "is_my_video_enabled", + "type": "Bool", + "description": "True, if the user's video is enabled" + }, + { + "name": "invite_hash", + "type": "string", + "description": "If non-empty, invite hash to be used to join the group call without being muted by administrators" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "startGroupCallScreenSharing", + "description": "Starts screen sharing in a joined group call. Returns join response payload for tgcalls", + "class": "Text", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "audio_source_id", + "type": "int32", + "description": "Screen sharing audio channel synchronization source identifier; received from tgcalls" + }, + { + "name": "payload", + "type": "string", + "description": "Group call join payload; received from tgcalls" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleGroupCallScreenSharingIsPaused", + "description": "Pauses or unpauses screen sharing in a joined group call", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "True if screen sharing is paused" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "endGroupCallScreenSharing", + "description": "Ends screen sharing in a joined group call", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setGroupCallTitle", + "description": "Sets group call title. Requires groupCall.can_be_managed group call flag", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "title", + "type": "string", + "description": "New group call title; 1-64 characters" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleGroupCallMuteNewParticipants", + "description": "Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires groupCall.can_toggle_mute_new_participants group call flag", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "mute_new_participants", + "type": "Bool", + "description": "New value of the mute_new_participants setting" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "inviteGroupCallParticipants", + "description": "Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "User identifiers. At most 10 users can be invited simultaneously" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getGroupCallInviteLink", + "description": "Returns invite link to a video chat in a public chat", + "class": "HttpUrl", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "can_self_unmute", + "type": "Bool", + "description": "Pass true if the invite link needs to contain an invite hash, passing which to joinGroupCall would allow the invited user to unmute themselves. Requires groupCall.can_be_managed group call flag" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "revokeGroupCallInviteLink", + "description": "Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "startGroupCallRecording", + "description": "Starts recording of an active group call. Requires groupCall.can_be_managed group call flag", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "title", + "type": "string", + "description": "Group call recording title; 0-64 characters" + }, + { + "name": "record_video", + "type": "Bool", + "description": "Pass true to record a video file instead of an audio file" + }, + { + "name": "use_portrait_orientation", + "type": "Bool", + "description": "Pass true to use portrait orientation for video instead of landscape one" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "endGroupCallRecording", + "description": "Ends recording of an active group call. Requires groupCall.can_be_managed group call flag", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleGroupCallIsMyVideoPaused", + "description": "Toggles whether current user's video is paused", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "is_my_video_paused", + "type": "Bool", + "description": "Pass true if the current user's video is paused" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleGroupCallIsMyVideoEnabled", + "description": "Toggles whether current user's video is enabled", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "is_my_video_enabled", + "type": "Bool", + "description": "Pass true if the current user's video is enabled" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setGroupCallParticipantIsSpeaking", + "description": "Informs TDLib that speaking state of a participant of an active group has changed", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "audio_source", + "type": "int32", + "description": "Group call participant's synchronization audio source identifier, or 0 for the current user" + }, + { + "name": "is_speaking", + "type": "Bool", + "description": "True, if the user is speaking" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleGroupCallParticipantIsMuted", + "description": "Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "participant_id", + "type": "MessageSender", + "description": "Participant identifier" + }, + { + "name": "is_muted", + "type": "Bool", + "description": "Pass true if the user must be muted and false otherwise" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setGroupCallParticipantVolumeLevel", + "description": "Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "participant_id", + "type": "MessageSender", + "description": "Participant identifier" + }, + { + "name": "volume_level", + "type": "int32", + "description": "New participant's volume level; 1-20000 in hundreds of percents" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleGroupCallParticipantIsHandRaised", + "description": "Toggles whether a group call participant hand is rased", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "participant_id", + "type": "MessageSender", + "description": "Participant identifier" + }, + { + "name": "is_hand_raised", + "type": "Bool", + "description": "Pass true if the user's hand needs to be raised. Only self hand can be raised. Requires groupCall.can_be_managed group call flag to lower other's hand" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "loadGroupCallParticipants", + "description": "Loads more participants of a group call. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier. The group call must be previously received through getGroupCall and must be joined or being joined" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of participants to load; up to 100" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "leaveGroupCall", + "description": "Leaves a group call", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "endGroupCall", + "description": "Ends a group call. Requires groupCall.can_be_managed", + "class": "Ok", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getGroupCallStreamSegment", + "description": "Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video", + "class": "FilePart", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + }, + { + "name": "time_offset", + "type": "int53", + "description": "Point in time when the stream segment begins; Unix timestamp in milliseconds" + }, + { + "name": "scale", + "type": "int32", + "description": "Segment duration scale; 0-1. Segment's duration is 1000/(2**scale) milliseconds" + }, + { + "name": "channel_id", + "type": "int32", + "description": "Identifier of an audio/video channel to get as received from tgcalls" + }, + { + "name": "video_quality", + "type": "GroupCallVideoQuality", + "description": "Video quality as received from tgcalls; pass null to get the worst available quality" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "toggleMessageSenderIsBlocked", "description": "Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked", "class": "Ok", "properties": [ { - "name": "sender", + "name": "sender_id", "type": "MessageSender", - "description": "Message Sender" + "description": "Identifier of a message sender to block/unblock" }, { "name": "is_blocked", @@ -19050,7 +22558,7 @@ { "name": "share_phone_number", "type": "Bool", - "description": "True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field UserFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number" + "description": "True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number" } ], "is_synchronous": false, @@ -19104,7 +22612,7 @@ "properties": [ { "name": "user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "Identifiers of users to be deleted" } ], @@ -19121,7 +22629,7 @@ }, { "name": "changeImportedContacts", - "description": "Changes imported contacts using the list of current user contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. Query result depends on the result of the previous query, so only one query is possible at the same time", + "description": "Changes imported contacts using the list of contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. Query result depends on the result of the previous query, so only one query is possible at the same time", "class": "ImportedContacts", "properties": [ { @@ -19148,7 +22656,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Identifier of the user with whom to share the phone number. The user must be a mutual contact" } ], @@ -19162,7 +22670,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -19181,7 +22689,7 @@ }, { "name": "getStickers", - "description": "Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is not empty, favorite and recently used stickers may also be returned", + "description": "Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, favorite and recently used stickers may also be returned", "class": "Stickers", "properties": [ { @@ -19249,7 +22757,7 @@ { "name": "limit", "type": "int32", - "description": "The maximum number of sticker sets to return" + "description": "The maximum number of sticker sets to return; up to 100" } ], "is_synchronous": false, @@ -19257,7 +22765,7 @@ }, { "name": "getTrendingStickerSets", - "description": "Returns a list of trending sticker sets. For the optimal performance the number of returned sticker sets is chosen by the library", + "description": "Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib", "class": "StickerSets", "properties": [ { @@ -19268,7 +22776,7 @@ { "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" + "description": "The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached" } ], "is_synchronous": false, @@ -19276,7 +22784,7 @@ }, { "name": "getAttachedStickerSets", - "description": "Returns a list of sticker sets attached to a file. Currently only photos and videos can have attached sticker sets", + "description": "Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets", "class": "StickerSets", "properties": [ { @@ -19551,6 +23059,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getAnimatedEmoji", + "description": "Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji", + "class": "AnimatedEmoji", + "properties": [ + { + "name": "emoji", + "type": "string", + "description": "The emoji" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getEmojiSuggestionsUrl", "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", @@ -19581,7 +23103,7 @@ { "name": "animation", "type": "InputFile", - "description": "The animation file to be added. Only animations known to the server (i.e. successfully sent via a message) can be added to the list" + "description": "The animation file to be added. Only animations known to the server (i.e., successfully sent via a message) can be added to the list" } ], "is_synchronous": false, @@ -19711,12 +23233,12 @@ { "name": "first_name", "type": "string", - "description": "The new value of the first name for the user; 1-64 characters" + "description": "The new value of the first name for the current user; 1-64 characters" }, { "name": "last_name", "type": "string", - "description": "The new value of the optional last name for the user; 0-64 characters" + "description": "The new value of the optional last name for the current user; 0-64 characters" } ], "is_synchronous": false, @@ -19777,7 +23299,7 @@ { "name": "settings", "type": "phoneNumberAuthenticationSettings", - "description": "Settings for the authentication of the user's phone number" + "description": "Settings for the authentication of the user's phone number; pass null to use default settings" } ], "is_synchronous": false, @@ -19785,7 +23307,7 @@ }, { "name": "resendChangePhoneNumberCode", - "description": "Re-sends the authentication code sent to confirm a new phone number for the user. Works only if the previously received authenticationCodeInfo next_code_type was not null", + "description": "Re-sends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed", "class": "AuthenticationCodeInfo", "properties": [], "is_synchronous": false, @@ -19799,7 +23321,7 @@ { "name": "code", "type": "string", - "description": "Verification code received by SMS, phone call or flash call" + "description": "Authentication code to check" } ], "is_synchronous": false, @@ -19807,9 +23329,19 @@ }, { "name": "setCommands", - "description": "Sets the list of commands supported by the bot; for bots only", + "description": "Sets the list of commands supported by the bot for the given user scope and language; for bots only", "class": "Ok", "properties": [ + { + "name": "scope", + "type": "BotCommandScope", + "description": "The scope to which the commands are relevant; pass null to change commands in the default bot command scope" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands" + }, { "name": "commands", "type": "vector\u003cbotCommand\u003e", @@ -19819,6 +23351,44 @@ "is_synchronous": false, "type": 3 }, + { + "name": "deleteCommands", + "description": "Deletes commands supported by the bot for the given user scope and language; for bots only", + "class": "Ok", + "properties": [ + { + "name": "scope", + "type": "BotCommandScope", + "description": "The scope to which the commands are relevant; pass null to delete commands in the default bot command scope" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 country code or an empty string" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "getCommands", + "description": "Returns the list of commands supported by the bot for the given user scope and language; for bots only", + "class": "BotCommands", + "properties": [ + { + "name": "scope", + "type": "BotCommandScope", + "description": "The scope to which the commands are relevant; pass null to get commands in the default bot command scope" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 country code or an empty string" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getActiveSessions", "description": "Returns all active sessions of the current user", @@ -19849,6 +23419,58 @@ "is_synchronous": false, "type": 2 }, + { + "name": "toggleSessionCanAcceptCalls", + "description": "Toggles whether a session can accept incoming calls", + "class": "Ok", + "properties": [ + { + "name": "session_id", + "type": "int64", + "description": "Session identifier" + }, + { + "name": "can_accept_calls", + "type": "Bool", + "description": "True, if incoming calls can be accepted by the session" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleSessionCanAcceptSecretChats", + "description": "Toggles whether a session can accept incoming secret chats", + "class": "Ok", + "properties": [ + { + "name": "session_id", + "type": "int64", + "description": "Session identifier" + }, + { + "name": "can_accept_secret_chats", + "type": "Bool", + "description": "True, if incoming secret chats can be accepted by the session" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setInactiveSessionTtl", + "description": "Changes the period of inactivity after which sessions will automatically be terminated", + "class": "Ok", + "properties": [ + { + "name": "inactive_session_ttl_days", + "type": "int32", + "description": "New number of days of inactivity before sessions will be automatically terminated; 1-366 days" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getConnectedWebsites", "description": "Returns all website where the current user used Telegram to log in", @@ -19886,7 +23508,7 @@ "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "Identifier of the supergroup or channel" }, { @@ -19900,12 +23522,12 @@ }, { "name": "setSupergroupStickerSet", - "description": "Changes the sticker set of a supergroup; requires can_change_info rights", + "description": "Changes the sticker set of a supergroup; requires can_change_info administrator right", "class": "Ok", "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "Identifier of the supergroup" }, { @@ -19919,12 +23541,12 @@ }, { "name": "toggleSupergroupSignMessages", - "description": "Toggles sender signatures messages sent in a channel; requires can_change_info rights", + "description": "Toggles whether sender signature is added to sent messages in a channel; requires can_change_info administrator right", "class": "Ok", "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "Identifier of the channel" }, { @@ -19938,12 +23560,12 @@ }, { "name": "toggleSupergroupIsAllHistoryAvailable", - "description": "Toggles whether the message history of a supergroup is available to new members; requires can_change_info rights", + "description": "Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right", "class": "Ok", "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "The identifier of the supergroup" }, { @@ -19956,24 +23578,33 @@ "type": 2 }, { - "name": "reportSupergroupSpam", - "description": "Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup", + "name": "toggleSupergroupIsBroadcastGroup", + "description": "Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup", "class": "Ok", "properties": [ { "name": "supergroup_id", - "type": "int32", - "description": "Supergroup identifier" - }, + "type": "int53", + "description": "Identifier of the supergroup" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reportSupergroupSpam", + "description": "Reports messages in a supergroup as spam; requires administrator rights in the supergroup", + "class": "Ok", + "properties": [ { - "name": "user_id", - "type": "int32", - "description": "User identifier" + "name": "supergroup_id", + "type": "int53", + "description": "Supergroup identifier" }, { "name": "message_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of messages sent in the supergroup by the user. This list must be non-empty" + "description": "Identifiers of messages to report" } ], "is_synchronous": false, @@ -19981,18 +23612,18 @@ }, { "name": "getSupergroupMembers", - "description": "Returns information about members or banned users in a supergroup or channel. Can be used only if SupergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters", + "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", "class": "ChatMembers", "properties": [ { "name": "supergroup_id", - "type": "int32", + "type": "int53", "description": "Identifier of the supergroup or channel" }, { "name": "filter", "type": "SupergroupMembersFilter", - "description": "The type of users to return. By default, supergroupMembersFilterRecent" + "description": "The type of users to return; pass null to use supergroupMembersFilterRecent" }, { "name": "offset", @@ -20008,20 +23639,6 @@ "is_synchronous": false, "type": 1 }, - { - "name": "deleteSupergroup", - "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", - "class": "Ok", - "properties": [ - { - "name": "supergroup_id", - "type": "int32", - "description": "Identifier of the supergroup or channel" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "closeSecretChat", "description": "Closes a secret chat, effectively transferring its state to secretChatStateClosed", @@ -20064,11 +23681,11 @@ { "name": "filters", "type": "chatEventLogFilters", - "description": "The types of events to return. By default, all types will be returned" + "description": "The types of events to return; pass null to get chat events of all types" }, { "name": "user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "User identifiers by which to filter events. By default, events relating to all users will be returned" } ], @@ -20077,7 +23694,7 @@ }, { "name": "getPaymentForm", - "description": "Returns an invoice payment form. This method should be called when the user presses inlineKeyboardButtonBuy", + "description": "Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy", "class": "PaymentForm", "properties": [ { @@ -20089,6 +23706,11 @@ "name": "message_id", "type": "int53", "description": "Message identifier" + }, + { + "name": "theme", + "type": "paymentFormTheme", + "description": "Preferred payment form theme; pass null to use the default theme" } ], "is_synchronous": false, @@ -20112,7 +23734,7 @@ { "name": "order_info", "type": "orderInfo", - "description": "The order information, provided by the user" + "description": "The order information, provided by the user; pass null if empty" }, { "name": "allow_save", @@ -20138,10 +23760,15 @@ "type": "int53", "description": "Message identifier" }, + { + "name": "payment_form_id", + "type": "int64", + "description": "Payment form identifier returned by getPaymentForm" + }, { "name": "order_info_id", "type": "string", - "description": "Identifier returned by ValidateOrderInfo, or an empty string" + "description": "Identifier returned by validateOrderInfo, or an empty string" }, { "name": "shipping_option_id", @@ -20152,6 +23779,11 @@ "name": "credentials", "type": "InputCredentials", "description": "The credentials chosen by user for payment" + }, + { + "name": "tip_amount", + "type": "int53", + "description": "Chosen by the user amount of tip in the smallest units of the currency" } ], "is_synchronous": false, @@ -20263,12 +23895,12 @@ { "name": "background", "type": "InputBackground", - "description": "The input background to use, null for filled backgrounds" + "description": "The input background to use; pass null to create a new filled backgrounds or to remove the current background" }, { "name": "type", "type": "BackgroundType", - "description": "Background type; null for default background. The method will return error 404 if type is null" + "description": "Background type; pass null to use the default type of the remote background or to remove the current background" }, { "name": "for_dark_theme", @@ -20350,7 +23982,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 shouldn't 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 doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization", "class": "Ok", "properties": [ { @@ -20454,7 +24086,7 @@ }, { "name": "other_user_ids", - "type": "vector\u003cint32\u003e", + "type": "vector\u003cint53\u003e", "description": "List of user identifiers of other users currently using the application" } ], @@ -20563,7 +24195,7 @@ { "name": "value", "type": "OptionValue", - "description": "The new value of the option" + "description": "The new value of the option; pass null to reset option value to a default value" } ], "is_synchronous": false, @@ -20621,7 +24253,7 @@ }, { "name": "reportChat", - "description": "Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if this is a private 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", + "description": "Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported", "class": "Ok", "properties": [ { @@ -20629,24 +24261,29 @@ "type": "int53", "description": "Chat identifier" }, + { + "name": "message_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of reported messages, if any" + }, { "name": "reason", "type": "ChatReportReason", "description": "The reason for reporting the chat" }, { - "name": "message_ids", - "type": "vector\u003cint53\u003e", - "description": "Identifiers of reported messages, if any" + "name": "text", + "type": "string", + "description": "Additional report details; 0-1024 characters" } ], "is_synchronous": false, "type": 2 }, { - "name": "getChatStatisticsUrl", - "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", + "name": "reportChatPhoto", + "description": "Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported", + "class": "Ok", "properties": [ { "name": "chat_id", @@ -20654,14 +24291,19 @@ "description": "Chat identifier" }, { - "name": "parameters", - "type": "string", - "description": "Parameters from \"tg://statsrefresh?params=******\" link" + "name": "file_id", + "type": "int32", + "description": "Identifier of the photo to report. Only full photos from chatPhoto can be reported" }, { - "name": "is_dark", - "type": "Bool", - "description": "Pass true if a URL with the dark theme must be returned" + "name": "reason", + "type": "ChatReportReason", + "description": "The reason for reporting the chat photo" + }, + { + "name": "text", + "type": "string", + "description": "Additional report details; 0-1024 characters" } ], "is_synchronous": false, @@ -20669,7 +24311,7 @@ }, { "name": "getChatStatistics", - "description": "Returns detailed statistics about a chat. Currently this method can be used only for supergroups and channels. Can be used only if SupergroupFullInfo.can_get_statistics == true", + "description": "Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true", "class": "ChatStatistics", "properties": [ { @@ -20688,7 +24330,7 @@ }, { "name": "getMessageStatistics", - "description": "Returns detailed statistics about a message. Can be used only if Message.can_get_statistics == true", + "description": "Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true", "class": "MessageStatistics", "properties": [ { @@ -20742,7 +24384,7 @@ { "name": "chat_limit", "type": "int32", - "description": "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" + "description": "The maximum number of chats with the largest storage usage for which separate statistics need to 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" } ], "is_synchronous": false, @@ -20772,7 +24414,7 @@ { "name": "size", "type": "int53", - "description": "Limit on the total size of files after deletion. Pass -1 to use the default limit" + "description": "Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit" }, { "name": "ttl", @@ -20792,17 +24434,17 @@ { "name": "file_types", "type": "vector\u003cFileType\u003e", - "description": "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" + "description": "If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted" }, { "name": "chat_ids", "type": "vector\u003cint53\u003e", - "description": "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)" + "description": "If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos)" }, { "name": "exclude_chat_ids", "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)" + "description": "If non-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", @@ -20820,13 +24462,13 @@ }, { "name": "setNetworkType", - "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. Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics", + "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 must be called whenever the network is changed, even if the network type remains the same. Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics", "class": "Ok", "properties": [ { "name": "type", "type": "NetworkType", - "description": "The new network type. By default, networkTypeOther" + "description": "The new network type; pass null to set network type to networkTypeOther" } ], "is_synchronous": false, @@ -20889,7 +24531,7 @@ { "name": "type", "type": "NetworkType", - "description": "Type of the network for which the new settings are applied" + "description": "Type of the network for which the new settings are relevant" } ], "is_synchronous": false, @@ -20982,7 +24624,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "User identifier" }, { @@ -20996,7 +24638,7 @@ }, { "name": "getPreferredCountryLanguage", - "description": "Returns an IETF language tag of the language preferred in the country, which should be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown", + "description": "Returns an IETF language tag of the language preferred in the country, which must be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown", "class": "Text", "properties": [ { @@ -21021,7 +24663,7 @@ { "name": "settings", "type": "phoneNumberAuthenticationSettings", - "description": "Settings for the authentication of the user's phone number" + "description": "Settings for the authentication of the user's phone number; pass null to use default settings" } ], "is_synchronous": false, @@ -21043,7 +24685,7 @@ { "name": "code", "type": "string", - "description": "Verification code" + "description": "Verification code to check" } ], "is_synchronous": false, @@ -21079,7 +24721,7 @@ { "name": "code", "type": "string", - "description": "Verification code" + "description": "Verification code to check" } ], "is_synchronous": false, @@ -21092,7 +24734,7 @@ "properties": [ { "name": "bot_user_id", - "type": "int32", + "type": "int53", "description": "User identifier of the service's bot" }, { @@ -21103,12 +24745,12 @@ { "name": "public_key", "type": "string", - "description": "Service's public_key" + "description": "Service's public key" }, { "name": "nonce", "type": "string", - "description": "Authorization form nonce provided by the service" + "description": "Unique request identifier provided by the service" } ], "is_synchronous": false, @@ -21154,23 +24796,23 @@ }, { "name": "sendPhoneNumberConfirmationCode", - "description": "Sends phone number confirmation code. Should be called when user presses \"https://t.me/confirmphone?phone=*******\u0026hash=**********\" or \"tg://confirmphone?phone=*******\u0026hash=**********\" link", + "description": "Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation", "class": "AuthenticationCodeInfo", "properties": [ { "name": "hash", "type": "string", - "description": "Value of the \"hash\" parameter from the link" + "description": "Hash value from the link" }, { "name": "phone_number", "type": "string", - "description": "Value of the \"phone\" parameter from the link" + "description": "Phone number value from the link" }, { "name": "settings", "type": "phoneNumberAuthenticationSettings", - "description": "Settings for the authentication of the user's phone number" + "description": "Settings for the authentication of the user's phone number; pass null to use default settings" } ], "is_synchronous": false, @@ -21192,7 +24834,7 @@ { "name": "code", "type": "string", - "description": "The phone number confirmation code" + "description": "Confirmation code to check" } ], "is_synchronous": false, @@ -21219,32 +24861,60 @@ }, { "name": "uploadStickerFile", - "description": "Uploads a PNG image with a sticker; for bots only; returns the uploaded file", + "description": "Uploads a file with a sticker; returns the uploaded file", "class": "File", "properties": [ { "name": "user_id", - "type": "int32", - "description": "Sticker file owner" + "type": "int53", + "description": "Sticker file owner; ignored for regular users" }, { - "name": "png_sticker", - "type": "InputFile", - "description": "PNG image with the sticker; must be up to 512 KB in size and fit in 512x512 square" + "name": "sticker", + "type": "InputSticker", + "description": "Sticker file to upload" } ], "is_synchronous": false, - "type": 3 + "type": 1 + }, + { + "name": "getSuggestedStickerSetName", + "description": "Returns a suggested name for a new sticker set with a given title", + "class": "Text", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Sticker set title; 1-64 characters" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "checkStickerSetName", + "description": "Checks whether a name can be used for a new sticker set", + "class": "CheckStickerSetNameResult", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Name to be checked" + } + ], + "is_synchronous": false, + "type": 1 }, { "name": "createNewStickerSet", - "description": "Creates a new sticker set; for bots only. Returns the newly created sticker set", + "description": "Creates a new sticker set. Returns the newly created sticker set", "class": "StickerSet", "properties": [ { "name": "user_id", - "type": "int32", - "description": "Sticker set owner" + "type": "int53", + "description": "Sticker set owner; ignored for regular users" }, { "name": "title", @@ -21254,7 +24924,7 @@ { "name": "name", "type": "string", - "description": "Sticker set name. Can contain only English letters, digits and underscores. Must end with *\"_by_\u003cbot username\u003e\"* (*\u003cbot_username\u003e* is case insensitive); 1-64 characters" + "description": "Sticker set name. Can contain only English letters, digits and underscores. Must end with *\"_by_\u003cbot username\u003e\"* (*\u003cbot_username\u003e* is case insensitive) for bots; 1-64 characters" }, { "name": "is_masks", @@ -21264,11 +24934,16 @@ { "name": "stickers", "type": "vector\u003cInputSticker\u003e", - "description": "List of stickers to be added to the set; must be non-empty. All stickers must be of the same type" + "description": "List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown" + }, + { + "name": "source", + "type": "string", + "description": "Source of the sticker set; may be empty if unknown" } ], "is_synchronous": false, - "type": 3 + "type": 1 }, { "name": "addStickerToSet", @@ -21277,7 +24952,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Sticker set owner" }, { @@ -21301,7 +24976,7 @@ "properties": [ { "name": "user_id", - "type": "int32", + "type": "int53", "description": "Sticker set owner" }, { @@ -21312,7 +24987,7 @@ { "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" + "description": "Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them" } ], "is_synchronous": false, @@ -21466,7 +25141,7 @@ }, { "name": "getCountryCode", - "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", + "description": "Uses the current IP address to find the current country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization", "class": "Text", "properties": [], "is_synchronous": false, @@ -21487,9 +25162,28 @@ "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", - "class": "Text", + "name": "getPhoneNumberInfoSync", + "description": "Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after changing localization to the specified language if properly localized country information is expected. Can be called synchronously", + "class": "PhoneNumberInfo", + "properties": [ + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 country code for country information localization" + }, + { + "name": "phone_number_prefix", + "type": "string", + "description": "The phone number prefix" + } + ], + "is_synchronous": true, + "type": 1 + }, + { + "name": "getApplicationDownloadLink", + "description": "Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram", + "class": "HttpUrl", "properties": [], "is_synchronous": false, "type": 2 @@ -21558,7 +25252,7 @@ { "name": "enable", "type": "Bool", - "description": "True, if the proxy should be enabled" + "description": "True, if the proxy needs to be enabled" }, { "name": "type", @@ -21592,7 +25286,7 @@ { "name": "enable", "type": "Bool", - "description": "True, if the proxy should be enabled" + "description": "True, if the proxy needs to be enabled" }, { "name": "type", @@ -21650,7 +25344,7 @@ { "name": "getProxyLink", "description": "Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization", - "class": "Text", + "class": "HttpUrl", "properties": [ { "name": "proxy_id", @@ -21768,7 +25462,7 @@ { "name": "verbosity_level", "type": "int32", - "description": "The minimum verbosity level needed for the message to be logged, 0-1023" + "description": "The minimum verbosity level needed for the message to be logged; 0-1023" }, { "name": "text", diff --git a/data/td_api.tl b/data/td_api.tl index 0b02922..d973c2b 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -52,11 +52,14 @@ authenticationCodeTypeSms length:int32 = AuthenticationCodeType; //@description An authentication code is delivered via a phone call to the specified phone number @length Length of the code authenticationCodeTypeCall length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered by an immediately cancelled call to the specified phone number. The number from which the call was made is the code @pattern Pattern of the phone number from which the call will be made +//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically @pattern Pattern of the phone number from which the call will be made authenticationCodeTypeFlashCall pattern:string = AuthenticationCodeType; +//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user @phone_number_prefix Prefix of the phone number from which the call will be made @length Number of digits in the code, excluding the prefix +authenticationCodeTypeMissedCall phone_number_prefix:string length:int32 = AuthenticationCodeType; -//@description Information about the authentication code that was sent @phone_number A phone number that is being authenticated @type Describes the way the code was sent to the user @next_type Describes the way the next code will be sent to the user; may be null @timeout Timeout before the code should be re-sent, in seconds + +//@description Information about the authentication code that was sent @phone_number A phone number that is being authenticated @type The way the code was sent to the user @next_type The way the next code will be sent to the user; may be null @timeout Timeout before the code can be re-sent, in seconds authenticationCodeInfo phone_number:string type:AuthenticationCodeType next_type:AuthenticationCodeType timeout:int32 = AuthenticationCodeInfo; //@description Information about the email address authentication code that was sent @email_address_pattern Pattern of the email address to which an authentication code was sent @length Length of the code; 0 if unknown @@ -112,14 +115,15 @@ authorizationStateLoggingOut = AuthorizationState; authorizationStateClosing = AuthorizationState; //@description TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to -//-with error code 500. To continue working, one should create a new instance of the TDLib client +//-with error code 500. To continue working, one must create a new instance of the TDLib client authorizationStateClosed = AuthorizationState; //@description Represents the current state of 2-step verification @has_password True, if a 2-step verification password is set @password_hint Hint for the password; may be empty //@has_recovery_email_address True, if a recovery email is set @has_passport_data True, if some Telegram Passport elements were saved //@recovery_email_address_code_info Information about the recovery email address to which the confirmation email was sent; may be null -passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo = PasswordState; +//@pending_reset_date If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword +passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo pending_reset_date:int32 = PasswordState; //@description Contains information about the current recovery email address @recovery_email_address Recovery email address recoveryEmailAddress recovery_email_address:string = RecoveryEmailAddress; @@ -131,29 +135,29 @@ temporaryPasswordState has_password:Bool valid_for:int32 = TemporaryPasswordStat //@description Represents a local file //@path Local path to the locally available file part; may be empty -//@can_be_downloaded True, if it is possible to try to download or generate the file +//@can_be_downloaded True, if it is possible to download or generate the file //@can_be_deleted True, if the file can be deleted //@is_downloading_active True, if the file is currently being downloaded (or a local copy is being generated by some other means) //@is_downloading_completed True, if the local copy is fully available //@download_offset Download will be started from this offset. downloaded_prefix_size is calculated from this offset -//@downloaded_prefix_size If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix -//@downloaded_size Total downloaded file bytes. Should be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage +//@downloaded_prefix_size If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes +//@downloaded_size Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_active:Bool is_downloading_completed:Bool download_offset:int32 downloaded_prefix_size:int32 downloaded_size:int32 = LocalFile; //@description Represents a remote file //@id Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. //-If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. -//-If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application 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 must generate the file by downloading it to the specified location //@unique_id Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time //@is_uploading_active True, if the file is currently being uploaded (or a remote copy is being generated by some other means) //@is_uploading_completed True, if a remote copy is fully available -//@uploaded_size Size of the remote available part of the file; 0 if unknown +//@uploaded_size Size of the remote available part of the file, in bytes; 0 if unknown remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_completed:Bool uploaded_size:int32 = RemoteFile; //@description Represents a file //@id Unique file identifier -//@size File size; 0 if unknown -//@expected_size Expected file size in case the exact file size is unknown, but an approximate size is known. Can be used to show download/upload progress +//@size File size, in bytes; 0 if unknown +//@expected_size Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress //@local Information about the local copy of the file //@remote Information about the remote copy of the file file id:int32 size:int32 expected_size:int32 local:localFile remote:remoteFile = File; @@ -173,14 +177,14 @@ inputFileRemote id:string = InputFile; inputFileLocal path:string = InputFile; //@description A file generated by the application @original_path Local path to a file from which the file is generated; may be empty if there is no such file -//@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 +//@conversion String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage +//@expected_size Expected size of the generated file, in bytes; 0 if unknown inputFileGenerated original_path:string conversion:string expected_size:int32 = InputFile; //@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 +//@progressive_sizes Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes photoSize type:string photo:file width:int32 height:int32 progressive_sizes:vector = PhotoSize; //@description Thumbnail image of a very poor quality and low resolution @width Thumbnail width, usually doesn't exceed 40 @height Thumbnail height, usually doesn't exceed 40 @data The thumbnail in JPEG format @@ -212,28 +216,32 @@ thumbnailFormatMpeg4 = ThumbnailFormat; 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 +//@class MaskPoint @description Part of the face, relative to which a mask is placed -//@description A mask should be placed relatively to the forehead +//@description The mask is placed relatively to the forehead maskPointForehead = MaskPoint; -//@description A mask should be placed relatively to the eyes +//@description The mask is placed relatively to the eyes maskPointEyes = MaskPoint; -//@description A mask should be placed relatively to the mouth +//@description The mask is placed relatively to the mouth maskPointMouth = MaskPoint; -//@description A mask should be placed relatively to the chin +//@description The mask is placed relatively to the chin maskPointChin = MaskPoint; -//@description Position on a photo where a mask should be placed @point Part of the face, relative to which the mask should be placed +//@description Position on a photo where a mask is placed @point Part of the face, relative to which the mask is placed //@x_shift Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position) //@y_shift Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. (For example, 1.0 will place the mask just below the default mask position) //@scale Mask scaling coefficient. (For example, 2.0 means a doubled size) maskPosition point:MaskPoint x_shift:double y_shift:double scale:double = MaskPosition; -//@description Describes one answer option of a poll @text Option text, 1-100 characters @voter_count Number of voters for this option, available only for closed or voted polls @vote_percentage The percentage of votes for this option, 0-100 +//@description Represents a closed vector path. The path begins at the end point of the last command @commands List of vector path commands +closedVectorPath commands:vector = ClosedVectorPath; + + +//@description Describes one answer option of a poll @text Option text; 1-100 characters @voter_count Number of voters for this option, available only for closed or voted polls @vote_percentage The percentage of votes for this option; 0-100 //@is_chosen True, if the option was chosen by the user @is_being_chosen True, if the option is being chosen by a pending setPollAnswer request pollOption text:string voter_count:int32 vote_percentage:int32 is_chosen:Bool is_being_chosen:Bool = PollOption; @@ -245,7 +253,7 @@ 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 -//@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 +//@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; @@ -257,7 +265,7 @@ animation duration:int32 width:int32 height:int32 file_name:string mime_type:str //@description Describes an audio file. Audio is usually in MP3 or M4A format @duration Duration of the audio, in seconds; as defined by the sender @title Title of the audio; as defined by the sender @performer Performer of the audio; as defined by the sender //@file_name Original name of the file; as defined by the sender @mime_type The MIME type of the file; as defined by the sender @album_cover_minithumbnail The minithumbnail of the album cover; may be null -//@album_cover_thumbnail The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null @audio File containing the audio +//@album_cover_thumbnail The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null @audio File containing the audio audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:thumbnail audio:file = Audio; //@description Describes 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 @@ -269,14 +277,14 @@ document file_name:string mime_type:string minithumbnail:minithumbnail thumbnail photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector = Photo; //@description Describes a sticker @set_id The identifier of the sticker set to which the sticker belongs; 0 if none @width Sticker width; as defined by the sender @height Sticker height; as defined by the sender -//@emoji Emoji corresponding to the sticker @is_animated True, if the sticker is an animated sticker in TGS format @is_mask True, if the sticker is a mask @mask_position Position where the mask 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; +//@emoji Emoji corresponding to the sticker @is_animated True, if the sticker is an animated sticker in TGS format @is_mask True, if the sticker is a mask @mask_position Position where the mask is placed; may be null +//@outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner @thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @sticker File containing the sticker +sticker set_id:int64 width:int32 height:int32 emoji:string is_animated:Bool is_mask:Bool mask_position:maskPosition outline:vector thumbnail:thumbnail sticker:file = Sticker; //@description Describes a video file @duration Duration of the video, in seconds; as defined by the sender @width Video width; as defined by the sender @height Video height; as defined by the sender //@file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender //@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 +//@supports_streaming True, if the video is supposed to be streamed @minithumbnail Video minithumbnail; may be null //@thumbnail Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null @video File containing the video video duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool supports_streaming:Bool minithumbnail:minithumbnail thumbnail:thumbnail video:file = Video; @@ -289,14 +297,20 @@ videoNote duration:int32 length:int32 minithumbnail:minithumbnail thumbnail:thum //@waveform A waveform representation of the voice note in 5-bit format @mime_type MIME type of the file; as defined by the sender @voice File containing the voice note voiceNote duration:int32 waveform:bytes mime_type:string voice:file = VoiceNote; +//@description Describes an animated representation of an emoji +//@sticker Animated sticker for the emoji +//@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none +//@sound File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container +animatedEmoji sticker:sticker fitzpatrick_type:int32 sound:file = AnimatedEmoji; + //@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0 -contact phone_number:string first_name:string last_name:string vcard:string user_id:int32 = Contact; +contact phone_number:string first_name:string last_name:string vcard:string user_id:int53 = Contact; //@description Describes a location on planet Earth @latitude Latitude of the location in degrees; as defined by the sender @longitude Longitude of the location, in degrees; as defined by the sender //@horizontal_accuracy The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown location latitude:double longitude:double horizontal_accuracy:double = Location; -//@description Describes a venue @location Venue location; as defined by the sender @title Venue name; as defined by the sender @address Venue address; as defined by the sender @provider Provider of the venue database; as defined by the sender. Currently only "foursquare" and "gplaces" (Google Places) need to be supported +//@description Describes a venue @location Venue location; as defined by the sender @title Venue name; as defined by the sender @address Venue address; as defined by the sender @provider Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported //@id Identifier of the venue in the provider database; as defined by the sender @type Type of the venue in the provider database; as defined by the sender venue location:location title:string address:string provider:string id:string type:string = Venue; @@ -304,24 +318,26 @@ 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-300 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 -//@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; +//@open_period Amount of time the poll will be active after creation, in seconds @close_date Point in time (Unix timestamp) when the poll will automatically be closed @is_closed True, if the poll is closed +poll id:int64 question:string options:vector total_voter_count:int32 recent_voter_user_ids:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; //@description Describes a user profile photo @id Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos //@small A small (160x160) user profile photo. The file can be downloaded only before the photo is changed //@big A big (640x640) user profile photo. The file can be downloaded only before the photo is changed +//@minithumbnail User profile photo minithumbnail; may be null //@has_animation True, if the photo has animated variant -profilePhoto id:int64 small:file big:file has_animation:Bool = ProfilePhoto; +profilePhoto id:int64 small:file big:file minithumbnail:minithumbnail has_animation:Bool = ProfilePhoto; //@description Contains basic information about the photo of a chat //@small A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed //@big A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed +//@minithumbnail Chat photo minithumbnail; may be null //@has_animation True, if the photo has animated variant -chatPhotoInfo small:file big:file has_animation:Bool = ChatPhotoInfo; +chatPhotoInfo small:file big:file minithumbnail:minithumbnail has_animation:Bool = ChatPhotoInfo; //@class UserType @description Represents the type of a user. The following types are possible: regular users, deleted users and bots @@ -334,7 +350,7 @@ 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 application 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 is expected to be sent with every inline query to this bot userTypeBot can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool = UserType; //@description No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type @@ -344,8 +360,8 @@ userTypeUnknown = UserType; //@description Represents a command supported by a bot @command Text of the bot command @param_description Description of the bot command botCommand command:string description:string = BotCommand; -//@description 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 -botInfo description:string commands:vector = BotInfo; +//@description Contains a list of bot commands @bot_user_id Bot's user identifier @commands List of bot commands +botCommands bot_user_id:int53 commands:vector = BotCommands; //@description Represents a location to which a chat is connected @location The location @address Location address; 1-64 characters, as defined by the chat owner @@ -373,7 +389,7 @@ 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 +//@description A previously used profile photo of the current user @chat_photo_id Identifier of the current user's 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 @@ -399,10 +415,11 @@ inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputC //@is_support True, if the user is Telegram support account //@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted //@is_scam True, if many users reported this user as a scam +//@is_fake True, if many users reported this user as a fake account //@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser //@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; +user id:int53 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string = User; //@description Contains full information about a user //@photo User profile photo; may be null @@ -410,18 +427,21 @@ user id:int32 first_name:string last_name:string username:string phone_number:st //@can_be_called True, if the user can be called //@supports_video_calls True, if a video call can be created with the user //@has_private_calls True, if the user can't be called due to their privacy settings +//@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings //@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 +//@bio A short user bio +//@share_text For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot +//@param_description For bots, the text shown in the chat with the bot if the chat is empty //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user -//@bot_info 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; +//@commands For bots, list of the bot commands +userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool need_phone_number_privacy_exception:Bool bio:string share_text:string description:string group_in_common_count:int32 commands:vector = UserFullInfo; //@description Represents a list of users @total_count Approximate total count of users found @user_ids A list of user identifiers -users total_count:int32 user_ids:vector = Users; +users total_count:int32 user_ids:vector = Users; //@description Contains information about a chat administrator @user_id User identifier of the administrator @custom_title Custom title of the administrator @is_owner True, if the user is the owner of the chat -chatAdministrator user_id:int32 custom_title:string is_owner:Bool = ChatAdministrator; +chatAdministrator user_id:int53 custom_title:string is_owner:Bool = ChatAdministrator; //@description Represents a list of chat administrators @administrators A list of chat administrators chatAdministrators administrators:vector = ChatAdministrators; @@ -441,27 +461,29 @@ chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_pol //@class ChatMemberStatus @description Provides information about the status of a member in a chat -//@description The user is the owner of a chat and has all the administrator privileges +//@description The user is the owner of the 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_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 +//@description The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges //@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only //@can_be_edited True, if the current user can edit the administrator privileges for the called user +//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only //@can_change_info True, if the administrator can change the chat title, photo, and other settings //@can_post_messages True, if the administrator can create channel posts; applicable to channels only //@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only //@can_delete_messages True, if the administrator can delete messages of other users //@can_invite_users True, if the administrator can invite new users to the chat -//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members -//@can_pin_messages True, if the administrator can pin messages; applicable to groups only +//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels +//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only //@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them +//@can_manage_video_chats True, if the administrator can manage video chats //@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only -chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_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; +chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatMemberStatus; -//@description The user is a member of a chat, without any additional privileges or restrictions +//@description The user is a member of the chat, without any additional privileges or restrictions chatMemberStatusMember = ChatMemberStatus; //@description The user is under certain restrictions in the chat. Not supported in basic groups and channels @@ -470,20 +492,20 @@ chatMemberStatusMember = ChatMemberStatus; //@permissions User permissions in the chat chatMemberStatusRestricted is_member:Bool restricted_until_date:int32 permissions:chatPermissions = ChatMemberStatus; -//@description The user is not a chat member +//@description The user or the chat is not a chat member chatMemberStatusLeft = ChatMemberStatus; -//@description The user was banned (and hence is not a member of the chat). Implies the user can't return to the chat or view messages -//@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever +//@description The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat +//@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus; -//@description A user with information about joining/leaving a chat @user_id User identifier of the chat member +//@description Describes a user or a chat as a member of another chat +//@member_id Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels //@inviter_user_id Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown //@joined_chat_date Point in time (Unix timestamp) when the user joined the chat //@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; +chatMember member_id:MessageSender inviter_user_id:int53 joined_chat_date:int32 status:ChatMemberStatus = ChatMember; //@description Contains a list of chat members @total_count Approximate total count of chat members found @members A list of chat members chatMembers total_count:int32 members:vector = ChatMembers; @@ -540,21 +562,78 @@ supergroupMembersFilterMention query:string message_thread_id:int53 = Supergroup supergroupMembersFilterBots = SupergroupMembersFilter; +//@description Contains a chat invite link +//@invite_link Chat invite link +//@name Name of the link +//@creator_user_id User identifier of an administrator created the link +//@date Point in time (Unix timestamp) when the link was created +//@edit_date Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown +//@expiration_date Point in time (Unix timestamp) when the link will expire; 0 if never +//@member_limit The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval +//@member_count Number of chat members, which joined the chat using the link +//@pending_join_request_count Number of pending join requests created using this link +//@creates_join_request True, if the link only creates join request. If true, total number of joining members will be unlimited +//@is_primary True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time +//@is_revoked True, if the link was revoked +chatInviteLink invite_link:string name:string creator_user_id:int53 date:int32 edit_date:int32 expiration_date:int32 member_limit:int32 member_count:int32 pending_join_request_count:int32 creates_join_request:Bool is_primary:Bool is_revoked:Bool = ChatInviteLink; + +//@description Contains a list of chat invite links @total_count Approximate total count of chat invite links found @invite_links List of invite links +chatInviteLinks total_count:int32 invite_links:vector = ChatInviteLinks; + +//@description Describes a chat administrator with a number of active and revoked chat invite links +//@user_id Administrator's user identifier +//@invite_link_count Number of active invite links +//@revoked_invite_link_count Number of revoked invite links +chatInviteLinkCount user_id:int53 invite_link_count:int32 revoked_invite_link_count:int32 = ChatInviteLinkCount; + +//@description Contains a list of chat invite link counts @invite_link_counts List of invite link counts +chatInviteLinkCounts invite_link_counts:vector = ChatInviteLinkCounts; + +//@description Describes a chat member joined a chat via an invite link @user_id User identifier @joined_chat_date Point in time (Unix timestamp) when the user joined the chat @approver_user_id User identifier of the chat administrator, approved user join request +chatInviteLinkMember user_id:int53 joined_chat_date:int32 approver_user_id:int53 = ChatInviteLinkMember; + +//@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total count of chat members found @members List of chat members, joined a chat via an invite link +chatInviteLinkMembers total_count:int32 members:vector = ChatInviteLinkMembers; + +//@description Contains information about a chat invite link +//@chat_id Chat identifier of the invite link; 0 if the user has no access to the chat before joining +//@accessible_for If non-zero, the amount of time for which read access to the chat will remain available, in seconds +//@type Type of the chat +//@title Title of the chat +//@photo Chat photo; may be null +//@param_description Chat description +//@member_count Number of members in the chat +//@member_user_ids User identifiers of some chat members that may be known to the current user +//@creates_join_request True, if the link only creates join request +//@is_public True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup +chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string photo:chatPhotoInfo description:string member_count:int32 member_user_ids:vector creates_join_request:Bool is_public:Bool = ChatInviteLinkInfo; + +//@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user +chatJoinRequest user_id:int53 date:int32 bio:string = ChatJoinRequest; + +//@description Contains a list of requests to join a chat @total_count Approximate total count of requests found @requests List of the requests +chatJoinRequests total_count:int32 requests:vector = ChatJoinRequests; + +//@description Contains information about pending join requests for a chat @total_count Total number of pending join requests @user_ids Identifiers of at most 3 users sent the newest pending join requests +chatJoinRequestsInfo total_count:int32 user_ids:vector = ChatJoinRequestsInfo; + + //@description Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users) //@id Group identifier //@member_count Number of members in the group //@status Status of the current user in the group //@is_active True, if the group is active //@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; +basicGroup id:int53 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int53 = BasicGroup; //@description Contains full information about a basic group //@photo Chat photo; may be null -//@param_description Group description +//@param_description Group description. Updated only after the basic group is opened //@creator_user_id User identifier of the creator of the group; 0 if unknown //@members Group members -//@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; +//@invite_link Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened +//@bot_commands List of commands of bots in the group +basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 members:vector invite_link:chatInviteLink bot_commands:vector = BasicGroupFullInfo; //@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 @@ -562,16 +641,18 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int32 memb //@username Username of the supergroup or channel; empty for private supergroups or channels //@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member //@status Status of the current user in the supergroup or channel; custom title will be always empty -//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules +//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup -//@sign_messages True, if messages sent to the channel should contain information about the sender. This field is only applicable to channels +//@sign_messages True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels //@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup //@is_channel True, if the supergroup is a channel +//@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members //@is_verified True, if the supergroup or channel is verified //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted -//@is_scam True, if many users reported this supergroup as a scam -supergroup id:int32 username:string date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool is_slow_mode_enabled:Bool is_channel:Bool is_verified:Bool restriction_reason:string is_scam:Bool = Supergroup; +//@is_scam True, if many users reported this supergroup or channel as a scam +//@is_fake True, if many users reported this supergroup or channel as a fake account +supergroup id:int53 username:string date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup; //@description Contains full information about a supergroup or channel //@photo Chat photo; may be null @@ -591,10 +672,11 @@ supergroup id:int32 username:string date:int32 status:ChatMemberStatus member_co //@is_all_history_available True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators //@sticker_set_id Identifier of the supergroup sticker set; 0 if none //@location Location to which the supergroup is connected; may be null -//@invite_link Invite link for this chat +//@invite_link Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only +//@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool can_set_username:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool is_all_history_available:Bool sticker_set_id:int64 location:chatLocation invite_link:string upgraded_from_basic_group_id:int32 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool can_set_username:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool is_all_history_available:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -614,17 +696,16 @@ secretChatStateClosed = SecretChatState; //@user_id Identifier of the chat partner //@state State of the secret chat //@is_outbound True, if the chat was created by the current user; otherwise false -//@ttl Current message Time To Live setting (self-destruct timer) for the chat, in seconds //@key_hash Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. //-The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers -//@layer Secret chat layer; determines features supported by the chat partner's application. 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; +//@layer Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101 +secretChat id:int32 user_id:int53 state:SecretChatState is_outbound:Bool 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; +messageSenderUser user_id:int53 = MessageSender; //@description The message was sent on behalf of a chat @chat_id Identifier of the chat that sent the message messageSenderChat chat_id:int53 = MessageSender; @@ -637,11 +718,11 @@ messageSenders total_count:int32 senders:vector = MessageSenders; //@class MessageForwardOrigin @description Contains information about the origin of a forwarded message //@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message -messageForwardOriginUser sender_user_id:int32 = MessageForwardOrigin; +messageForwardOriginUser sender_user_id:int53 = MessageForwardOrigin; -//@description The message was originally sent by an anonymous chat administrator on behalf of the chat +//@description The message was originally sent on behalf of a chat //@sender_chat_id Identifier of the chat that originally sent the message -//@author_signature Original message author signature +//@author_signature For messages originally sent by an anonymous chat administrator, original message author signature messageForwardOriginChat sender_chat_id:int53 author_signature:string = MessageForwardOrigin; //@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender @@ -653,6 +734,9 @@ messageForwardOriginHiddenUser sender_name:string = MessageForwardOrigin; //@author_signature Original post author signature messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin; +//@description The message was imported from an exported message history @sender_name Name of the sender +messageForwardOriginMessageImport sender_name:string = MessageForwardOrigin; + //@description Contains information about a forwarded message //@origin Origin of a forwarded message @@ -664,16 +748,16 @@ messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announc //@description Contains information about replies to a message //@reply_count Number of times the message was directly or indirectly replied -//@recent_repliers Recent repliers to the message; available in channels with a discussion supergroup +//@recent_replier_ids Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available //@last_read_inbox_message_id Identifier of the last read incoming reply to the message //@last_read_outbox_message_id Identifier of the last read outgoing reply to the message //@last_message_id Identifier of the last reply to the message -messageReplyInfo reply_count:int32 recent_repliers:vector last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 last_message_id:int53 = MessageReplyInfo; +messageReplyInfo reply_count:int32 recent_replier_ids:vector last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 last_message_id:int53 = MessageReplyInfo; //@description Contains information about 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 +//@reply_info Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo = MessageInteractionInfo; @@ -683,24 +767,30 @@ messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageRe messageSendingStatePending = MessageSendingState; //@description The message failed to be sent @error_code An error code; 0 if unknown @error_message Error message -//@can_retry True, if the message can be re-sent @retry_after Time left before the message can be re-sent, in seconds. No update is sent when this field changes -messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool retry_after:double = MessageSendingState; +//@can_retry True, if the message can be re-sent +//@need_another_sender True, if the message can be re-sent only on behalf of a different sender +//@retry_after Time left before the message can be re-sent, in seconds. No update is sent when this field changes +messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool need_another_sender:Bool retry_after:double = MessageSendingState; //@description Describes a message //@id Message identifier; unique for the chat to which the message belongs -//@sender The sender of the message +//@sender_id Identifier of 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 +//@sending_state The sending state of the message; may be null +//@scheduling_state The scheduling state of the message; may be null //@is_outgoing True, if the message is outgoing //@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_saved True, if content of the message can be saved locally or copied //@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it //@can_be_deleted_for_all_users True, if the message can be deleted for all users //@can_get_statistics True, if the message statistics are available //@can_get_message_thread True, if the message thread info is available +//@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers +//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description +//@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message //@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts //@contains_unread_mention True, if the message contains an unread mention for the current user //@date Point in time (Unix timestamp) when the message was sent @@ -711,14 +801,14 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool r //@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 +//@ttl_expires_in Time left before the message expires, in seconds. If the TTL timer isn't started yet, equals to the value of the ttl field //@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent //@author_signature For channel posts and anonymous group messages, optional author signature -//@media_album_id Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums +//@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null -message id:int53 sender: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; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; //@description Contains a list of messages @total_count Approximate total count of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; @@ -726,8 +816,28 @@ messages total_count:int32 messages:vector = Messages; //@description Contains a list of messages found by a search @total_count Approximate total count of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results foundMessages total_count:int32 messages:vector next_offset:string = FoundMessages; +//@description Contains information about a message in a specific position @position 0-based message position in the full list of suitable messages @message_id Message identifier @date Point in time (Unix timestamp) when the message was sent +messagePosition position:int32 message_id:int53 date:int32 = MessagePosition; -//@class NotificationSettingsScope @description Describes the types of chats to which notification settings are applied +//@description Contains a list of message positions @total_count Total count of messages found @positions List of message positions +messagePositions total_count:int32 positions:vector = MessagePositions; + +//@description Contains information about found messages sent on a specific day @total_count Total number of found messages sent on the day @message First message sent on the day +messageCalendarDay total_count:int32 message:message = MessageCalendarDay; + +//@description Contains information about found messages, split by days according to the option "utc_time_offset" @total_count Total number of found messages @days Information about messages sent +messageCalendar total_count:int32 days:vector = MessageCalendar; + + +//@description Describes a sponsored message +//@message_id Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages +//@sponsor_chat_id Chat identifier +//@link An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead +//@content Content of the message. Currently, can be only of the type messageText +sponsoredMessage message_id:int53 sponsor_chat_id:int53 link:InternalLinkType content:MessageContent = SponsoredMessage; + + +//@class NotificationSettingsScope @description Describes the types of chats to which notification settings are relevant //@description Notification settings applied to all private and secret chats when the corresponding chat setting has a default value notificationSettingsScopePrivateChats = NotificationSettingsScope; @@ -742,7 +852,7 @@ notificationSettingsScopeChannelChats = NotificationSettingsScope; //@description Contains information about notification settings for a chat //@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat is used instead @mute_for Time left before notifications will be unmuted, in seconds //@use_default_sound If true, sound is ignored and the value for the relevant type of chat is used instead @sound The name of an audio file to be used for notification sounds; only applies to iOS applications -//@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat is used instead @show_preview True, if message content should be displayed in notifications +//@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat is used instead @show_preview True, if message content must be displayed in notifications //@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead @disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message //@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead @disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound:string use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; @@ -750,7 +860,7 @@ chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_so //@description Contains information about notification settings for several chats //@mute_for Time left before notifications will be unmuted, in seconds //@sound The name of an audio file to be used for notification sounds; only applies to iOS applications -//@show_preview True, if message content should be displayed in notifications +//@show_preview True, if message content must be displayed in notifications //@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message //@disable_mention_notifications True, if notifications for messages with mentions will be created as for an ordinary unread message scopeNotificationSettings mute_for:int32 sound:string show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; @@ -759,28 +869,28 @@ scopeNotificationSettings mute_for:int32 sound:string show_preview:Bool disable_ //@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 +//@input_message_text Content of the message draft; must be of the type inputMessageText draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage; //@class ChatType @description Describes the type of a chat //@description An ordinary chat with a user @user_id User identifier -chatTypePrivate user_id:int32 = ChatType; +chatTypePrivate user_id:int53 = ChatType; -//@description A basic group (i.e., a chat with 0-200 other users) @basic_group_id Basic group identifier -chatTypeBasicGroup basic_group_id:int32 = ChatType; +//@description A basic group (a chat with 0-200 other users) @basic_group_id Basic group identifier +chatTypeBasicGroup basic_group_id:int53 = ChatType; -//@description A supergroup (i.e. a chat with up to GetOption("supergroup_max_size") other users), or channel (with unlimited members) @supergroup_id Supergroup or channel identifier @is_channel True, if the supergroup is a channel -chatTypeSupergroup supergroup_id:int32 is_channel:Bool = ChatType; +//@description A supergroup or channel (with unlimited members) @supergroup_id Supergroup or channel identifier @is_channel True, if the supergroup is a channel +chatTypeSupergroup supergroup_id:int53 is_channel:Bool = ChatType; //@description A secret chat with a user @secret_chat_id Secret chat identifier @user_id User identifier of the secret chat peer -chatTypeSecret secret_chat_id:int32 user_id:int32 = ChatType; +chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; //@description Represents a filter of user chats //@title The title of the filter; 1-12 characters without line feeds -//@icon_name The icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". +//@icon_name The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". //-If empty, use getChatFilterDefaultIconName to get default icon name for the filter //@pinned_chat_ids The chat identifiers of pinned chats in the filtered chat list //@included_chat_ids The chat identifiers of always included chats in the filtered chat list @@ -798,7 +908,7 @@ chatFilter title:string icon_name:string pinned_chat_ids:vector included_ //@description Contains basic information about a chat filter //@id Unique chat filter identifier //@title The title of the filter; 1-12 characters without line feeds -//@icon_name The icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" +//@icon_name The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" chatFilterInfo id:int32 title:string icon_name:string = ChatFilterInfo; //@description Describes a recommended chat filter @filter The chat filter @param_description Chat filter description @@ -840,6 +950,13 @@ chatSourcePublicServiceAnnouncement type:string text:string = ChatSource; chatPosition list:ChatList order:int64 is_pinned:Bool source:ChatSource = ChatPosition; +//@description Describes a video chat +//@group_call_id Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall +//@has_participants True, if the video chat has participants +//@default_participant_id Default group call participant identifier to join the video chat; may be null +videoChat group_call_id:int32 has_participants:Bool default_participant_id:MessageSender = VideoChat; + + //@description A chat. (Can be a private chat, basic group, supergroup, or secret chat) //@id Chat unique identifier //@type Type of the chat @@ -848,23 +965,29 @@ chatPosition list:ChatList order:int64 is_pinned:Bool source:ChatSource = ChatPo //@permissions Actions that non-administrator chat members are allowed to take in the chat //@last_message Last message in the chat; may be null //@positions Positions of the chat in chat lists +//@message_sender_id Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender +//@has_protected_content True, if chat content can't be saved locally, forwarded, or copied //@is_marked_as_unread True, if the chat is marked as unread //@is_blocked True, if the chat is blocked by the current user and private messages from the chat can't be received //@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 -//@can_be_reported True, if the chat can be reported to Telegram moderators through reportChat +//@can_be_reported True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto //@default_disable_notification Default value of the disable_notification parameter, used when a message is sent to the chat //@unread_count Number of unread messages in the chat //@last_read_inbox_message_id Identifier of the last read incoming message //@last_read_outbox_message_id Identifier of the last read outgoing message //@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 +//@message_ttl Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats +//@theme_name If non-empty, name of a theme, set for the chat +//@action_bar Information about actions which must be possible to do through the chat action bar; may be null +//@video_chat Information about video chat of the chat +//@pending_join_requests Information about pending join requests; may be null //@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 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; +//@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used +chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings message_ttl:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@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; @@ -877,21 +1000,6 @@ chatNearby chat_id:int53 distance:int32 = ChatNearby; chatsNearby users_nearby:vector supergroups_nearby:vector = ChatsNearby; -//@description Contains a chat invite link @invite_link Chat invite link -chatInviteLink invite_link:string = ChatInviteLink; - -//@description Contains information about a chat invite link -//@chat_id Chat identifier of the invite link; 0 if the user has no access to the chat before joining -//@accessible_for If non-zero, the amount of time for which read access to the chat will remain available, in seconds -//@type Contains information about the type of the chat -//@title Title of the chat -//@photo Chat photo; may be null -//@member_count Number of members in the chat -//@member_user_ids User identifiers of some chat members that may be known to the current user -//@is_public True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup -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 //@description The chat is public, because it has username @@ -901,7 +1009,7 @@ publicChatTypeHasUsername = PublicChatType; publicChatTypeIsLocationBased = PublicChatType; -//@class ChatActionBar @description Describes actions which should be possible to do through a chat action bar +//@class ChatActionBar @description Describes actions which must 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 //@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 @@ -910,7 +1018,10 @@ 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 blocked using the method blockUser, or the other user can be added to the contact list using the method addContact +//@description The chat is a recently created group chat to which new members can be invited +chatActionBarInviteMembers = 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 toggleMessageSenderIsBlocked, 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; @@ -921,10 +1032,16 @@ chatActionBarAddContact = ChatActionBar; //@description The chat is a private or secret chat with a mutual contact and the user's phone number can be shared with the other user using the method sharePhoneNumber chatActionBarSharePhoneNumber = ChatActionBar; +//@description The chat is a private chat with an administrator of a chat to which the user sent join request +//@title Title of the chat to which the join request was sent +//@is_channel True, if the join request was sent to a channel chat +//@request_date Point in time (Unix timestamp) when the join request was sent +chatActionBarJoinRequest title:string is_channel:Bool request_date:int32 = ChatActionBar; + //@class KeyboardButtonType @description Describes a keyboard button type -//@description A simple button, with text that should be sent when the button is pressed +//@description A simple button, with text that must be sent when the button is pressed keyboardButtonTypeText = KeyboardButtonType; //@description A button that sends the user's phone number when pressed; available only in private chats @@ -946,8 +1063,8 @@ keyboardButton text:string type:KeyboardButtonType = KeyboardButton; //@description A button that opens a specified URL @url HTTP or tg:// URL to open inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType; -//@description A button that opens a specified URL and automatically 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 opens a specified URL and automatically authorize the current user if allowed to do so @url An HTTP URL to open @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages +inlineKeyboardButtonTypeLoginUrl url:string id:int53 forward_text:string = InlineKeyboardButtonType; //@description A button that sends a callback query to a bot @data Data to be sent to the bot via a callback query inlineKeyboardButtonTypeCallback data:bytes = InlineKeyboardButtonType; @@ -958,12 +1075,15 @@ inlineKeyboardButtonTypeCallbackWithPassword data:bytes = InlineKeyboardButtonTy //@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 +//@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 must be sent from the current chat inlineKeyboardButtonTypeSwitchInline query:string in_current_chat:Bool = InlineKeyboardButtonType; //@description A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice inlineKeyboardButtonTypeBuy = InlineKeyboardButtonType; +//@description A button with a user reference to be handled in the same way as textEntityTypeMentionName entities @user_id User identifier +inlineKeyboardButtonTypeUser user_id:int53 = InlineKeyboardButtonType; + //@description Represents a single button in an inline keyboard @text Text of the button @type Type of the button inlineKeyboardButton text:string type:InlineKeyboardButtonType = InlineKeyboardButton; @@ -977,14 +1097,16 @@ replyMarkupRemoveKeyboard is_personal:Bool = ReplyMarkup; //@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; +//@input_field_placeholder If non-empty, the placeholder to be shown in the input field when the reply is active; 0-64 characters +replyMarkupForceReply is_personal:Bool input_field_placeholder:string = 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 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; +//@input_field_placeholder If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters +replyMarkupShowKeyboard rows:vector> resize_keyboard:Bool one_time:Bool is_personal:Bool input_field_placeholder:string = ReplyMarkup; //@description Contains an inline keyboard layout //@rows A list of rows of inline keyboard buttons @@ -998,16 +1120,17 @@ loginUrlInfoOpen url:string skip_confirm:Bool = LoginUrlInfo; //@description An authorization confirmation dialog needs to be shown to the user @url An HTTP URL to be opened @domain A domain of the URL //@bot_user_id User identifier of a bot linked with the website @request_write_access True, if the user needs to be requested to give the permission to the bot to send them messages -loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int32 request_write_access:Bool = LoginUrlInfo; +loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 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 +//@reply_info Information about the message thread +//@unread_message_count Approximate number of unread messages in the message thread //@messages The messages from which the thread starts. The messages are returned in 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; +messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector draft_message:draftMessage = MessageThreadInfo; //@class RichText @description Describes a text object inside an instant-view web page @@ -1049,8 +1172,8 @@ richTextMarked text:RichText = RichText; richTextPhoneNumber text:RichText phone_number:string = RichText; //@description A small image inside the text @document The image represented as a document. The image can be in GIF, JPEG or PNG format -//@width Width of a bounding box in which the image should be shown; 0 if unknown -//@height Height of a bounding box in which the image should be shown; 0 if unknown +//@width Width of a bounding box in which the image must be shown; 0 if unknown +//@height Height of a bounding box in which the image must be shown; 0 if unknown richTextIcon document:document width:int32 height:int32 = RichText; //@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 @@ -1059,7 +1182,7 @@ 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 +//@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 must 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 @@ -1074,28 +1197,28 @@ pageBlockListItem label:string page_blocks:vector = PageBlockListItem //@class PageBlockHorizontalAlignment @description Describes a horizontal alignment of a table cell content -//@description The content should be left-aligned +//@description The content must be left-aligned pageBlockHorizontalAlignmentLeft = PageBlockHorizontalAlignment; -//@description The content should be center-aligned +//@description The content must be center-aligned pageBlockHorizontalAlignmentCenter = PageBlockHorizontalAlignment; -//@description The content should be right-aligned +//@description The content must be right-aligned pageBlockHorizontalAlignmentRight = PageBlockHorizontalAlignment; //@class PageBlockVerticalAlignment @description Describes a Vertical alignment of a table cell content -//@description The content should be top-aligned +//@description The content must be top-aligned pageBlockVerticalAlignmentTop = PageBlockVerticalAlignment; -//@description The content should be middle-aligned +//@description The content must be middle-aligned pageBlockVerticalAlignmentMiddle = PageBlockVerticalAlignment; -//@description The content should be bottom-aligned +//@description The content must be bottom-aligned pageBlockVerticalAlignmentBottom = PageBlockVerticalAlignment; -//@description Represents a cell of a table @text Cell text; may be null. If the text is null, then the cell should be invisible @is_header True, if it is a header cell -//@colspan The number of columns the cell should span @rowspan The number of rows the cell should span +//@description Represents a cell of a table @text Cell text; may be null. If the text is null, then the cell must be invisible @is_header True, if it is a header cell +//@colspan The number of columns the cell spans @rowspan The number of rows the cell spans //@align Horizontal cell content alignment @valign Vertical cell content alignment pageBlockTableCell text:RichText is_header:Bool colspan:int32 rowspan:int32 align:PageBlockHorizontalAlignment valign:PageBlockVerticalAlignment = PageBlockTableCell; @@ -1127,7 +1250,7 @@ pageBlockKicker kicker:RichText = PageBlock; //@description A text paragraph @text Paragraph text pageBlockParagraph text:RichText = PageBlock; -//@description A preformatted text paragraph @text Paragraph text @language Programming language for which the text should be formatted +//@description A preformatted text paragraph @text Paragraph text @language Programming language for which the text needs to be formatted pageBlockPreformatted text:RichText language:string = PageBlock; //@description The footer of a page @footer Footer @@ -1148,7 +1271,7 @@ pageBlockBlockQuote text:RichText credit:RichText = PageBlock; //@description A pull quote @text Quote text @credit Quote credit pageBlockPullQuote text:RichText credit:RichText = PageBlock; -//@description An animation @animation Animation file; may be null @caption Animation caption @need_autoplay True, if the animation should be played automatically +//@description An animation @animation Animation file; may be null @caption Animation caption @need_autoplay True, if the animation must be played automatically pageBlockAnimation animation:animation caption:pageBlockCaption need_autoplay:Bool = PageBlock; //@description An audio file @audio Audio file; may be null @caption Audio file caption @@ -1157,7 +1280,7 @@ pageBlockAudio audio:audio caption:pageBlockCaption = PageBlock; //@description A photo @photo Photo file; may be null @caption Photo caption @url URL that needs to be opened when the photo is clicked pageBlockPhoto photo:photo caption:pageBlockCaption url:string = PageBlock; -//@description A video @video Video file; may be null @caption Video caption @need_autoplay True, if the video should be played automatically @is_looped True, if the video should be looped +//@description A video @video Video file; may be null @caption Video caption @need_autoplay True, if the video must be played automatically @is_looped True, if the video must be looped pageBlockVideo video:video caption:pageBlockCaption need_autoplay:Bool is_looped:Bool = PageBlock; //@description A voice note @voice_note Voice note; may be null @caption Voice note caption @@ -1166,7 +1289,7 @@ pageBlockVoiceNote voice_note:voiceNote caption:pageBlockCaption = PageBlock; //@description A page cover @cover Cover pageBlockCover cover:PageBlock = PageBlock; -//@description An embedded web page @url Web page URL, if available @html HTML-markup of the embedded page @poster_photo Poster photo, if available; may be null @width Block width; 0 if unknown @height Block height; 0 if unknown @caption Block caption @is_full_width True, if the block should be full width @allow_scrolling True, if scrolling should be allowed +//@description An embedded web page @url Web page URL, if available @html HTML-markup of the embedded page @poster_photo Poster photo, if available; may be null @width Block width; 0 if unknown @height Block height; 0 if unknown @caption Block caption @is_full_width True, if the block must be full width @allow_scrolling True, if scrolling needs to be allowed pageBlockEmbedded url:string html:string poster_photo:photo width:int32 height:int32 caption:pageBlockCaption is_full_width:Bool allow_scrolling:Bool = PageBlock; //@description An embedded post @url Web page URL @author Post author @author_photo Post author photo; may be null @date Point in time (Unix timestamp) when the post was created; 0 if unknown @page_blocks Post content @caption Post caption @@ -1178,7 +1301,7 @@ pageBlockCollage page_blocks:vector caption:pageBlockCaption = PageBl //@description A slideshow @page_blocks Slideshow item contents @caption Block caption pageBlockSlideshow page_blocks:vector caption:pageBlockCaption = PageBlock; -//@description A link to a chat @title Chat title @photo Chat photo; may be null @username Chat username, by which all other information about the chat should be resolved +//@description A link to a chat @title Chat title @photo Chat photo; may be null @username Chat username, by which all other information about the chat can be resolved pageBlockChatLink title:string photo:chatPhotoInfo username:string = PageBlock; //@description A table @caption Table caption @cells Table cells @is_bordered True, if the table is bordered @is_striped True, if the table is striped @@ -1197,10 +1320,11 @@ pageBlockMap location:location zoom:int32 width:int32 height:int32 caption:pageB //@description Describes an instant view page for a web page //@page_blocks Content of the web page //@view_count Number of the instant view views; 0 if unknown -//@version Version of the instant view, currently can be 1 or 2 +//@version Version of the instant view; currently, can be 1 or 2 //@is_rtl True, if the instant view must be shown from right to left //@is_full True, if the instant view contains the full page. A network request might be needed to get the full web page instant view -webPageInstantView page_blocks:vector view_count:int32 version:int32 is_rtl:Bool is_full:Bool = WebPageInstantView; +//@feedback_link An internal link to be opened to leave feedback about the instant view +webPageInstantView page_blocks:vector view_count:int32 version:int32 is_rtl:Bool is_full:Bool feedback_link:InternalLinkType = WebPageInstantView; //@description Describes a web page preview @@ -1219,12 +1343,12 @@ webPageInstantView page_blocks:vector view_count:int32 version:int32 //@author Author of the content //@animation Preview of the content as an animation, if available; may be null //@audio Preview of the content as an audio file, if available; may be null -//@document Preview of the content as a document, if available (currently only available for small PDF files and ZIP archives); may be null +//@document Preview of the content as a document, if available; may be null //@sticker Preview of the content as a sticker for small WEBP files, if available; may be null //@video Preview of the content as a video, if available; may be null //@video_note Preview of the content as a video note, if available; may be null //@voice_note Preview of the content as a voice note, if available; may be null -//@instant_view_version Version of instant view, available for the web page (currently can be 1 or 2), 0 if none +//@instant_view_version Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote instant_view_version:int32 = WebPage; @@ -1232,7 +1356,7 @@ webPage url:string display_url:string type:string site_name:string title:string //@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 +//@is_hidden True, if the country must 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; @@ -1242,7 +1366,7 @@ 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 +//@formatted_phone_number The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user phoneNumberInfo country:countryInfo country_calling_code:string formatted_phone_number:string = PhoneNumberInfo; @@ -1257,14 +1381,22 @@ bankCardInfo title:string actions:vector = BankCardInfo; address country_code:string state:string city:string street_line1:string street_line2:string postal_code:string = Address; -//@description Portion of the price of a product (e.g., "delivery cost", "tax amount") @label Label for this portion of the product price @amount Currency amount in minimal quantity of the currency +//@description Portion of the price of a product (e.g., "delivery cost", "tax amount") @label Label for this portion of the product price @amount Currency amount in the smallest units of the currency labeledPricePart label:string amount:int53 = LabeledPricePart; -//@description Product invoice @currency ISO 4217 currency code @price_parts A list of objects used to calculate the total price of the product @is_test True, if the payment is a test payment -//@need_name True, if the user's name is needed for payment @need_phone_number True, if the user's phone number is needed for payment @need_email_address True, if the user's email address is needed for payment -//@need_shipping_address True, if the user's shipping address is needed for payment @send_phone_number_to_provider True, if the user's phone number will be sent to the provider -//@send_email_address_to_provider True, if the user's email address will be sent to the provider @is_flexible True, if the total price depends on the shipping method -invoice currency:string price_parts:vector is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice; +//@description Product invoice @currency ISO 4217 currency code +//@price_parts A list of objects used to calculate the total price of the product +//@max_tip_amount The maximum allowed amount of tip in the smallest units of the currency +//@suggested_tip_amounts Suggested amounts of tip in the smallest units of the currency +//@is_test True, if the payment is a test payment +//@need_name True, if the user's name is needed for payment +//@need_phone_number True, if the user's phone number is needed for payment +//@need_email_address True, if the user's email address is needed for payment +//@need_shipping_address True, if the user's shipping address is needed for payment +//@send_phone_number_to_provider True, if the user's phone number will be sent to the provider +//@send_email_address_to_provider True, if the user's email address will be sent to the provider +//@is_flexible True, if the total price depends on the shipping method +invoice currency:string price_parts:vector max_tip_amount:int53 suggested_tip_amounts:vector is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice; //@description Order information @name Name of the user @phone_number Phone number of the user @email_address Email address of the user @shipping_address Shipping address for this order; may be null orderInfo name:string phone_number:string email_address:string shipping_address:address = OrderInfo; @@ -1280,31 +1412,55 @@ savedCredentials id:string title:string = SavedCredentials; //@description Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password @saved_credentials_id Identifier of the saved credentials inputCredentialsSaved saved_credentials_id:string = InputCredentials; -//@description Applies if a user enters new credentials on a payment provider website @data Contains JSON-encoded data with a credential identifier from the payment provider @allow_save True, if the credential identifier can be saved on the server side +//@description Applies if a user enters new credentials on a payment provider website @data JSON-encoded data with the credential identifier from the payment provider @allow_save True, if the credential identifier can be saved on the server side inputCredentialsNew data:string allow_save:Bool = InputCredentials; -//@description Applies if a user enters new credentials using Android Pay @data JSON-encoded data with the credential identifier -inputCredentialsAndroidPay data:string = InputCredentials; - //@description Applies if a user enters new credentials using Apple Pay @data JSON-encoded data with the credential identifier inputCredentialsApplePay data:string = InputCredentials; +//@description Applies if a user enters new credentials using Google Pay @data JSON-encoded data with the credential identifier +inputCredentialsGooglePay data:string = InputCredentials; + //@description Stripe payment provider @publishable_key Stripe API publishable key @need_country True, if the user country must be provided @need_postal_code True, if the user ZIP/postal code must be provided @need_cardholder_name True, if the cardholder name must be provided paymentsProviderStripe publishable_key:string need_country:Bool need_postal_code:Bool need_cardholder_name:Bool = PaymentsProviderStripe; -//@description Contains information about an invoice payment form @invoice Full information of the invoice @url Payment form URL @payments_provider Contains information about the payment provider, if available, to support it natively without the need for opening the URL; may be null -//@saved_order_info Saved server-side order information; may be null @saved_credentials Contains information about saved card credentials; may be null @can_save_credentials True, if the user can choose to save credentials @need_password True, if the user will be able to save credentials protected by a password they set up -paymentForm invoice:invoice url:string payments_provider:paymentsProviderStripe saved_order_info:orderInfo saved_credentials:savedCredentials can_save_credentials:Bool need_password:Bool = PaymentForm; +//@description Theme colors for a payment form @background_color A color of the payment form background in the RGB24 format @text_color A color of text in the RGB24 format +//@hint_color A color of hints in the RGB24 format @link_color A color of links in the RGB24 format @button_color A color of the buttons in the RGB24 format +//@button_text_color A color of text on the buttons in the RGB24 format +paymentFormTheme background_color:int32 text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = PaymentFormTheme; + +//@description Contains information about an invoice payment form +//@id The payment form identifier +//@invoice Full information of the invoice +//@url Payment form URL +//@seller_bot_user_id User identifier of the seller bot +//@payments_provider_user_id User identifier of the payment provider bot +//@payments_provider Information about the payment provider, if available, to support it natively without the need for opening the URL; may be null +//@saved_order_info Saved server-side order information; may be null +//@saved_credentials Information about saved card credentials; may be null +//@can_save_credentials True, if the user can choose to save credentials +//@need_password True, if the user will be able to save credentials protected by a password they set up +paymentForm id:int64 invoice:invoice url:string seller_bot_user_id:int53 payments_provider_user_id:int53 payments_provider:paymentsProviderStripe saved_order_info:orderInfo saved_credentials:savedCredentials can_save_credentials:Bool need_password:Bool = PaymentForm; //@description Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options @order_info_id Temporary identifier of the order information @shipping_options Available shipping options validatedOrderInfo order_info_id:string shipping_options:vector = ValidatedOrderInfo; -//@description Contains the result of a payment request @success True, if the payment request was successful; otherwise the verification_url will be not empty @verification_url URL for additional payment credentials verification +//@description Contains the result of a payment request @success True, if the payment request was successful; otherwise the verification_url will be non-empty @verification_url URL for additional payment credentials verification paymentResult success:Bool verification_url:string = PaymentResult; -//@description Contains information about a successful payment @date Point in time (Unix timestamp) when the payment was made @payments_provider_user_id User identifier of the payment provider bot @invoice Contains information about the invoice -//@order_info Contains order information; may be null @shipping_option Chosen shipping option; may be null @credentials_title Title of the saved credentials -paymentReceipt date:int32 payments_provider_user_id:int32 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string = PaymentReceipt; +//@description Contains information about a successful payment +//@title Product title +//@param_description Product description +//@photo Product photo; may be null +//@date Point in time (Unix timestamp) when the payment was made +//@seller_bot_user_id User identifier of the seller bot +//@payments_provider_user_id User identifier of the payment provider bot +//@invoice Information about the invoice +//@order_info Order information; may be null +//@shipping_option Chosen shipping option; may be null +//@credentials_title Title of the saved credentials chosen by the buyer +//@tip_amount The amount of tip chosen by the buyer in the smallest units of the currency +paymentReceipt title:string description:string photo:photo date:int32 seller_bot_user_id:int53 payments_provider_user_id:int53 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceipt; //@description File with the date it was uploaded @file The file @date Point in time (Unix timestamp) when the file was uploaded @@ -1353,7 +1509,7 @@ passportElementTypePhoneNumber = PassportElementType; passportElementTypeEmailAddress = PassportElementType; -//@description Represents a date according to the Gregorian calendar @day Day of the month, 1-31 @month Month, 1-12 @year Year, 1-9999 +//@description Represents a date according to the Gregorian calendar @day Day of the month; 1-31 @month Month; 1-12 @year Year; 1-9999 date day:int32 month:int32 year:int32 = Date; //@description Contains the user's personal details @@ -1362,12 +1518,12 @@ date day:int32 month:int32 year:int32 = Date; //@birthdate Birthdate of the user @gender Gender of the user, "male" or "female" @country_code A two-letter ISO 3166-1 alpha-2 country code of the user's country @residence_country_code A two-letter ISO 3166-1 alpha-2 country code of the user's residence country personalDetails first_name:string middle_name:string last_name:string native_first_name:string native_middle_name:string native_last_name:string birthdate:date gender:string country_code:string residence_country_code:string = PersonalDetails; -//@description An identity document @number Document number; 1-24 characters @expiry_date Document expiry date; may be null @front_side Front side of the document -//@reverse_side Reverse side of the document; only for driver license and identity card @selfie Selfie with the document; may be null @translation List of files containing a certified English translation of the document +//@description An identity document @number Document number; 1-24 characters @expiry_date Document expiry date; may be null if not applicable @front_side Front side of the document +//@reverse_side Reverse side of the document; only for driver license and identity card; may be null @selfie Selfie with the document; may be null @translation List of files containing a certified English translation of the document identityDocument number:string expiry_date:date front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector = IdentityDocument; -//@description An identity document to be saved to Telegram Passport @number Document number; 1-24 characters @expiry_date Document expiry date, if available @front_side Front side of the document -//@reverse_side Reverse side of the document; only for driver license and identity card @selfie Selfie with the document, if available @translation List of files containing a certified English translation of the document +//@description An identity document to be saved to Telegram Passport @number Document number; 1-24 characters @expiry_date Document expiry date; pass null if not applicable @front_side Front side of the document +//@reverse_side Reverse side of the document; only for driver license and identity card; pass null otherwise @selfie Selfie with the document; pass null if unavailable @translation List of files containing a certified English translation of the document inputIdentityDocument number:string expiry_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translation:vector = InputIdentityDocument; //@description A personal document, containing some information about a user @files List of files containing the pages of the document @translation List of files containing a certified English translation of the document @@ -1507,7 +1663,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 must be provided to complete the form +//@required_elements 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; @@ -1604,6 +1760,9 @@ messageVenue venue:venue = MessageContent; //@description A message with a user contact @contact The contact description messageContact contact:contact = MessageContent; +//@description A message with an animated emoji @animated_emoji The animated emoji @emoji The corresponding emoji +messageAnimatedEmoji animated_emoji:animatedEmoji emoji:string = 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 @@ -1618,16 +1777,28 @@ messageGame game:game = MessageContent; //@description A message with a poll @poll The poll description messagePoll poll:poll = MessageContent; -//@description A message with an invoice from a bot @title Product title @param_description Product description @photo Product photo; may be null @currency Currency for the product price @total_amount Product total price in the minimal quantity of the currency +//@description A message with an invoice from a bot @title Product title @param_description Product description @photo Product photo; may be null @currency Currency for the product price @total_amount Product total price in the smallest units of the currency //@start_parameter Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter} @is_test True, if the invoice is a test invoice -//@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 +//@need_shipping_address True, if the shipping address must 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 @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 new video chat was scheduled @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator +messageVideoChatScheduled group_call_id:int32 start_date:int32 = MessageContent; + +//@description A newly created video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall +messageVideoChatStarted group_call_id:int32 = MessageContent; + +//@description A message with information about an ended video chat @duration Call duration, in seconds +messageVideoChatEnded duration:int32 = MessageContent; + +//@description A message with information about an invite to a video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @user_ids Invited user identifiers +messageInviteVideoChatParticipants group_call_id:int32 user_ids:vector = MessageContent; + //@description A 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; +messageBasicGroupChatCreate title:string member_user_ids:vector = MessageContent; //@description A newly created supergroup or channel @title Title of the supergroup or channel messageSupergroupChatCreate title:string = MessageContent; @@ -1642,19 +1813,22 @@ messageChatChangePhoto photo:chatPhoto = MessageContent; messageChatDeletePhoto = MessageContent; //@description New chat members were added @member_user_ids User identifiers of the new members -messageChatAddMembers member_user_ids:vector = MessageContent; +messageChatAddMembers member_user_ids:vector = MessageContent; -//@description A new member joined the chat by invite link +//@description A new member joined the chat via an invite link messageChatJoinByLink = MessageContent; +//@description A new member was accepted to the chat by an administrator +messageChatJoinByRequest = MessageContent; + //@description A chat member was deleted @user_id User identifier of the deleted chat member -messageChatDeleteMember user_id:int32 = MessageContent; +messageChatDeleteMember user_id:int53 = MessageContent; //@description A basic group was upgraded to a supergroup and was deactivated as the result @supergroup_id Identifier of the supergroup to which the basic group was upgraded -messageChatUpgradeTo supergroup_id:int32 = MessageContent; +messageChatUpgradeTo supergroup_id:int53 = MessageContent; //@description A supergroup has been created from a basic group @title Title of the newly created supergroup @basic_group_id The identifier of the original basic group -messageChatUpgradeFrom title:string basic_group_id:int32 = MessageContent; +messageChatUpgradeFrom title:string basic_group_id:int53 = MessageContent; //@description A message has been pinned @message_id Identifier of the pinned message, can be an identifier of a deleted message or 0 messagePinMessage message_id:int53 = MessageContent; @@ -1662,7 +1836,10 @@ messagePinMessage message_id:int53 = MessageContent; //@description A screenshot of a message in the chat has been taken messageScreenshotTaken = MessageContent; -//@description The TTL (Time To Live) setting messages in a secret chat has been changed @ttl New TTL +//@description A theme in the chat has been changed @theme_name If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one +messageChatSetTheme theme_name:string = MessageContent; + +//@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL messageChatSetTtl ttl:int32 = MessageContent; //@description A non-standard action has happened in the chat @text Message text to be shown in the chat @@ -1671,13 +1848,13 @@ messageCustomServiceAction text:string = MessageContent; //@description A new high score was achieved in a game @game_message_id Identifier of the message with the game, can be an identifier of a deleted message @game_id Identifier of the game; may be different from the games presented in the message with the game @score New score messageGameScore game_message_id:int53 game_id:int64 score:int32 = MessageContent; -//@description A payment has been completed @invoice_message_id Identifier of the message with the corresponding invoice; can be an identifier of a deleted message @currency Currency for the price of the product @total_amount Total price for the product, in the minimal quantity of the currency -messagePaymentSuccessful invoice_message_id:int53 currency:string total_amount:int53 = MessageContent; +//@description A payment has been completed @invoice_chat_id Identifier of the chat, containing the corresponding invoice message; 0 if unknown @invoice_message_id Identifier of the message with the corresponding invoice; can be an identifier of a deleted message @currency Currency for the price of the product @total_amount Total price for the product, in the smallest units of the currency +messagePaymentSuccessful invoice_chat_id:int53 invoice_message_id:int53 currency:string total_amount:int53 = MessageContent; -//@description A payment has been completed; for bots only @invoice_message_id Identifier of the message with the corresponding invoice; can be an identifier of a deleted message @currency Currency for price of the product -//@total_amount Total price for the product, in the minimal quantity of the currency @invoice_payload Invoice payload @shipping_option_id Identifier of the shipping option chosen by the user; may be empty if not applicable @order_info Information about the order; may be null +//@description A payment has been completed; for bots only @currency Currency for price of the product +//@total_amount Total price for the product, in the smallest units of the currency @invoice_payload Invoice payload @shipping_option_id Identifier of the shipping option chosen by the user; may be empty if not applicable @order_info Information about the order; may be null //@telegram_payment_charge_id Telegram payment identifier @provider_payment_charge_id Provider payment identifier -messagePaymentSuccessfulBot invoice_message_id:int53 currency:string total_amount:int53 invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; +messagePaymentSuccessfulBot currency:string total_amount:int53 invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; //@description A contact has registered with Telegram messageContactRegistered = MessageContent; @@ -1691,8 +1868,8 @@ messagePassportDataSent types:vector = MessageContent; //@description Telegram Passport data has been received; for bots only @elements List of received Telegram Passport elements @credentials Encrypted data credentials messagePassportDataReceived elements:vector credentials:encryptedCredentials = MessageContent; -//@description A user in the chat came within proximity alert range @traveler 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 A user in the chat came within proximity alert range @traveler_id The identifier of a user or chat that triggered the proximity alert @watcher_id The identifier of a user or chat that subscribed for the proximity alert @distance The distance between the users +messageProximityAlertTriggered traveler_id:MessageSender watcher_id:MessageSender distance:int32 = MessageContent; //@description Message content that is not supported in the current TDLib version messageUnsupported = MessageContent; @@ -1706,10 +1883,10 @@ textEntityTypeMention = TextEntityType; //@description A hashtag text, beginning with "#" textEntityTypeHashtag = TextEntityType; -//@description A cashtag text, beginning with "$" and consisting of capital english letters (i.e. "$USD") +//@description A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD") textEntityTypeCashtag = TextEntityType; -//@description A bot command, beginning with "/". This shouldn't be highlighted if there are no bots in the chat +//@description A bot command, beginning with "/" textEntityTypeBotCommand = TextEntityType; //@description An HTTP URL @@ -1749,11 +1926,16 @@ textEntityTypePreCode language:string = TextEntityType; textEntityTypeTextUrl url:string = TextEntityType; //@description A text shows instead of a raw mention of the user (e.g., when the user has no username) @user_id Identifier of the mentioned user -textEntityTypeMentionName user_id:int32 = TextEntityType; +textEntityTypeMentionName user_id:int53 = TextEntityType; + +//@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message +textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType; -//@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 +//@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; @@ -1769,52 +1951,52 @@ messageSchedulingStateSendWhenOnline = MessageSchedulingState; //@description Options to be used when a message is sent //@disable_notification Pass true to disable notification for the message //@from_background Pass true if the message is sent from the background -//@scheduling_state Message scheduling state. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled +//@scheduling_state Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled messageSendOptions disable_notification:Bool from_background:Bool scheduling_state:MessageSchedulingState = MessageSendOptions; -//@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 +//@description Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied +//@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local //@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 +//@new_caption New message caption; pass null to copy message without 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 //@description A text message @text Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually -//@disable_web_page_preview True, if rich web page previews for URLs in the message text should be disabled @clear_draft True, if a chat message draft should be deleted +//@disable_web_page_preview True, if rich web page previews for URLs in the message text must be disabled @clear_draft True, if a chat message draft must be deleted inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent; -//@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 +//@description An animation message (GIF-style). @animation Animation file to be sent @thumbnail Animation thumbnail; pass null to skip thumbnail uploading @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; pass null to use an empty 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 +//@description An audio message @audio Audio file to be sent @album_cover_thumbnail Thumbnail of the cover for the album; pass null to skip thumbnail uploading @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; pass null to use an empty 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 @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 +//@description A document message (general file) @document Document to be sent @thumbnail Document thumbnail; pass null to skip thumbnail uploading @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; pass null to use an empty 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 +//@description A photo message @photo Photo to send @thumbnail Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats @added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable @width Photo width @height Photo height @caption Photo caption; pass null to use an empty 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 inputMessagePhoto photo:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector width:int32 height:int32 caption:formattedText ttl:int32 = InputMessageContent; -//@description A sticker message @sticker Sticker to be sent @thumbnail Sticker thumbnail, if available @width Sticker width @height Sticker height -inputMessageSticker sticker:InputFile thumbnail:inputThumbnail width:int32 height:int32 = InputMessageContent; +//@description A sticker message @sticker Sticker to be sent @thumbnail Sticker thumbnail; pass null to skip thumbnail uploading @width Sticker width @height Sticker height @emoji Emoji used to choose the sticker +inputMessageSticker sticker:InputFile thumbnail:inputThumbnail width:int32 height:int32 emoji:string = InputMessageContent; -//@description A video message @video Video to be sent @thumbnail Video thumbnail, if available @added_sticker_file_ids File identifiers of the stickers added to the video, if applicable -//@duration Duration of the video, in seconds @width Video width @height Video height @supports_streaming True, if the video should be tried to be streamed -//@caption Video caption; 0-GetOption("message_caption_length_max") characters @ttl Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats +//@description A video message @video Video to be sent @thumbnail Video thumbnail; pass null to skip thumbnail uploading @added_sticker_file_ids File identifiers of the stickers added to the video, if applicable +//@duration Duration of the video, in seconds @width Video width @height Video height @supports_streaming True, if the video is supposed to be streamed +//@caption Video caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters @ttl Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats inputMessageVideo video:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector duration:int32 width:int32 height:int32 supports_streaming:Bool caption:formattedText ttl:int32 = InputMessageContent; -//@description A video note message @video_note Video note to be sent @thumbnail Video thumbnail, if available @duration Duration of the video, in seconds @length Video width and height; must be positive and not greater than 640 +//@description A video note message @video_note Video note to be sent @thumbnail Video thumbnail; pass null to skip thumbnail uploading @duration Duration of the video, in seconds @length Video width and height; must be positive and not greater than 640 inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int32 length:int32 = InputMessageContent; -//@description A voice note message @voice_note Voice note to be sent @duration Duration of the voice note, in seconds @waveform Waveform representation of the voice note, in 5-bit format @caption Voice note caption; 0-GetOption("message_caption_length_max") characters +//@description A voice note message @voice_note Voice note to be sent @duration Duration of the voice note, in seconds @waveform Waveform representation of the voice note, in 5-bit format @caption Voice note caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters 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 +//@description A message with a location @location Location to be sent @live_period Period for which the location can be updated, in seconds; must be between 60 and 86400 for a live location and 0 otherwise //@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; @@ -1825,26 +2007,28 @@ 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 +//@description A dice message @emoji Emoji on which the dice throw animation is based @clear_draft True, if the chat message draft must 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; +inputMessageGame bot_user_id:int53 game_short_name:string = InputMessageContent; -//@description A message with an invoice; can be used only by bots and only in private chats @invoice Invoice @title Product title; 1-32 characters @param_description Product description; 0-255 characters @photo_url Product photo URL; optional @photo_size Product photo size @photo_width Product photo width @photo_height Product photo height -//@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 +//@description A message with an invoice; can be used only by bots @invoice Invoice @title Product title; 1-32 characters @param_description Product description; 0-255 characters +//@photo_url Product photo URL; optional @photo_size Product photo size @photo_width Product photo width @photo_height Product photo height +//@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 deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message 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 (up to 300 characters for bots) @options List of poll answer options, 2-10 strings 1-100 characters each +//@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 +//@close_date Point in time (Unix timestamp) when the poll will automatically be 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 -//@copy_options Options to be used to copy content of the message without a link to the original message +//@in_game_share True, if a game message is being shared from a launched game; applies only to game messages +//@copy_options Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool copy_options:messageCopyOptions = InputMessageContent; @@ -1880,12 +2064,6 @@ searchMessagesFilterUrl = SearchMessagesFilter; //@description Returns only messages containing chat photos searchMessagesFilterChatPhoto = SearchMessagesFilter; -//@description Returns only call messages -searchMessagesFilterCall = SearchMessagesFilter; - -//@description Returns only incoming call messages with missed/declined discard reasons -searchMessagesFilterMissedCall = SearchMessagesFilter; - //@description Returns only video note messages searchMessagesFilterVideoNote = SearchMessagesFilter; @@ -1909,29 +2087,47 @@ searchMessagesFilterPinned = SearchMessagesFilter; //@description The user is typing a message chatActionTyping = ChatAction; + //@description The user is recording a video chatActionRecordingVideo = ChatAction; + //@description The user is uploading a video @progress Upload progress, as a percentage chatActionUploadingVideo progress:int32 = ChatAction; + //@description The user is recording a voice note chatActionRecordingVoiceNote = ChatAction; + //@description The user is uploading a voice note @progress Upload progress, as a percentage chatActionUploadingVoiceNote progress:int32 = ChatAction; + //@description The user is uploading a photo @progress Upload progress, as a percentage chatActionUploadingPhoto progress:int32 = ChatAction; + //@description The user is uploading a document @progress Upload progress, as a percentage chatActionUploadingDocument progress:int32 = ChatAction; + +//@description The user is picking a sticker to send +chatActionChoosingSticker = ChatAction; + //@description The user is picking a location or venue to send chatActionChoosingLocation = ChatAction; + //@description The user is picking a contact to send chatActionChoosingContact = ChatAction; + //@description The user has started to play a game chatActionStartPlayingGame = ChatAction; + //@description The user is recording a video note chatActionRecordingVideoNote = ChatAction; + //@description The user is uploading a video note @progress Upload progress, as a percentage chatActionUploadingVideoNote progress:int32 = ChatAction; -//@description The user has cancelled the previous action + +//@description The user is watching animations sent by the other party by clicking on an animated emoji @emoji The animated emoji +chatActionWatchingAnimations emoji:string = ChatAction; + +//@description The user has canceled the previous action chatActionCancel = ChatAction; @@ -1964,17 +2160,19 @@ emojis emojis:vector = Emojis; //@description Represents a sticker set //@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed +//@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner //@is_installed True, if the sticker set has been installed by the current user @is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously //@is_official True, if the sticker set is official @is_animated True, is the stickers in the set are animated @is_masks True, if the stickers in the set are masks @is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set @emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object -stickerSet id:int64 title:string name:string thumbnail:thumbnail is_installed:Bool is_archived:Bool is_official:Bool is_animated:Bool is_masks:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; +stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool 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 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 +//@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@is_installed True, if the sticker set has been installed by the current user @is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously //@is_official True, if the sticker set is official @is_animated True, is the stickers in the set are animated @is_masks True, if the stickers in the set are masks @is_viewed True for already viewed trending sticker sets -//@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; +//@size Total number of stickers in the set @covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested +stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool is_animated:Bool is_masks:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; //@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; @@ -1985,7 +2183,7 @@ stickerSets total_count:int32 sets:vector = StickerSets; //@description The call wasn't discarded, or the reason is unknown callDiscardReasonEmpty = CallDiscardReason; -//@description The call was ended before the conversation started. It was cancelled by the caller or missed by the other party +//@description The call was ended before the conversation started. It was canceled by the caller or missed by the other party callDiscardReasonMissed = CallDiscardReason; //@description The call was ended before the conversation started. It was declined by the other party @@ -2003,7 +2201,7 @@ callDiscardReasonHungUp = CallDiscardReason; //@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 +//@library_versions List of supported tgcalls versions callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 library_versions:vector = CallProtocol; @@ -2023,6 +2221,9 @@ callServer id:int64 ip_address:string ipv6_address:string port:int32 type:CallSe //@description Contains the call identifier @id Call identifier callId id:int32 = CallId; +//@description Contains the group call identifier @id Group call identifier +groupCallId id:int32 = GroupCallId; + //@class CallState @description Describes the current call state @@ -2038,13 +2239,79 @@ callStateReady protocol:callProtocol servers:vector config:string en //@description The call is hanging up after discardCall has been called callStateHangingUp = CallState; -//@description The call has ended successfully @reason The reason, why the call has ended @need_rating True, if the call rating should be sent to the server @need_debug_information True, if the call debug information should be sent to the server +//@description The call has ended successfully @reason The reason, why the call has ended @need_rating True, if the call rating must be sent to the server @need_debug_information True, if the call debug information must be sent to the server callStateDiscarded reason:CallDiscardReason need_rating:Bool need_debug_information:Bool = CallState; //@description The call has ended with an error @error Error. An error with the code 4005000 will be returned if an outgoing call is missed because of an expired timeout callStateError error:error = CallState; +//@class GroupCallVideoQuality @description Describes the quality of a group call video + +//@description The worst available video quality +groupCallVideoQualityThumbnail = GroupCallVideoQuality; + +//@description The medium video quality +groupCallVideoQualityMedium = GroupCallVideoQuality; + +//@description The best available video quality +groupCallVideoQualityFull = GroupCallVideoQuality; + + +//@description Describes a recently speaking participant in a group call @participant_id Group call participant identifier @is_speaking True, is the user has spoken recently +groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCallRecentSpeaker; + +//@description Describes a group call +//@id Group call identifier +//@title Group call title +//@scheduled_start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended +//@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call will start +//@is_active True, if the call is active +//@is_joined True, if the call is joined +//@need_rejoin True, if user was kicked from the call because of network loss and the call needs to be rejoined +//@can_be_managed True, if the current user can manage the group call +//@participant_count Number of participants in the group call +//@loaded_all_participants True, if all group call participants are loaded +//@recent_speakers At most 3 recently speaking users in the group call +//@is_my_video_enabled True, if the current user's video is enabled +//@is_my_video_paused True, if the current user's video is paused +//@can_enable_video True, if the current user can broadcast video or share screen +//@mute_new_participants True, if only group call administrators can unmute new participants +//@can_toggle_mute_new_participants True, if the current user can enable or disable mute_new_participants setting +//@record_duration Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on +//@is_video_recorded True, if a video file is being recorded for the call +//@duration Call duration, in seconds; for ended calls only +groupCall id:int32 title:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_joined:Bool need_rejoin:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall; + +//@description Describes a group of video synchronization source identifiers @semantics The semantics of sources, one of "SIM" or "FID" @source_ids The list of synchronization source identifiers +groupCallVideoSourceGroup semantics:string source_ids:vector = GroupCallVideoSourceGroup; + +//@description Contains information about a group call participant's video channel @source_groups List of synchronization source groups of the video @endpoint_id Video channel endpoint identifier +//@is_paused True if the video is paused. This flag needs to be ignored, if new video frames are received +groupCallParticipantVideoInfo source_groups:vector endpoint_id:string is_paused:Bool = GroupCallParticipantVideoInfo; + +//@description Represents a group call participant +//@participant_id Identifier of the group call participant +//@audio_source_id User's audio channel synchronization source identifier +//@screen_sharing_audio_source_id User's screen sharing audio channel synchronization source identifier +//@video_info Information about user's video channel; may be null if there is no active video +//@screen_sharing_video_info Information about user's screen sharing video channel; may be null if there is no active screen sharing video +//@bio The participant user's bio or the participant chat's description +//@is_current_user True, if the participant is the current user +//@is_speaking True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking +//@is_hand_raised True, if the participant hand is raised +//@can_be_muted_for_all_users True, if the current user can mute the participant for all other group call participants +//@can_be_unmuted_for_all_users True, if the current user can allow the participant to unmute themselves or unmute the participant (if the participant is the current user) +//@can_be_muted_for_current_user True, if the current user can mute the participant only for self +//@can_be_unmuted_for_current_user True, if the current user can unmute the participant for self +//@is_muted_for_all_users True, if the participant is muted for all users +//@is_muted_for_current_user True, if the participant is muted for the current user +//@can_unmute_self True, if the participant is muted for all users, but can unmute themselves +//@volume_level Participant's volume level; 1-20000 in hundreds of percents +//@order User's order in the group call participant list. Orders must be compared lexicographically. The bigger is order, the higher is user in the list. If order is empty, the user must be removed from the participant list +groupCallParticipant participant_id:MessageSender audio_source_id:int32 screen_sharing_audio_source_id:int32 video_info:groupCallParticipantVideoInfo screen_sharing_video_info:groupCallParticipantVideoInfo bio:string is_current_user:Bool is_speaking:Bool is_hand_raised:Bool can_be_muted_for_all_users:Bool can_be_unmuted_for_all_users:Bool can_be_muted_for_current_user:Bool can_be_unmuted_for_current_user:Bool is_muted_for_all_users:Bool is_muted_for_current_user:Bool can_unmute_self:Bool volume_level:int32 order:string = GroupCallParticipant; + + //@class CallProblem @description Describes the exact type of a problem with a call //@description The user heard their own voice @@ -2076,21 +2343,23 @@ 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; +call id:int32 user_id:int53 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 +//@allow_flash_call Pass true if the authentication code may be sent via a flash call to the specified phone number +//@allow_missed_call Pass true if the authentication code may be sent via a missed call to the specified phone number //@is_current_phone_number Pass true if the authenticated phone number is used on the current device //@allow_sms_retriever_api For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details -phoneNumberAuthenticationSettings allow_flash_call:Bool is_current_phone_number:Bool allow_sms_retriever_api:Bool = PhoneNumberAuthenticationSettings; +//@authentication_tokens List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions +phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool is_current_phone_number:Bool allow_sms_retriever_api:Bool authentication_tokens:vector = PhoneNumberAuthenticationSettings; //@description Represents a list of animations @animations List of animations animations animations:vector = Animations; -//@class DiceStickers @description Contains animated stickers which should be used for dice animation rendering +//@class DiceStickers @description Contains animated stickers which must be used for dice animation rendering //@description A regular animated sticker @sticker The animated sticker with the dice animation diceStickersRegular sticker:sticker = DiceStickers; @@ -2106,7 +2375,7 @@ diceStickersSlotMachine background:sticker lever:sticker left_reel:sticker cente //@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; +importedContacts user_ids:vector importer_count:vector = ImportedContacts; //@description Contains an HTTP URL @url The URL @@ -2115,76 +2384,76 @@ 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 or an animated (i.e. without sound) H.264/MPEG-4 AVC video +//@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 +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultAnimation id:string title:string thumbnail_url:string thumbnail_mime_type:string video_url:string video_mime_type:string video_duration:int32 video_width:int32 video_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to an article or web page @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 -//@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 +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to an MP3 audio file @id Unique identifier of the query result @title Title of the audio file @performer Performer of the audio file //@audio_url The URL of the audio file @audio_duration Audio file duration, in seconds -//@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, InputMessageAudio, InputMessageLocation, InputMessageVenue or InputMessageContact +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAudio, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultAudio id:string title:string performer:string audio_url:string audio_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a user contact @id Unique identifier of the query result @contact User contact @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 +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultContact id:string contact:contact thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to a file @id Unique identifier of the query result @title Title of the resulting file @param_description Short description of the result, if known @document_url URL of the file @mime_type MIME type of the file content; only "application/pdf" and "application/zip" are currently allowed //@thumbnail_url The URL of the file thumbnail, if it exists @thumbnail_width Width of the thumbnail @thumbnail_height Height of the thumbnail -//@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, InputMessageDocument, InputMessageLocation, InputMessageVenue or InputMessageContact +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageDocument, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultDocument id:string title:string description:string document_url:string mime_type:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; -//@description Represents a game @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 +//@description Represents a game @id Unique identifier of the query result @game_short_name Short name of the game @reply_markup The message reply markup; pass null if none. 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 -//@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 +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, 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; //@description Represents link to a JPEG image @id Unique identifier of the query result @title Title of the result, if known @param_description A short description of the result, if known @thumbnail_url URL of the photo thumbnail, if it exists //@photo_url The URL of the JPEG photo (photo size must not exceed 5MB) @photo_width Width of the photo @photo_height Height of the photo -//@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, InputMessagePhoto, InputMessageLocation, InputMessageVenue or InputMessageContact +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultPhoto id:string title:string description:string thumbnail_url:string photo_url:string photo_width:int32 photo_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to a WEBP or TGS sticker @id Unique identifier of the query result @thumbnail_url URL of the sticker thumbnail, if it exists //@sticker_url The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB) @sticker_width Width of the sticker @sticker_height Height of the sticker -//@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, inputMessageSticker, InputMessageLocation, InputMessageVenue or InputMessageContact +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultSticker id:string thumbnail_url:string sticker_url:string sticker_width:int32 sticker_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents information about a venue @id Unique identifier of the query result @venue Venue 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 +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultVenue id:string venue:venue thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to a page containing an embedded video player or a video file @id Unique identifier of the query result @title Title of the result @param_description A short description of the result, if known //@thumbnail_url The URL of the video thumbnail (JPEG), if it exists @video_url URL of the embedded video player or video file @mime_type MIME type of the content of the video URL, only "text/html" or "video/mp4" are currently supported //@video_width Width of the video @video_height Height of the video @video_duration Video duration, in seconds -//@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, InputMessageVideo, InputMessageLocation, InputMessageVenue or InputMessageContact +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVideo, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultVideo id:string title:string description:string thumbnail_url:string video_url:string mime_type:string video_width:int32 video_height:int32 video_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to an opus-encoded audio file within an OGG container, single channel audio @id Unique identifier of the query result @title Title of the voice note //@voice_note_url The URL of the voice note file @voice_note_duration Duration of the voice note, in seconds -//@reply_markup The message reply markup. 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, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue or InputMessageContact +//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null +//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVoiceNote, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact inputInlineQueryResultVoiceNote id:string title:string voice_note_url:string voice_note_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; @@ -2229,7 +2498,7 @@ inlineQueryResultVoiceNote id:string voice_note:voiceNote title:string = InlineQ //@description Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query @inline_query_id Unique identifier of the inline query @next_offset The offset for the next request. If empty, there are no more results @results Results of the query -//@switch_pm_text If non-empty, this text should be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter @switch_pm_parameter Parameter for the bot start message +//@switch_pm_text If non-empty, this text must be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter @switch_pm_parameter Parameter for the bot start message inlineQueryResults inline_query_id:int64 next_offset:string results:vector switch_pm_text:string switch_pm_parameter:string = InlineQueryResults; @@ -2245,7 +2514,7 @@ callbackQueryPayloadDataWithPassword password:string data:bytes = CallbackQueryP callbackQueryPayloadGame game_short_name:string = CallbackQueryPayload; -//@description Contains a bot's answer to a callback query @text Text of the answer @show_alert True, if an alert should be shown to the user instead of a toast notification @url URL to be opened +//@description Contains a bot's answer to a callback query @text Text of the answer @show_alert True, if an alert must be shown to the user instead of a toast notification @url URL to be opened callbackQueryAnswer text:string show_alert:Bool url:string = CallbackQueryAnswer; @@ -2254,7 +2523,7 @@ customRequestResult result:string = CustomRequestResult; //@description Contains one row of the game high score table @position Position in the high score table @user_id User identifier @score User score -gameHighScore position:int32 user_id:int32 score:int32 = GameHighScore; +gameHighScore position:int32 user_id:int53 score:int32 = GameHighScore; //@description Contains a list of game high scores @scores A list of game high scores gameHighScores scores:vector = GameHighScores; @@ -2280,17 +2549,23 @@ chatEventMessageUnpinned message:message = ChatEventAction; //@description A new member joined the chat chatEventMemberJoined = ChatEventAction; +//@description A new member joined the chat via an invite link @invite_link Invite link used to join the chat +chatEventMemberJoinedByInviteLink invite_link:chatInviteLink = ChatEventAction; + +//@description A new member was accepted to the chat by an administrator @approver_user_id User identifier of the chat administrator, approved user join request @invite_link Invite link used to join the chat; may be null +chatEventMemberJoinedByRequest approver_user_id:int53 invite_link:chatInviteLink = ChatEventAction; + //@description A member left the chat chatEventMemberLeft = ChatEventAction; //@description A new chat member was invited @user_id New member user identifier @status New member status -chatEventMemberInvited user_id:int32 status:ChatMemberStatus = ChatEventAction; +chatEventMemberInvited user_id:int53 status:ChatMemberStatus = ChatEventAction; -//@description A chat member has gained/lost administrator status, or the list of their administrator privileges has changed @user_id Chat member user identifier @old_status Previous status of the chat member @new_status New status of the chat member -chatEventMemberPromoted user_id:int32 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; +//@description A chat member has gained/lost administrator status, or the list of their administrator privileges has changed @user_id Affected chat member user identifier @old_status Previous status of the chat member @new_status New status of the chat member +chatEventMemberPromoted user_id:int53 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; -//@description A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed @user_id Chat member user identifier @old_status Previous status of the chat member @new_status New status of the chat member -chatEventMemberRestricted user_id:int32 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; +//@description A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed @member_id Affected chat member identifier @old_status Previous status of the chat member @new_status New status of the chat member +chatEventMemberRestricted member_id:MessageSender old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; //@description The chat title was changed @old_title Previous chat title @new_title New chat title chatEventTitleChanged old_title:string new_title:string = ChatEventAction; @@ -2313,12 +2588,18 @@ chatEventInvitesToggled can_invite_users:Bool = ChatEventAction; //@description The linked chat of a supergroup was changed @old_linked_chat_id Previous supergroup linked chat identifier @new_linked_chat_id New supergroup linked chat identifier chatEventLinkedChatChanged old_linked_chat_id:int53 new_linked_chat_id:int53 = ChatEventAction; -//@description The slow_mode_delay setting of a supergroup was changed @old_slow_mode_delay Previous value of slow_mode_delay @new_slow_mode_delay New value of slow_mode_delay +//@description The slow_mode_delay setting of a supergroup was changed @old_slow_mode_delay Previous value of slow_mode_delay, in seconds @new_slow_mode_delay New value of slow_mode_delay, in seconds chatEventSlowModeDelayChanged old_slow_mode_delay:int32 new_slow_mode_delay:int32 = ChatEventAction; +//@description The message TTL was changed @old_message_ttl Previous value of message_ttl @new_message_ttl New value of message_ttl +chatEventMessageTtlChanged old_message_ttl:int32 new_message_ttl:int32 = ChatEventAction; + //@description The sign_messages setting of a channel was toggled @sign_messages New value of sign_messages chatEventSignMessagesToggled sign_messages:Bool = ChatEventAction; +//@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content +chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; + //@description The supergroup sticker set was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; @@ -2328,24 +2609,50 @@ chatEventLocationChanged old_location:chatLocation new_location:chatLocation = C //@description The is_all_history_available setting of a supergroup was toggled @is_all_history_available New value of is_all_history_available chatEventIsAllHistoryAvailableToggled is_all_history_available:Bool = ChatEventAction; -//@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @user_id Identifier of the user who performed the action that triggered the event @action Action performed by the user -chatEvent id:int64 date:int32 user_id:int32 action:ChatEventAction = ChatEvent; +//@description A chat invite link was edited @old_invite_link Previous information about the invite link @new_invite_link New information about the invite link +chatEventInviteLinkEdited old_invite_link:chatInviteLink new_invite_link:chatInviteLink = ChatEventAction; + +//@description A chat invite link was revoked @invite_link The invite link +chatEventInviteLinkRevoked invite_link:chatInviteLink = ChatEventAction; + +//@description A revoked chat invite link was deleted @invite_link The invite link +chatEventInviteLinkDeleted invite_link:chatInviteLink = ChatEventAction; + +//@description A video chat was created @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall +chatEventVideoChatCreated group_call_id:int32 = ChatEventAction; + +//@description A video chat was ended @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall +chatEventVideoChatEnded group_call_id:int32 = ChatEventAction; + +//@description A video chat participant was muted or unmuted @participant_id Identifier of the affected group call participant @is_muted New value of is_muted +chatEventVideoChatParticipantIsMutedToggled participant_id:MessageSender is_muted:Bool = ChatEventAction; + +//@description A video chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents +chatEventVideoChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction; + +//@description The mute_new_participants setting of a video chat was toggled @mute_new_participants New value of the mute_new_participants setting +chatEventVideoChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEventAction; + +//@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @member_id Identifier of the user or chat who performed the action @action The action +chatEvent id:int64 date:int32 member_id:MessageSender action:ChatEventAction = ChatEvent; //@description Contains a list of chat events @events List of events chatEvents events:vector = ChatEvents; //@description Represents a set of filters used to obtain a chat event log -//@message_edits True, if message edits should be returned -//@message_deletions True, if message deletions should be returned -//@message_pins True, if pin/unpin events should be returned -//@member_joins True, if members joining events should be returned -//@member_leaves True, if members leaving events should be returned -//@member_invites True, if invited member events should be returned -//@member_promotions True, if member promotion/demotion events should be returned -//@member_restrictions True, if member restricted/unrestricted/banned/unbanned events should be returned -//@info_changes True, if changes in chat information should be returned -//@setting_changes True, if changes in chat settings should be returned -chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool = ChatEventLogFilters; +//@message_edits True, if message edits need to be returned +//@message_deletions True, if message deletions need to be returned +//@message_pins True, if pin/unpin events need to be returned +//@member_joins True, if members joining events need to be returned +//@member_leaves True, if members leaving events need to be returned +//@member_invites True, if invited member events need to be returned +//@member_promotions True, if member promotion/demotion events need to be returned +//@member_restrictions True, if member restricted/unrestricted/banned/unbanned events need to be returned +//@info_changes True, if changes in chat information need to be returned +//@setting_changes True, if changes in chat settings need to be returned +//@invite_link_changes True, if changes to invite links need to be returned +//@video_chat_changes True, if video chat actions need to be returned +chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool invite_link_changes:Bool video_chat_changes:Bool = ChatEventLogFilters; //@class LanguagePackStringValue @description Represents the value of a string in a language pack @@ -2358,18 +2665,18 @@ languagePackStringValueOrdinary value:string = LanguagePackStringValue; //@few_value Value for few objects @many_value Value for many objects @other_value Default value languagePackStringValuePluralized zero_value:string one_value:string two_value:string few_value:string many_value:string other_value:string = LanguagePackStringValue; -//@description A deleted language pack string, the value should be taken from the built-in english language pack +//@description A deleted language pack string, the value must be taken from the built-in English language pack languagePackStringValueDeleted = LanguagePackStringValue; -//@description Represents one language pack string @key String key @value String value +//@description Represents one language pack string @key String key @value String value; pass null if the string needs to be taken from the built-in English language pack languagePackString key:string value:LanguagePackStringValue = LanguagePackString; //@description Contains a list of language pack strings @strings A list of language pack strings languagePackStrings strings:vector = LanguagePackStrings; //@description Contains information about a language pack @id Unique language pack identifier -//@base_language_pack_id Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it should be fetched from base language pack. Unsupported in custom language packs +//@base_language_pack_id Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs //@name Language name @native_name Name of the language in that language //@plural_code A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info //@is_official True, if the language pack is official @is_rtl True, if the language pack strings are RTL @is_beta True, if the language pack is a beta language pack @@ -2384,38 +2691,38 @@ localizationTargetInfo language_packs:vector = LocalizationTar //@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org -//@description A token for Firebase Cloud Messaging @token Device registration token; may be empty to de-register a device @encrypt True, if push notifications should be additionally encrypted +//@description A token for Firebase Cloud Messaging @token Device registration token; may be empty to deregister a device @encrypt True, if push notifications must be additionally encrypted deviceTokenFirebaseCloudMessaging token:string encrypt:Bool = DeviceToken; -//@description A token for Apple Push Notification service @device_token Device token; may be empty to de-register a device @is_app_sandbox True, if App Sandbox is enabled +//@description A token for Apple Push Notification service @device_token Device token; may be empty to deregister a device @is_app_sandbox True, if App Sandbox is enabled deviceTokenApplePush device_token:string is_app_sandbox:Bool = DeviceToken; -//@description A token for Apple Push Notification service VoIP notifications @device_token Device token; may be empty to de-register a device @is_app_sandbox True, if App Sandbox is enabled @encrypt True, if push notifications should be additionally encrypted +//@description A token for Apple Push Notification service VoIP notifications @device_token Device token; may be empty to deregister a device @is_app_sandbox True, if App Sandbox is enabled @encrypt True, if push notifications must be additionally encrypted deviceTokenApplePushVoIP device_token:string is_app_sandbox:Bool encrypt:Bool = DeviceToken; -//@description A token for Windows Push Notification Services @access_token The access token that will be used to send notifications; may be empty to de-register a device +//@description A token for Windows Push Notification Services @access_token The access token that will be used to send notifications; may be empty to deregister a device deviceTokenWindowsPush access_token:string = DeviceToken; -//@description A token for Microsoft Push Notification Service @channel_uri Push notification channel URI; may be empty to de-register a device +//@description A token for Microsoft Push Notification Service @channel_uri Push notification channel URI; may be empty to deregister a device deviceTokenMicrosoftPush channel_uri:string = DeviceToken; -//@description A token for Microsoft Push Notification Service VoIP channel @channel_uri Push notification channel URI; may be empty to de-register a device +//@description A token for Microsoft Push Notification Service VoIP channel @channel_uri Push notification channel URI; may be empty to deregister a device deviceTokenMicrosoftPushVoIP channel_uri:string = DeviceToken; -//@description A token for web Push API @endpoint Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device +//@description A token for web Push API @endpoint Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device //@p256dh_base64url Base64url-encoded P-256 elliptic curve Diffie-Hellman public key @auth_base64url Base64url-encoded authentication secret deviceTokenWebPush endpoint:string p256dh_base64url:string auth_base64url:string = DeviceToken; -//@description A token for Simple Push API for Firefox OS @endpoint Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device +//@description A token for Simple Push API for Firefox OS @endpoint Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device deviceTokenSimplePush endpoint:string = DeviceToken; -//@description A token for Ubuntu Push Client service @token Token; may be empty to de-register a device +//@description A token for Ubuntu Push Client service @token Token; may be empty to deregister a device deviceTokenUbuntuPush token:string = DeviceToken; -//@description A token for BlackBerry Push Service @token Token; may be empty to de-register a device +//@description A token for BlackBerry Push Service @token Token; may be empty to deregister a device deviceTokenBlackBerryPush token:string = DeviceToken; -//@description A token for Tizen Push Service @reg_id Push service registration identifier; may be empty to de-register a device +//@description A token for Tizen Push Service @reg_id Push service registration identifier; may be empty to deregister a device deviceTokenTizenPush reg_id:string = DeviceToken; @@ -2429,9 +2736,12 @@ pushReceiverId id:int64 = PushReceiverId; backgroundFillSolid color:int32 = BackgroundFill; //@description Describes a gradient fill of a background @top_color A top color of the background in the RGB24 format @bottom_color A bottom color of the background in the RGB24 format -//@rotation_angle Clockwise rotation angle of the gradient, in degrees; 0-359. Should be always divisible by 45 +//@rotation_angle Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45 backgroundFillGradient top_color:int32 bottom_color:int32 rotation_angle:int32 = BackgroundFill; +//@description Describes a freeform gradient fill of a background @colors A list of 3 or 4 colors of the freeform gradients in the RGB24 format +backgroundFillFreeformGradient colors:vector = BackgroundFill; + //@class BackgroundType @description Describes the type of a background @@ -2441,12 +2751,13 @@ backgroundFillGradient top_color:int32 bottom_color:int32 rotation_angle:int32 = backgroundTypeWallpaper is_blurred:Bool is_moving:Bool = BackgroundType; //@description A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user -//@fill Description of the background fill -//@intensity Intensity of the pattern when it is shown above the filled background, 0-100 +//@fill Fill of the background +//@intensity Intensity of the pattern when it is shown above the filled background; 0-100. +//@is_inverted True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only //@is_moving True, if the background needs to be slightly moved when device is tilted -backgroundTypePattern fill:BackgroundFill intensity:int32 is_moving:Bool = BackgroundType; +backgroundTypePattern fill:BackgroundFill intensity:int32 is_inverted:Bool is_moving:Bool = BackgroundType; -//@description A filled background @fill Description of the background fill +//@description A filled background @fill The background fill backgroundTypeFill fill:BackgroundFill = BackgroundType; @@ -2473,6 +2784,22 @@ inputBackgroundLocal background:InputFile = InputBackground; inputBackgroundRemote background_id:int64 = InputBackground; +//@description Describes theme settings +//@accent_color Theme accent color in ARGB format +//@background The background to be used in chats; may be null +//@outgoing_message_fill The fill to be used as a background for outgoing messages +//@animate_outgoing_message_fill If true, the freeform gradient fill needs to be animated on every sent message +//@outgoing_message_accent_color Accent color of outgoing messages in ARGB format +themeSettings accent_color:int32 background:background outgoing_message_fill:BackgroundFill animate_outgoing_message_fill:Bool outgoing_message_accent_color:int32 = ThemeSettings; + + +//@description Describes a chat theme +//@name Theme name +//@light_settings Theme settings for a light chat theme +//@dark_settings Theme settings for a dark chat theme +chatTheme name:string light_settings:themeSettings dark_settings:themeSettings = ChatTheme; + + //@description Contains a list of hashtags @hashtags A list of hashtags hashtags hashtags:vector = Hashtags; @@ -2503,13 +2830,49 @@ checkChatUsernameResultUsernameInvalid = CheckChatUsernameResult; //@description The username is occupied checkChatUsernameResultUsernameOccupied = CheckChatUsernameResult; -//@description The user has too much chats with username, one of them should be made private first +//@description The user has too much chats with username, one of them must be made private first checkChatUsernameResultPublicChatsTooMuch = CheckChatUsernameResult; //@description The user can't be a member of a public supergroup checkChatUsernameResultPublicGroupsUnavailable = CheckChatUsernameResult; +//@class CheckStickerSetNameResult @description Represents result of checking whether a name can be used for a new sticker set + +//@description The name can be set +checkStickerSetNameResultOk = CheckStickerSetNameResult; + +//@description The name is invalid +checkStickerSetNameResultNameInvalid = CheckStickerSetNameResult; + +//@description The name is occupied +checkStickerSetNameResultNameOccupied = CheckStickerSetNameResult; + + +//@class ResetPasswordResult @description Represents result of 2-step verification password reset + +//@description The password was reset +resetPasswordResultOk = ResetPasswordResult; + +//@description The password reset request is pending @pending_reset_date Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword +resetPasswordResultPending pending_reset_date:int32 = ResetPasswordResult; + +//@description The password reset request was declined @retry_date Point in time (Unix timestamp) when the password reset can be retried +resetPasswordResultDeclined retry_date:int32 = ResetPasswordResult; + + +//@class MessageFileType @description Contains information about a file with messages exported from another app + +//@description The messages was exported from a private chat @name Name of the other party; may be empty if unrecognized +messageFileTypePrivate name:string = MessageFileType; + +//@description The messages was exported from a group chat @title Title of the group chat; may be empty if unrecognized +messageFileTypeGroup title:string = MessageFileType; + +//@description The messages was exported from a chat of unknown type +messageFileTypeUnknown = MessageFileType; + + //@class PushMessageContent @description Contains content of a push message notification //@description A general message with hidden content @is_pinned True, if the message is a pinned message with the specified content @@ -2570,7 +2933,7 @@ pushMessageContentVoiceNote voice_note:voiceNote is_pinned:Bool = PushMessageCon pushMessageContentBasicGroupChatCreate = PushMessageContent; //@description New chat members were invited to a group @member_name Name of the added member @is_current_user True, if the current user was added to the group -//@is_returned True, if the user has returned to the group themself +//@is_returned True, if the user has returned to the group themselves pushMessageContentChatAddMembers member_name:string is_current_user:Bool is_returned:Bool = PushMessageContent; //@description A chat photo was edited @@ -2579,13 +2942,19 @@ pushMessageContentChatChangePhoto = PushMessageContent; //@description A chat title was edited @title New chat title pushMessageContentChatChangeTitle title:string = PushMessageContent; +//@description A chat theme was edited @theme_name If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one +pushMessageContentChatSetTheme theme_name:string = PushMessageContent; + //@description A chat member was deleted @member_name Name of the deleted member @is_current_user True, if the current user was deleted from the group -//@is_left True, if the user has left the group themself +//@is_left True, if the user has left the group themselves pushMessageContentChatDeleteMember member_name:string is_current_user:Bool is_left:Bool = PushMessageContent; -//@description A new member joined the chat by invite link +//@description A new member joined the chat via an invite link pushMessageContentChatJoinByLink = PushMessageContent; +//@description A new member was accepted to the chat by an administrator +pushMessageContentChatJoinByRequest = PushMessageContent; + //@description A forwarded messages @total_count Number of forwarded messages pushMessageContentMessageForwards total_count:int32 = PushMessageContent; @@ -2607,11 +2976,11 @@ 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, or as reply_to_message_id -//@sender The sender of the message. Corresponding user or chat may be inaccessible +//@sender_id Identifier of 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; +notificationTypeNewPushMessage message_id:int53 sender_id:MessageSender sender_name:string is_outgoing:Bool content:PushMessageContent = NotificationType; //@class NotificationGroupType @description Describes the type of notifications in a notification group @@ -2687,7 +3056,7 @@ userPrivacySettingRuleAllowAll = UserPrivacySettingRule; userPrivacySettingRuleAllowContacts = UserPrivacySettingRule; //@description A rule to allow certain specified users to do something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 -userPrivacySettingRuleAllowUsers user_ids:vector = UserPrivacySettingRule; +userPrivacySettingRuleAllowUsers user_ids:vector = UserPrivacySettingRule; //@description A rule to allow all members of certain specified basic groups and supergroups to doing something @chat_ids The chat identifiers, total number of chats in all rules must not exceed 20 userPrivacySettingRuleAllowChatMembers chat_ids:vector = UserPrivacySettingRule; @@ -2699,7 +3068,7 @@ userPrivacySettingRuleRestrictAll = UserPrivacySettingRule; userPrivacySettingRuleRestrictContacts = UserPrivacySettingRule; //@description A rule to restrict all specified users from doing something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 -userPrivacySettingRuleRestrictUsers user_ids:vector = UserPrivacySettingRule; +userPrivacySettingRuleRestrictUsers user_ids:vector = UserPrivacySettingRule; //@description A rule to restrict all members of specified basic groups and supergroups from doing something @chat_ids The chat identifiers, total number of chats in all rules must not exceed 20 userPrivacySettingRuleRestrictChatMembers chat_ids:vector = UserPrivacySettingRule; @@ -2734,23 +3103,25 @@ userPrivacySettingAllowPeerToPeerCalls = UserPrivacySetting; userPrivacySettingAllowFindingByPhoneNumber = UserPrivacySetting; -//@description Contains information about the period of inactivity after which the current user's account will automatically be deleted @days Number of days of inactivity before the account will be flagged for deletion; should range from 30-366 days +//@description Contains information about the period of inactivity after which the current user's account will automatically be deleted @days Number of days of inactivity before the account will be flagged for deletion; 30-366 days accountTtl days:int32 = AccountTtl; -//@description Contains information about one session in a Telegram application used by the current user. Sessions should be shown to the user in the returned order +//@description Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order //@id Session identifier @is_current True, if this session is the current session //@is_password_pending True, if a password is needed to complete authorization of the session +//@can_accept_secret_chats True, if incoming secret chats can be accepted by the session +//@can_accept_calls True, if incoming calls can be accepted by the session //@api_id Telegram API identifier, as provided by the application @application_name Name of the application, as provided by the application //@application_version The version of the application, as provided by the application @is_official_application True, if the application is an official application or uses the api_id of an official application //@device_model Model of the device the application has been run or is running on, as provided by the application @platform Operating system the application has been run or is running on, as provided by the application //@system_version Version of the operating system the application has been run or is running on, as provided by the application @log_in_date Point in time (Unix timestamp) when the user has logged in //@last_active_date Point in time (Unix timestamp) when the session was last used @ip IP address from which the session was created, in human-readable format //@country A two-letter country code for the country from which the session was created, based on the IP address @region Region code from which the session was created, based on the IP address -session id:int64 is_current:Bool is_password_pending:Bool api_id:int32 application_name:string application_version:string is_official_application:Bool device_model:string platform:string system_version:string log_in_date:int32 last_active_date:int32 ip:string country:string region:string = Session; +session id:int64 is_current:Bool is_password_pending:Bool can_accept_secret_chats:Bool can_accept_calls:Bool api_id:int32 application_name:string application_version:string is_official_application:Bool device_model:string platform:string system_version:string log_in_date:int32 last_active_date:int32 ip:string country:string region:string = Session; -//@description Contains a list of sessions @sessions List of sessions -sessions sessions:vector = Sessions; +//@description Contains a list of sessions @sessions List of sessions @inactive_session_ttl_days Number of days of inactivity before sessions will automatically be terminated; 1-366 days +sessions sessions:vector inactive_session_ttl_days:int32 = Sessions; //@description Contains information about one website the current user is logged in with Telegram @@ -2763,7 +3134,7 @@ sessions sessions:vector = Sessions; //@last_active_date Point in time (Unix timestamp) when obtained authorization was last used //@ip IP address from which the user was logged in, in human-readable format //@location Human-readable description of a country and a region, from which the user was logged in, based on the IP address -connectedWebsite id:int64 domain_name:string bot_user_id:int32 browser:string platform:string log_in_date:int32 last_active_date:int32 ip:string location:string = ConnectedWebsite; +connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string platform:string log_in_date:int32 last_active_date:int32 ip:string location:string = ConnectedWebsite; //@description Contains a list of websites the current user is logged in with Telegram @websites List of connected websites connectedWebsites websites:vector = ConnectedWebsites; @@ -2789,8 +3160,99 @@ chatReportReasonCopyright = ChatReportReason; //@description The location-based chat is unrelated to its stated location chatReportReasonUnrelatedLocation = ChatReportReason; -//@description A custom reason provided by the user @text Report text -chatReportReasonCustom text:string = ChatReportReason; +//@description The chat represents a fake account +chatReportReasonFake = ChatReportReason; + +//@description A custom reason provided by the user +chatReportReasonCustom = ChatReportReason; + + +//@class InternalLinkType @description Describes an internal https://t.me or tg: link, which must be processed by the app in a special way + +//@description The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link +internalLinkTypeActiveSessions = InternalLinkType; + +//@description The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode @code The authentication code +internalLinkTypeAuthenticationCode code:string = InternalLinkType; + +//@description The link is a link to a background. Call searchBackground with the given background name to process the link @background_name Name of the background +internalLinkTypeBackground background_name:string = InternalLinkType; + +//@description The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, +//-and then call sendBotStartMessage with the given start parameter after the button is pressed +//@bot_username Username of the bot @start_parameter The parameter to be passed to sendBotStartMessage +internalLinkTypeBotStart bot_username:string start_parameter:string = InternalLinkType; + +//@description The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, +//-ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group +//@bot_username Username of the bot @start_parameter The parameter to be passed to sendBotStartMessage +internalLinkTypeBotStartInGroup bot_username:string start_parameter:string = InternalLinkType; + +//@description The link is a link to the change phone number section of the app +internalLinkTypeChangePhoneNumber = InternalLinkType; + +//@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link +internalLinkTypeChatInvite invite_link:string = InternalLinkType; + +//@description The link is a link to the filter settings section of the app +internalLinkTypeFilterSettings = InternalLinkType; + +//@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame +//@bot_username Username of the bot that owns the game @game_short_name Short name of the game +internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkType; + +//@description The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link @language_pack_id Language pack identifier +internalLinkTypeLanguagePack language_pack_id:string = InternalLinkType; + +//@description The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link @url URL to be passed to getMessageLinkInfo +internalLinkTypeMessage url:string = InternalLinkType; + +//@description The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field +//@text Message draft text @contains_link True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected +internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLinkType; + +//@description The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the app, otherwise ignore it +//@bot_user_id User identifier of the service's bot @scope Telegram Passport element types requested by the service @public_key Service's public key @nonce Unique request identifier provided by the service +//@callback_url An HTTP URL to open once the request is finished or canceled with the parameter tg_passport=success or tg_passport=cancel respectively. If empty, then the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel needs to be opened instead +internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:string nonce:string callback_url:string = InternalLinkType; + +//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link +//@hash Hash value from the link @phone_number Phone number value from the link +internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType; + +//@description The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy +//@server Proxy server IP address @port Proxy server port @type Type of the proxy +internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType; + +//@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link @chat_username Username of the chat +internalLinkTypePublicChat chat_username:string = InternalLinkType; + +//@description The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to +//-"This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown +internalLinkTypeQrCodeAuthentication = InternalLinkType; + +//@description The link is a link to app settings +internalLinkTypeSettings = InternalLinkType; + +//@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set @sticker_set_name Name of the sticker set +internalLinkTypeStickerSet sticker_set_name:string = InternalLinkType; + +//@description The link is a link to a theme. TDLib has no theme support yet @theme_name Name of the theme +internalLinkTypeTheme theme_name:string = InternalLinkType; + +//@description The link is a link to the theme settings section of the app +internalLinkTypeThemeSettings = InternalLinkType; + +//@description The link is an unknown tg: link. Call getDeepLinkInfo to process the link @link Link to be passed to getDeepLinkInfo +internalLinkTypeUnknownDeepLink link:string = InternalLinkType; + +//@description The link is a link to an unsupported proxy. An alert can be shown to the user +internalLinkTypeUnsupportedProxy = InternalLinkType; + +//@description The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link +//@chat_username Username of the chat with the video chat @invite_hash If non-empty, invite hash to be used to join the video chat without being muted by administrators +//@is_live_stream True, if the video chat is expected to be a live stream in a channel or a broadcast group +internalLinkTypeVideoChat chat_username:string invite_hash:string is_live_stream:Bool = InternalLinkType; //@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 @@ -2800,9 +3262,10 @@ messageLink link:string is_public:Bool = MessageLink; //@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 +//@media_timestamp Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview //@for_album True, if the whole media album to which the message belongs is linked //@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; +messageLinkInfo is_public:Bool chat_id:int53 message:message media_timestamp:int32 for_album:Bool for_comment:Bool = MessageLinkInfo; //@description Contains a part of a file @data File bytes @@ -2860,16 +3323,16 @@ fileTypeVoiceNote = FileType; fileTypeWallpaper = FileType; -//@description Contains the storage usage statistics for a specific file type @file_type File type @size Total size of the files @count Total number of files +//@description Contains the storage usage statistics for a specific file type @file_type File type @size Total size of the files, in bytes @count Total number of files storageStatisticsByFileType file_type:FileType size:int53 count:int32 = StorageStatisticsByFileType; -//@description Contains the storage usage statistics for a specific chat @chat_id Chat identifier; 0 if none @size Total size of the files in the chat @count Total number of files in the chat @by_file_type Statistics split by file types +//@description Contains the storage usage statistics for a specific chat @chat_id Chat identifier; 0 if none @size Total size of the files in the chat, in bytes @count Total number of files in the chat @by_file_type Statistics split by file types storageStatisticsByChat chat_id:int53 size:int53 count:int32 by_file_type:vector = StorageStatisticsByChat; -//@description Contains the exact storage usage statistics split by chats and file type @size Total size of files @count Total number of files @by_chat Statistics split by chats +//@description Contains the exact storage usage statistics split by chats and file type @size Total size of files, in bytes @count Total number of files @by_chat Statistics split by chats storageStatistics size:int53 count:int32 by_chat:vector = StorageStatistics; -//@description Contains approximate storage usage statistics, excluding files of unknown file type @files_size Approximate total size of files @file_count Approximate number of files +//@description Contains approximate storage usage statistics, excluding files of unknown file type @files_size Approximate total size of files, in bytes @file_count Approximate number of files //@database_size Size of the database @language_pack_database_size Size of the language pack database @log_size Size of the TDLib internal log storageStatisticsFast files_size:int53 file_count:int32 database_size:int53 language_pack_database_size:int53 log_size:int53 = StorageStatisticsFast; @@ -2898,12 +3361,17 @@ networkTypeOther = NetworkType; //@class NetworkStatisticsEntry @description Contains statistics about network usage -//@description Contains information about the total amount of data that was used to send and receive files @file_type Type of the file the data is part of @network_type Type of the network the data was sent through. Call setNetworkType to maintain the actual network type +//@description Contains information about the total amount of data that was used to send and receive files +//@file_type Type of the file the data is part of; pass null if the data isn't related to files +//@network_type Type of the network the data was sent through. Call setNetworkType to maintain the actual network type //@sent_bytes Total number of bytes sent @received_bytes Total number of bytes received networkStatisticsEntryFile file_type:FileType network_type:NetworkType sent_bytes:int53 received_bytes:int53 = NetworkStatisticsEntry; -//@description Contains information about the total amount of data that was used for calls @network_type Type of the network the data was sent through. Call setNetworkType to maintain the actual network type -//@sent_bytes Total number of bytes sent @received_bytes Total number of bytes received @duration Total call duration, in seconds +//@description Contains information about the total amount of data that was used for calls +//@network_type Type of the network the data was sent through. Call setNetworkType to maintain the actual network type +//@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) from which the statistics are collected @entries Network statistics entries @@ -2912,16 +3380,16 @@ networkStatistics since_date:int32 entries:vector = Netw //@description Contains auto-download settings //@is_auto_download_enabled True, if the auto-download is enabled -//@max_photo_file_size The maximum size of a photo file to be auto-downloaded -//@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 +//@max_photo_file_size The maximum size of a photo file to be auto-downloaded, in bytes +//@max_video_file_size The maximum size of a video file to be auto-downloaded, in bytes +//@max_other_file_size The maximum size of other file types to be auto-downloaded, in bytes +//@video_upload_bitrate The maximum suggested bitrate for uploaded videos, in kbit/s //@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; -//@description Contains auto-download settings presets for the user +//@description Contains auto-download settings presets for the current user //@low Preset with lowest settings; supposed to be used by default when roaming //@medium Preset with medium settings; supposed to be used by default when using mobile data //@high Preset with highest settings; supposed to be used by default when connected on Wi-Fi @@ -2973,7 +3441,7 @@ topChatCategoryForwardChats = TopChatCategory; //@class TMeUrlType @description Describes the type of a URL linking to an internal Telegram entity //@description A URL linking to a user @user_id Identifier of the user -tMeUrlTypeUser user_id:int32 = TMeUrlType; +tMeUrlTypeUser user_id:int53 = TMeUrlType; //@description A URL linking to a public supergroup or channel @supergroup_id Identifier of the supergroup or channel tMeUrlTypeSupergroup supergroup_id:int53 = TMeUrlType; @@ -2996,9 +3464,21 @@ tMeUrls urls:vector = TMeUrls; //@description Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option suggestedActionEnableArchiveAndMuteNewChats = SuggestedAction; -//@description Suggests the user to check authorization phone number and change the phone number if it is inaccessible +//@description Suggests the user to check whether they still remember their 2-step verification password +suggestedActionCheckPassword = SuggestedAction; + +//@description Suggests the user to check whether authorization phone number is correct and change the phone number if it is inaccessible suggestedActionCheckPhoneNumber = SuggestedAction; +//@description Suggests the user to view a hint about the meaning of one and two check marks on sent messages +suggestedActionViewChecksHint = SuggestedAction; + +//@description Suggests the user to convert specified supergroup to a broadcast group @supergroup_id Supergroup identifier +suggestedActionConvertToBroadcastGroup supergroup_id:int53 = SuggestedAction; + +//@description Suggests the user to set a 2-step verification password to be able to log in again @authorization_delay The number of days to pass between consecutive authorizations if the user declines to set password +suggestedActionSetPassword authorization_delay:int32 = SuggestedAction; + //@description Contains a counter @count Count count count:int32 = Count; @@ -3010,11 +3490,11 @@ text text:string = Text; seconds seconds:double = Seconds; -//@description Contains information about a tg:// deep link @text Text to be shown to the user @need_update_application True, if user should be asked to update the application +//@description Contains information about a tg: deep link @text Text to be shown to the user @need_update_application True, if the user must be asked to update the application deepLinkInfo text:formattedText need_update_application:Bool = DeepLinkInfo; -//@class TextParseMode @description Describes the way the text should be parsed for TextEntities +//@class TextParseMode @description Describes the way the text needs to be parsed for TextEntities //@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 @@ -3048,7 +3528,7 @@ proxies proxies:vector = Proxies; //@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 +//@mask_position For masks, position where the mask is placed; pass null if unspecified inputStickerStatic sticker:InputFile emojis:string mask_position:maskPosition = InputSticker; //@description An animated sticker in TGS format @@ -3086,20 +3566,20 @@ chatStatisticsMessageInteractionInfo message_id:int53 view_count:int32 forward_c //@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; +//@average_character_count Average number of characters in sent messages; 0 if unknown +chatStatisticsMessageSenderInfo user_id:int53 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; +chatStatisticsAdministratorActionsInfo user_id:int53 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; +chatStatisticsInviterInfo user_id:int53 added_member_count:int32 = ChatStatisticsInviterInfo; //@class ChatStatistics @description Contains a detailed statistics about a chat @@ -3146,6 +3626,43 @@ chatStatisticsChannel period:dateRange member_count:statisticalValue mean_view_c messageStatistics message_interaction_graph:StatisticalGraph = MessageStatistics; +//@description A point on a Cartesian plane @x The point's first coordinate @y The point's second coordinate +point x:double y:double = Point; + + +//@class VectorPathCommand @description Represents a vector path command + +//@description A straight line to a given point @end_point The end point of the straight line +vectorPathCommandLine end_point:point = VectorPathCommand; + +//@description A cubic Bézier curve to a given point @start_control_point The start control point of the curve @end_control_point The end control point of the curve @end_point The end point of the curve +vectorPathCommandCubicBezierCurve start_control_point:point end_control_point:point end_point:point = VectorPathCommand; + + +//@class BotCommandScope @description Represents the scope to which bot commands are relevant + +//@description A scope covering all users +botCommandScopeDefault = BotCommandScope; + +//@description A scope covering all private chats +botCommandScopeAllPrivateChats = BotCommandScope; + +//@description A scope covering all group and supergroup chats +botCommandScopeAllGroupChats = BotCommandScope; + +//@description A scope covering all group and supergroup chat administrators +botCommandScopeAllChatAdministrators = BotCommandScope; + +//@description A scope covering all members of a chat @chat_id Chat identifier +botCommandScopeChat chat_id:int53 = BotCommandScope; + +//@description A scope covering all administrators of a chat @chat_id Chat identifier +botCommandScopeChatAdministrators chat_id:int53 = BotCommandScope; + +//@description A scope covering a member of a chat @chat_id Chat identifier @user_id User identifier +botCommandScopeChatMember chat_id:int53 user_id:int53 = BotCommandScope; + + //@class Update @description Contains notifications about data changes //@description The user authorization state has changed @authorization_state New authorization state @@ -3158,11 +3675,11 @@ updateNewMessage message:message = Update; //@chat_id The chat identifier of the sent message @message_id A temporary message identifier updateMessageSendAcknowledged chat_id:int53 message_id:int53 = Update; -//@description A message has been successfully sent @message Information about the sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change @old_message_id The previous temporary message identifier +//@description A message has been successfully sent @message The sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change @old_message_id The previous temporary message identifier updateMessageSendSucceeded message:message old_message_id:int53 = Update; //@description A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update -//@message Contains information about the message which failed to send @old_message_id The previous temporary message identifier @error_code An error code @error_message Error message +//@message The failed to send message @old_message_id The previous temporary message identifier @error_code An error code @error_message Error message updateMessageSendFailed message:message old_message_id:int53 error_code:int32 error_message:string = Update; //@description The message content has changed @chat_id Chat identifier @message_id Message identifier @new_content New message content @@ -3205,42 +3722,57 @@ updateChatLastMessage chat_id:int53 last_message:message positions:vector = Update; + +//@description The message sender that is selected to send messages in a chat has changed @chat_id Chat identifier @message_sender_id New value of message_sender_id; may be null if the user can't change message sender +updateChatMessageSender chat_id:int53 message_sender_id:MessageSender = Update; + +//@description The message Time To Live setting for a chat was changed @chat_id Chat identifier @message_ttl New value of message_ttl +updateChatMessageTtl chat_id:int53 message_ttl:int32 = Update; //@description Notification settings for a chat were changed @chat_id Chat identifier @notification_settings The new notification settings updateChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Update; -//@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings -updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update; - -//@description 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 pending join requests were changed @chat_id Chat identifier @pending_join_requests The new data about pending join requests; may be null +updateChatPendingJoinRequests chat_id:int53 pending_join_requests:chatJoinRequestsInfo = Update; //@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 @positions The new chat positions in the chat lists -updateChatDraftMessage chat_id:int53 draft_message:draftMessage positions:vector = Update; +//@description The chat theme was changed @chat_id Chat identifier @theme_name The new name of the chat theme; may be empty if theme was reset to default +updateChatTheme chat_id:int53 theme_name:string = Update; + +//@description The chat unread_mention_count has changed @chat_id Chat identifier @unread_mention_count The number of unread mention messages left in the chat +updateChatUnreadMentionCount chat_id:int53 unread_mention_count:int32 = Update; + +//@description A chat video chat state has changed @chat_id Chat identifier @video_chat New value of video_chat +updateChatVideoChat chat_id:int53 video_chat:videoChat = Update; + +//@description The value of the default disable_notification parameter, used when a message is sent to the chat, was changed @chat_id Chat identifier @default_disable_notification The new default_disable_notification value +updateChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Update; + +//@description A chat content was allowed or restricted for saving @chat_id Chat identifier @has_protected_content New value of has_protected_content +updateChatHasProtectedContent chat_id:int53 has_protected_content:Bool = Update; + +//@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages +updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update; + +//@description A chat was blocked or unblocked @chat_id Chat identifier @is_blocked New value of is_blocked +updateChatIsBlocked chat_id:int53 is_blocked:Bool = Update; + +//@description A chat was marked as unread or was read @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread +updateChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Update; //@description The list of chat filters or a chat filter has changed @chat_filters The new list of chat filters updateChatFilters chat_filters:vector = Update; @@ -3248,6 +3780,9 @@ 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; +//@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings +updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update; + //@description A notification was changed @notification_group_id Unique notification group identifier @notification Changed notification updateNotification notification_group_id:int32 notification:notification = Update; @@ -3256,7 +3791,7 @@ updateNotification notification_group_id:int32 notification:notification = Updat //@type New type of the notification group //@chat_id Identifier of a chat to which all notifications in the group belong //@notification_settings_chat_id Chat identifier, which notification settings must be applied to the added notifications -//@is_silent True, if the notifications should be shown without sound +//@is_silent True, if the notifications must be shown without sound //@total_count Total number of unread notifications in the group, can be bigger than number of active notifications //@added_notifications List of added group notifications, sorted by notification ID @removed_notification_ids Identifiers of removed group notifications, sorted by notification ID updateNotificationGroup notification_group_id:int32 type:NotificationGroupType chat_id:int53 notification_settings_chat_id:int53 is_silent:Bool total_count:int32 added_notifications:vector removed_notification_ids:vector = Update; @@ -3274,11 +3809,11 @@ 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 @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 A message sender 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 @sender_id Identifier of a message sender performing the action @action The action +updateChatAction chat_id:int53 message_thread_id:int53 sender_id:MessageSender action:ChatAction = Update; //@description The user went online or offline @user_id User identifier @status New status of the user -updateUserStatus user_id:int32 status:UserStatus = Update; +updateUserStatus user_id:int53 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 application @user New data about the user updateUser user:user = Update; @@ -3292,17 +3827,17 @@ 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 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 -updateUserFullInfo user_id:int32 user_full_info:userFullInfo = Update; +//@description Some data in userFullInfo has been changed @user_id User identifier @user_full_info New full information about the user +updateUserFullInfo user_id:int53 user_full_info:userFullInfo = Update; -//@description Some data from basicGroupFullInfo has been changed @basic_group_id Identifier of a basic group @basic_group_full_info New full information about the group -updateBasicGroupFullInfo basic_group_id:int32 basic_group_full_info:basicGroupFullInfo = Update; +//@description Some data in basicGroupFullInfo has been changed @basic_group_id Identifier of a basic group @basic_group_full_info New full information about the group +updateBasicGroupFullInfo basic_group_id:int53 basic_group_full_info:basicGroupFullInfo = Update; -//@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 Some data in supergroupFullInfo has been changed @supergroup_id Identifier of the supergroup or channel @supergroup_full_info New full information about the supergroup +updateSupergroupFullInfo supergroup_id:int53 supergroup_full_info:supergroupFullInfo = Update; -//@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 +//@description A service notification from the server was received. 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" must be shown under notification; if user presses the second, all local data must be destroyed using Destroy method //@content Notification content updateServiceNotification type:string content:MessageContent = Update; @@ -3312,8 +3847,8 @@ updateFile file:file = Update; //@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 application +//@destination_path The path to a file that must be created and where the new file is 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 must 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 @@ -3322,6 +3857,13 @@ 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 Information about a group call was updated @group_call New data about a group call +updateGroupCall group_call:groupCall = Update; + +//@description Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined +//@group_call_id Identifier of group call @participant New data about a participant +updateGroupCallParticipant group_call_id:int32 participant:groupCallParticipant = Update; + //@description New call signaling data arrived @call_id The call identifier @data The data updateNewCallSignalingData call_id:int32 data:bytes = Update; @@ -3363,13 +3905,16 @@ updateSavedAnimations animation_ids:vector = Update; //@description The selected background has changed @for_dark_theme True, if background for dark theme has changed @background The new selected background; may be null updateSelectedBackground for_dark_theme:Bool background:background = Update; +//@description The list of available chat themes has changed @chat_themes The new list of chat themes +updateChatThemes chat_themes:vector = 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. 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 +//@description New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must 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 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 @@ -3378,6 +3923,10 @@ updateUsersNearby users_nearby:vector = Update; //@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis updateDiceEmojis emojis:vector = Update; +//@description Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played +//@chat_id Chat identifier @message_id Message identifier @sticker The animated sticker to be played +updateAnimatedEmojiMessageClicked chat_id:int53 message_id:int53 sticker:sticker = 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; @@ -3385,28 +3934,28 @@ updateAnimationSearchParameters provider:string emojis:vector = Update; updateSuggestedActions added_actions:vector removed_actions:vector = Update; //@description A new incoming inline query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @user_location User location; may be null -//@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; +//@chat_type The type of the chat, from which the query originated; may be null if unknown @query Text of the query @offset Offset of the first entry to return +updateNewInlineQuery id:int64 sender_user_id:int53 user_location:location chat_type:ChatType query:string offset:string = Update; //@description The user has chosen a result of an inline query; for bots only @sender_user_id Identifier of the user who sent the query @user_location User location; may be null //@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; +updateNewChosenInlineResult sender_user_id:int53 user_location:location query:string result_id:string inline_message_id:string = Update; //@description A new incoming callback query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query //@chat_id Identifier of the chat where the query was sent @message_id Identifier of the message, from which the query originated //@chat_instance Identifier that uniquely corresponds to the chat to which the message was sent @payload Query payload -updateNewCallbackQuery id:int64 sender_user_id:int32 chat_id:int53 message_id:int53 chat_instance:int64 payload:CallbackQueryPayload = Update; +updateNewCallbackQuery id:int64 sender_user_id:int53 chat_id:int53 message_id:int53 chat_instance:int64 payload:CallbackQueryPayload = Update; //@description A new incoming callback query from a message sent via a bot; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @inline_message_id Identifier of the inline message, from which the query originated //@chat_instance An identifier uniquely corresponding to the chat a message was sent to @payload Query payload -updateNewInlineCallbackQuery id:int64 sender_user_id:int32 inline_message_id:string chat_instance:int64 payload:CallbackQueryPayload = Update; +updateNewInlineCallbackQuery id:int64 sender_user_id:int53 inline_message_id:string chat_instance:int64 payload:CallbackQueryPayload = Update; //@description A new incoming shipping query; for bots only. Only for invoices with flexible price @id Unique query identifier @sender_user_id Identifier of the user who sent the query @invoice_payload Invoice payload @shipping_address User shipping address -updateNewShippingQuery id:int64 sender_user_id:int32 invoice_payload:string shipping_address:address = Update; +updateNewShippingQuery id:int64 sender_user_id:int53 invoice_payload:string shipping_address:address = Update; -//@description A new incoming pre-checkout query; for bots only. Contains full information about a checkout @id Unique query identifier @sender_user_id Identifier of the user who sent the query @currency Currency for the product price @total_amount Total price for the product, in the minimal quantity of the currency +//@description A new incoming pre-checkout query; for bots only. Contains full information about a checkout @id Unique query identifier @sender_user_id Identifier of the user who sent the query @currency Currency for the product price @total_amount Total price for the product, in the smallest units of the currency //@invoice_payload Invoice payload @shipping_option_id Identifier of a shipping option chosen by the user; may be empty if not applicable @order_info Information about the order; may be null -updateNewPreCheckoutQuery id:int64 sender_user_id:int32 currency:string total_amount:int53 invoice_payload:bytes shipping_option_id:string order_info:orderInfo = Update; +updateNewPreCheckoutQuery id:int64 sender_user_id:int53 currency:string total_amount:int53 invoice_payload:bytes shipping_option_id:string order_info:orderInfo = Update; //@description A new incoming event; for bots only @event A JSON-serialized event updateNewCustomEvent event:string = Update; @@ -3418,7 +3967,15 @@ updateNewCustomQuery id:int64 data:string timeout:int32 = Update; updatePoll poll:poll = Update; //@description A user changed the answer to a poll; for bots only @poll_id Unique poll identifier @user_id The user, who changed the answer to the poll @option_ids 0-based identifiers of answer options, chosen by the user -updatePollAnswer poll_id:int64 user_id:int32 option_ids:vector = Update; +updatePollAnswer poll_id:int64 user_id:int53 option_ids:vector = Update; + +//@description User rights changed in a chat; for bots only @chat_id Chat identifier @actor_user_id Identifier of the user, changing the rights +//@date Point in time (Unix timestamp) when the user rights was changed @invite_link If user has joined the chat using an invite link, the invite link; may be null +//@old_chat_member Previous chat member @new_chat_member New chat member +updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink old_chat_member:chatMember new_chat_member:chatMember = Update; + +//@description A user sent a join request to a chat; for bots only @chat_id Chat identifier @request Join request @invite_link The invite link, which was used to send join request; may be null +updateNewChatJoinRequest chat_id:int53 request:chatJoinRequest invite_link:chatInviteLink = Update; //@description Contains a list of updates @updates List of updates @@ -3432,7 +3989,7 @@ 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 +//@max_file_size The maximum size of the file to where the internal TDLib log is written before the file will automatically be rotated, in bytes //@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; @@ -3468,7 +4025,7 @@ testVectorStringObject value:vector = TestVectorStringObject; getAuthorizationState = AuthorizationState; -//@description Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters @parameters Parameters +//@description Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters @parameters Parameters for TDLib initialization setTdlibParameters parameters:tdlibParameters = Ok; //@description Checks the database encryption key for correctness. Works only when the current authorization state is authorizationStateWaitEncryptionKey @encryption_key Encryption key to check or set up @@ -3476,19 +4033,19 @@ checkDatabaseEncryptionKey encryption_key:bytes = Ok; //@description Sets the phone number of the user and sends an authentication code to the user. 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 -//@phone_number The phone number of the user, in international format @settings Settings for the authentication of the user's phone number +//@phone_number The phone number of the user, in international format @settings Settings for the authentication of the user's phone number; pass null to use default settings setAuthenticationPhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = Ok; -//@description Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode and the next_code_type of the result is not null +//@description Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed 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 +//@description Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode @code Authentication code to check 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, //-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; +requestQrCodeAuthentication other_user_ids:vector = Ok; //@description Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration //@first_name The first name of the user; 1-64 characters @last_name The last name of the user; 0-64 characters @@ -3500,8 +4057,12 @@ checkAuthenticationPassword password:string = Ok; //@description Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword requestAuthenticationPasswordRecovery = Ok; -//@description Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword @recovery_code Recovery code to check -recoverAuthenticationPassword recovery_code:string = Ok; +//@description Checks whether a password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword @recovery_code Recovery code to check +checkAuthenticationPasswordRecoveryCode recovery_code:string = Ok; + +//@description Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword +//@recovery_code Recovery code to check @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty +recoverAuthenticationPassword recovery_code:string new_password:string new_hint:string = Ok; //@description Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in @token The bot token checkAuthenticationBotToken token:string = Ok; @@ -3531,8 +4092,8 @@ setDatabaseEncryptionKey new_encryption_key:bytes = Ok; //@description Returns the current state of 2-step verification getPasswordState = PasswordState; -//@description Changes the password for the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed -//@old_password Previous password of the user @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty @set_recovery_email_address Pass true if the recovery email address should be changed @new_recovery_email_address New recovery email address; may be empty +//@description Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed +//@old_password Previous password of the user @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty @set_recovery_email_address Pass true if the recovery email address must be changed @new_recovery_email_address New recovery email address; may be empty setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState; //@description Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user @password The password for the current user @@ -3542,19 +4103,29 @@ getRecoveryEmailAddress password:string = RecoveryEmailAddress; //-If new_recovery_email_address is the same as the email address that is currently set up, this call succeeds immediately and aborts all other requests waiting for an email confirmation @password Password of the current user @new_recovery_email_address New recovery email address setRecoveryEmailAddress password:string new_recovery_email_address:string = PasswordState; -//@description Checks the 2-step verification recovery email address verification code @code Verification code +//@description Checks the 2-step verification recovery email address verification code @code Verification code to check checkRecoveryEmailAddressCode code:string = PasswordState; //@description Resends the 2-step verification recovery email address verification code resendRecoveryEmailAddressCode = PasswordState; -//@description Requests to send a password recovery code to an email address that was previously set up +//@description Requests to send a 2-step verification password recovery code to an email address that was previously set up requestPasswordRecovery = EmailAddressAuthenticationCodeInfo; -//@description Recovers the password using a recovery code sent to an email address that was previously set up @recovery_code Recovery code to check -recoverPassword recovery_code:string = PasswordState; +//@description Checks whether a 2-step verification password recovery code sent to an email address is valid @recovery_code Recovery code to check +checkPasswordRecoveryCode recovery_code:string = Ok; -//@description Creates a new temporary password for processing payments @password Persistent user password @valid_for Time during which the temporary password will be valid, in seconds; should be between 60 and 86400 +//@description Recovers the 2-step verification password using a recovery code sent to an email address that was previously set up +//@recovery_code Recovery code to check @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty +recoverPassword recovery_code:string new_password:string new_hint:string = PasswordState; + +//@description Removes 2-step verification password without previous password and access to recovery email address. The password can't be reset immediately and the request needs to be repeated after the specified time +resetPassword = ResetPasswordResult; + +//@description Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date > 0 +cancelPasswordReset = Ok; + +//@description Creates a new temporary password for processing payments @password Persistent user password @valid_for Time during which the temporary password will be valid, in seconds; must be between 60 and 86400 createTemporaryPassword password:string valid_for:int32 = TemporaryPasswordState; //@description Returns information about the current temporary password @@ -3565,22 +4136,22 @@ getTemporaryPasswordState = TemporaryPasswordState; getMe = User; //@description Returns information about a user by their identifier. This is an offline request if the current user is not a bot @user_id User identifier -getUser user_id:int32 = User; +getUser user_id:int53 = User; //@description Returns full information about a user by their identifier @user_id User identifier -getUserFullInfo user_id:int32 = UserFullInfo; +getUserFullInfo user_id:int53 = UserFullInfo; //@description Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot @basic_group_id Basic group identifier -getBasicGroup basic_group_id:int32 = BasicGroup; +getBasicGroup basic_group_id:int53 = BasicGroup; //@description Returns full information about a basic group by its identifier @basic_group_id Basic group identifier -getBasicGroupFullInfo basic_group_id:int32 = BasicGroupFullInfo; +getBasicGroupFullInfo basic_group_id:int53 = BasicGroupFullInfo; //@description Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot @supergroup_id Supergroup or channel identifier -getSupergroup supergroup_id:int32 = Supergroup; +getSupergroup supergroup_id:int53 = Supergroup; //@description Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute @supergroup_id Supergroup or channel identifier -getSupergroupFullInfo supergroup_id:int32 = SupergroupFullInfo; +getSupergroupFullInfo supergroup_id:int53 = SupergroupFullInfo; //@description Returns information about a secret chat by its identifier. This is an offline request @secret_chat_id Secret chat identifier getSecretChat secret_chat_id:int32 = SecretChat; @@ -3595,7 +4166,7 @@ getMessage chat_id:int53 message_id:int53 = Message; getMessageLocally chat_id:int53 message_id:int53 = Message; //@description Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, and the invoice message for messages of the types messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively -//@chat_id Identifier of the chat the message belongs to @message_id Identifier of the message reply to which to get +//@chat_id Identifier of the chat the message belongs to @message_id Identifier of the reply message getRepliedMessage chat_id:int53 message_id:int53 = Message; //@description Returns information about a newest pinned message in the chat @chat_id Identifier of the chat the message belongs to @@ -3610,34 +4181,40 @@ 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 viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true @chat_id Chat identifier @message_id Identifier of the message +getMessageViewers chat_id:int53 message_id:int53 = Users; + //@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 application -//@remote_file_id Remote identifier of the file to get @file_type File type, if known +//@remote_file_id Remote identifier of the file to get @file_type File type; pass null if unknown 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 (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 -//@limit The maximum number of chats to be returned. It is possible that fewer chats than the limit are returned even if the end of the list is not reached -getChats chat_list:ChatList offset_order:int64 offset_chat_id:int53 limit:int32 = Chats; +//@description Loads more chats from a chat list. The loaded chats and their positions in the chat list will be sent through updates. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. Returns a 404 error if all chats have been loaded +//@chat_list The chat list in which to load chats; pass null to load chats from the main chat list +//@limit The maximum number of chats to be loaded. For optimal performance, the number of loaded chats is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached +loadChats chat_list:ChatList limit:int32 = Ok; -//@description Searches a public chat by its username. Currently only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned @username Username to be resolved +//@description Returns an ordered list of chats from the beginning of a chat list. For informational purposes only. Use loadChats and updates processing instead to maintain chat lists in a consistent state +//@chat_list The chat list in which to return chats; pass null to get chats from the main chat list @limit The maximum number of chats to be returned +getChats chat_list:ChatList limit:int32 = Chats; + +//@description Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned @username Username to be resolved 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 +//@description Searches public chats by looking for specified query in their username and title. Currently, only private chats, supergroups and channels can be public. Returns a meaningful number of results. +//-Excludes private chats with contacts and chats from the chat list from the results @query Query to search for searchPublicChats query:string = Chats; -//@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 +//@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 50 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 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 +//@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 must be sent again every 25 seconds with adjusted location to not miss new chats @location Current user location searchChatsNearby location:location = ChatsNearby; //@description Returns a list of frequently used chats. Supported only if the chat info database is enabled @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30 @@ -3655,7 +4232,10 @@ removeRecentlyFoundChat chat_id:int53 = Ok; //@description Clears the list of recently found chats clearRecentlyFoundChats = Ok; -//@description Checks whether a username can be set for a chat @chat_id Chat identifier; should be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if chat is being created @username Username to be checked +//@description Returns recently opened chats, this is an offline request. Returns chats in the order of last opening @limit The maximum number of chats to be returned +getRecentlyOpenedChats limit:int32 = Chats; + +//@description Checks whether a username can be set for a chat @chat_id Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created @username Username to be checked checkChatUsername chat_id:int53 username:string = CheckChatUsernameResult; //@description Returns a list of public chats of the specified type, owned by the user @type Type of the public chats to return @@ -3672,91 +4252,114 @@ getInactiveSupergroupChats = Chats; //@description Returns a list of common group chats with a given user. Chats are sorted by their type and creation date @user_id User identifier @offset_chat_id Chat identifier starting from which to return chats; use 0 for the first request @limit The maximum number of chats to be returned; up to 100 -getGroupsInCommon user_id:int32 offset_chat_id:int53 limit:int32 = Chats; +getGroupsInCommon user_id:int53 offset_chat_id:int53 limit:int32 = Chats; //@description Returns messages in a chat. 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. This is an offline request if only_local is true +//-For optimal performance, the number of returned messages is chosen by TDLib. This is an offline request if only_local is true //@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 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 The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@only_local If true, returns only messages that are available locally without sending network requests 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 +//-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 TDLib //@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 +//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit 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 +//@description Deletes all messages in the chat. Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat +//@chat_id Chat identifier @remove_from_chat_list Pass true if the chat needs to be removed from the chat list @revoke Pass true to delete chat history for all users deleteChatHistory chat_id:int53 remove_from_chat_list:Bool revoke:Bool = Ok; +//@description Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method @chat_id Chat identifier +deleteChat chat_id:int53 = Ok; + //@description Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query -//-(searchSecretMessages should be used instead), or without an enabled message database. For optimal performance the number of returned messages is chosen by the library +//-(searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@chat_id Identifier of the chat in which to search messages //@query Query to search for -//@sender If not null, only messages sent by the specified sender will be returned. Not supported in secret chats +//@sender_id Identifier of the sender of messages to search for; pass null to search for messages from any sender. 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 +//@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. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +//@filter Additional filter for messages to search; pass null to search for all messages //@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; +searchChatMessages chat_id:int53 query:string sender_id: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 -//@chat_list Chat list in which to search messages; pass null to search in all chats regardless of their chat list +//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +//@chat_list Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported //@query Query to search for -//@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_date The date of the message starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last message //@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 -//@filter Filter for message content in the search results; searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function +//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +//@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, 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 +//@description Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib //@chat_id Identifier of the chat in which to search. Specify 0 to search in all secret chats -//@query Query to search for. If empty, searchChatMessages should be used instead +//@query Query to search for. If empty, searchChatMessages must be used instead //@offset Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results -//@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 message content in the search results +//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +//@filter Additional filter for messages to search; pass null to search for all messages searchSecretMessages chat_id:int53 query:string offset:string limit:int32 filter:SearchMessagesFilter = FoundMessages; -//@description Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library +//@description Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib //@from_message_id Identifier of the message from which to search; use 0 to get results from the last message -//@limit The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached @only_missed If true, returns only messages with missed calls +//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit @only_missed If true, returns only messages with missed/declined calls searchCallMessages from_message_id:int53 limit:int32 only_missed:Bool = Messages; +//@description Deletes all call messages @revoke Pass true to delete the messages for all users +deleteAllCallMessages revoke:Bool = Ok; + //@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 application. The list is persistent across application restarts only if the message database is used +//@description Returns all active live locations that need to 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 getChatMessageByDate chat_id:int53 date:int32 = Message; +//@description Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). +//-Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database +//@chat_id Identifier of the chat in which to return information about message positions +//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function +//@from_message_id The message identifier from which to return information about message positions +//@limit The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages +getChatSparseMessagePositions chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 limit:int32 = MessagePositions; + +//@description Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" +//@chat_id Identifier of the chat in which to return information about messages +//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function +//@from_message_id The message identifier from which to return information about messages; use 0 to get results from the last message +getChatMessageCalendar chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 = MessageCalendar; + //@description Returns approximate number of messages of the specified type in the chat @chat_id Identifier of the chat in which to count messages @filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function @return_local If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown getChatMessageCount chat_id:int53 filter:SearchMessagesFilter return_local:Bool = Count; //@description Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier 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 +//@description Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib //@chat_id Chat identifier of the message //@message_id Message identifier //@offset Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results -//@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 +//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; +//@description Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat @chat_id Identifier of the chat +getChatSponsoredMessage chat_id:int53 = SponsoredMessage; + //@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification removeNotification notification_group_id:int32 notification_id:int32 = Ok; @@ -3765,12 +4368,13 @@ removeNotification notification_group_id:int32 notification_id:int32 = Ok; removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = Ok; -//@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 +//@description Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message +//@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview //@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; +getMessageLink chat_id:int53 message_id:int53 media_timestamp:int32 for_album:Bool for_comment:Bool = MessageLink; //@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 @@ -3778,114 +4382,156 @@ getMessageLink chat_id:int53 message_id:int53 for_album:Bool for_comment:Bool = //@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?..." +//@description Returns information about a public or private message link. Can be called for any internal link of the type internalLinkTypeMessage @url The message link getMessageLinkInfo url:string = MessageLinkInfo; +//@description Returns list of message sender identifiers, which can be used to send messages in a chat @chat_id Chat identifier +getChatAvailableMessageSenders chat_id:int53 = MessageSenders; + +//@description Selects a message sender to send messages in a chat @chat_id Chat identifier @message_sender_id New message sender for the chat +setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; + //@description Sends a message. Returns the sent message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent //@reply_to_message_id Identifier of the message to reply to or 0 -//@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 +//@options Options to be used to send the message; pass null to use default options +//@reply_markup Markup for replying to the message; pass null if none; for bots only +//@input_message_content The content of the message to be sent sendMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; -//@description Sends messages grouped together into an album. Currently only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages +//@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the messages will be sent //@reply_to_message_id Identifier of a message to reply to or 0 -//@options Options to be used to send the messages -//@input_message_contents Contents of messages to be sent +//@options Options to be used to send the messages; pass null to use default options +//@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions input_message_contents:vector = Messages; //@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; +sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message; //@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent //@reply_to_message_id Identifier of a message to reply to or 0 -//@options Options to be used to send the message -//@query_id Identifier of the inline query @result_id Identifier of the inline result +//@options Options to be used to send the message; pass null to use default options +//@query_id Identifier of the inline query +//@result_id Identifier of the inline result //@hide_via_bot If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and GetOption("venue_search_bot_username") 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. Message identifiers must be in a strictly increasing order -//@options Options to be used to send the 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 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; +//@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. At most 100 messages can be forwarded simultaneously +//@options Options to be used to send the messages; pass null to use default options +//@send_copy If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local +//@remove_caption If true, media caption of message copies will be removed. Ignored if send_copy is false +//@only_preview If true, messages will not be forwarded and instead fake messages will be returned +forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages; //@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. //-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 //@chat_id Identifier of the chat to send messages @message_ids Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order resendMessages chat_id:int53 message_ids:vector = Messages; -//@description Changes the current TTL setting (sets a new self-destruct timer) in a secret chat and sends the corresponding message @chat_id Chat identifier @ttl New TTL value, in seconds -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 The sender sender of the message +//@sender_id Identifier of the 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; +addLocalMessage chat_id:int53 sender_id:MessageSender reply_to_message_id:int53 disable_notification:Bool input_message_content:InputMessageContent = Message; -//@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of the messages to be deleted @revoke Pass true to try to delete messages for all chat members. Always true for supergroups, channels and secret chats +//@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of the messages to be deleted @revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats deleteMessages chat_id:int53 message_ids:vector revoke:Bool = Ok; -//@description Deletes all messages sent by the specified user to a chat. Supported only for supergroups; requires can_delete_messages administrator privileges @chat_id Chat identifier @user_id User identifier -deleteChatMessagesFromUser chat_id:int53 user_id:int32 = Ok; +//@description Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges @chat_id Chat identifier @sender_id Identifier of the sender of messages to delete +deleteChatMessagesBySender chat_id:int53 sender_id:MessageSender = Ok; + +//@description Deletes all messages between the specified dates in a chat. Supported only for private chats and basic groups. Messages sent in the last 30 seconds will not be deleted +//@chat_id Chat identifier @min_date The minimum date of the messages to delete @max_date The maximum date of the messages to delete @revoke Pass true to delete chat messages for all users; private chats only +deleteChatMessagesByDate chat_id:int53 min_date:int32 max_date:int32 revoke:Bool = Ok; //@description Edits the text of a message (or a text of a game message). 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 text content of the message. Should be of type InputMessageText +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none; for bots only +//@input_message_content New text content of the message. Must be of type inputMessageText editMessageText chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; //@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 +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none; for bots only +//@location New location content of the message; 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 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 +//@description Edits the content of a message with an animation, an audio, a document, a photo or a video, including message caption. If only the caption needs to be edited, use editMessageCaption instead. +//-The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. 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; pass null if none; for bots only +//@input_message_content New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo editMessageMedia chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; //@description Edits the message content caption. 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 @caption New message content caption; 0-GetOption("message_caption_length_max") characters +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none; for bots only +//@caption New message content caption; 0-GetOption("message_caption_length_max") characters; pass null to remove caption editMessageCaption chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText = Message; //@description Edits the message reply markup; for bots only. 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 +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none editMessageReplyMarkup chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Message; -//@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 +//@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; pass null if none +//@input_message_content New text content of the message. Must 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 +//@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; pass null if none +//@location New location content of the message; 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 +//@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; pass null if none; for bots only +//@input_message_content New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo editInlineMessageMedia inline_message_id:string reply_markup:ReplyMarkup input_message_content:InputMessageContent = Ok; -//@description Edits the caption of an inline message sent via a bot; for bots only @inline_message_id Inline message identifier @reply_markup The new message reply markup @caption New message content caption; 0-GetOption("message_caption_length_max") characters +//@description Edits the caption of an inline message sent via a bot; for bots only +//@inline_message_id Inline message identifier +//@reply_markup The new message reply markup; pass null if none +//@caption New message content caption; pass null to remove caption; 0-GetOption("message_caption_length_max") characters editInlineMessageCaption inline_message_id:string reply_markup:ReplyMarkup caption:formattedText = Ok; -//@description Edits the reply markup of an inline message sent via a bot; for bots only @inline_message_id Inline message identifier @reply_markup The new message reply markup +//@description Edits the reply markup of an inline message sent via a bot; for bots only +//@inline_message_id Inline message identifier +//@reply_markup The new message reply markup; pass null if none editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = Ok; -//@description Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed @chat_id The chat the message belongs to @message_id Identifier of the message @scheduling_state The new message scheduling state. Pass null to send the message immediately +//@description Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@scheduling_state The new message scheduling state; pass null to send the message immediately editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; @@ -3927,15 +4573,17 @@ getJsonString json_value:JsonValue = Text; //@option_ids 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers setPollAnswer chat_id:int53 message_id:int53 option_ids:vector = Ok; -//@description Returns users voted for the specified option in a non-anonymous polls. For the optimal performance the number of returned users is chosen by the library +//@description Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib //@chat_id Identifier of the chat to which the poll belongs @message_id Identifier of the message containing the poll //@option_id 0-based identifier of the answer option //@offset Number of users to skip in the result; must be non-negative -//@limit The maximum number of users to be returned; must be positive and can't be greater than 50. Fewer users may be returned than specified by the limit, even if the end of the voter list has not been reached +//@limit The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached getPollVoters chat_id:int53 message_id:int53 option_id:int32 offset:int32 limit:int32 = Users; //@description Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set -//@chat_id Identifier of the chat to which the poll belongs @message_id Identifier of the message containing the poll @reply_markup The new message reply markup; for bots only +//@chat_id Identifier of the chat to which the poll belongs +//@message_id Identifier of the message containing the poll +//@reply_markup The new message reply markup; pass null if none; for bots only stopPoll chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Ok; @@ -3945,29 +4593,38 @@ 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; +getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int53 = LoginUrlInfo; //@description Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl. //-Use the method getLoginUrlInfo to find whether a prior user confirmation is needed. If an error is returned, then the button must be handled as an ordinary URL button //@chat_id Chat identifier of the message with the button @message_id Message identifier of the message with the button @button_id Button identifier //@allow_write_access True, if the user allowed the bot to send them messages -getLoginUrl chat_id:int53 message_id:int53 button_id:int32 allow_write_access:Bool = HttpUrl; +getLoginUrl chat_id:int53 message_id:int53 button_id:int53 allow_write_access:Bool = HttpUrl; -//@description Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires @bot_user_id The identifier of the target bot -//@chat_id Identifier of the chat where the query was sent @user_location Location of the user, only if needed @query Text of the query @offset Offset of the first entry to return -getInlineQueryResults bot_user_id:int32 chat_id:int53 user_location:location query:string offset:string = InlineQueryResults; +//@description Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires +//@bot_user_id The identifier of the target bot +//@chat_id Identifier of the chat where the query was sent +//@user_location Location of the user; pass null if unknown or the bot doesn't need user's location +//@query Text of the query +//@offset Offset of the first entry to return +getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location query:string offset:string = InlineQueryResults; -//@description Sets the result of an inline query; for bots only @inline_query_id Identifier of the inline query @is_personal True, if the result of the query can be cached for the specified user -//@results The results of the query @cache_time Allowed time to cache the results of the query, in seconds @next_offset Offset for the next inline query; pass an empty string if there are no more results -//@switch_pm_text If non-empty, this text should be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter @switch_pm_parameter The parameter for the bot start message +//@description Sets the result of an inline query; for bots only +//@inline_query_id Identifier of the inline query +//@is_personal True, if the result of the query can be cached for the specified user +//@results The results of the query +//@cache_time Allowed time to cache the results of the query, in seconds +//@next_offset Offset for the next inline query; pass an empty string if there are no more results +//@switch_pm_text If non-empty, this text must be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter +//@switch_pm_parameter The parameter for the bot start message answerInlineQuery inline_query_id:int64 is_personal:Bool results:vector cache_time:int32 next_offset:string switch_pm_text:string switch_pm_parameter:string = Ok; //@description Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires @chat_id Identifier of the chat with the message @message_id Identifier of the message from which the query originated @payload Query payload getCallbackQueryAnswer chat_id:int53 message_id:int53 payload:CallbackQueryPayload = CallbackQueryAnswer; -//@description Sets the result of a callback query; for bots only @callback_query_id Identifier of the callback query @text Text of the answer @show_alert If true, an alert should be shown to the user instead of a toast notification @url URL to be opened @cache_time Time during which the result of the query can be cached, in seconds +//@description Sets the result of a callback query; for bots only @callback_query_id Identifier of the callback query @text Text of the answer @show_alert If true, an alert must be shown to the user instead of a toast notification @url URL to be opened @cache_time Time during which the result of the query can be cached, in seconds answerCallbackQuery callback_query_id:int64 text:string show_alert:Bool url:string cache_time:int32 = Ok; @@ -3978,27 +4635,28 @@ answerShippingQuery shipping_query_id:int64 shipping_options:vector force_read:Bool = Ok; //@description Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated if something has changed @chat_id Chat identifier of the message @message_id Identifier of the message with the opened content openMessageContent chat_id:int53 message_id:int53 = Ok; +//@description Informs TDLib that a message with an animated emoji was clicked by the user. Returns a big animated sticker to be played or a 404 error if usual animation needs to be played @chat_id Chat identifier of the message @message_id Identifier of the clicked message +clickAnimatedEmojiMessage chat_id:int53 message_id:int53 = Sticker; + +//@description Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization @link The link +getInternalLinkType link:string = InternalLinkType; + +//@description Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if web page preview is disabled in secret chats @link The link +getExternalLinkInfo link:string = LoginUrlInfo; + +//@description Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed +//@link The HTTP link @allow_write_access True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages +getExternalLink link:string allow_write_access:Bool = HttpUrl; + //@description Marks all mentions in a chat as read @chat_id Chat identifier readAllChatMentions chat_id:int53 = Ok; //@description Returns an existing chat corresponding to a given user @user_id User identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect -createPrivateChat user_id:int32 force:Bool = Chat; +createPrivateChat user_id:int53 force:Bool = Chat; //@description Returns an existing chat corresponding to a known basic group @basic_group_id Basic group identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect -createBasicGroupChat basic_group_id:int32 force:Bool = Chat; +createBasicGroupChat basic_group_id:int53 force:Bool = Chat; //@description Returns an existing chat corresponding to a known supergroup or channel @supergroup_id Supergroup or channel identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect -createSupergroupChat supergroup_id:int32 force:Bool = Chat; +createSupergroupChat supergroup_id:int53 force:Bool = Chat; //@description Returns an existing chat corresponding to a known secret chat @secret_chat_id Secret chat identifier createSecretChat secret_chat_id:int32 = Chat; //@description Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat @user_ids Identifiers of users to be added to the basic group @title Title of the new basic group; 1-128 characters -createNewBasicGroupChat user_ids:vector title:string = Chat; +createNewBasicGroupChat user_ids:vector title:string = Chat; -//@description Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat @title Title of the new chat; 1-128 characters @is_channel True, if a channel chat should be created @param_description Chat description; 0-255 characters @location Chat location if a location-based supergroup is being created -createNewSupergroupChat title:string is_channel:Bool description:string location:chatLocation = Chat; +//@description Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat +//@title Title of the new chat; 1-128 characters +//@is_channel True, if a channel chat needs to be created +//@param_description Chat description; 0-255 characters +//@location Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat +//@for_import True, if the supergroup is created for importing messages using importMessage +createNewSupergroupChat title:string is_channel:Bool description:string location:chatLocation for_import:Bool = Chat; //@description Creates a new secret chat. Returns the newly created chat @user_id Identifier of the target user -createNewSecretChat user_id:int32 = Chat; +createNewSecretChat user_id:int53 = Chat; //@description Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group @chat_id Identifier of the chat to upgrade upgradeBasicGroupChatToSupergroupChat chat_id:int53 = Chat; @@ -4077,25 +4753,37 @@ getRecommendedChatFilters = RecommendedChatFilters; getChatFilterDefaultIconName filter:chatFilter = Text; -//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights +//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right //@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 -//@chat_id Chat identifier @photo New chat photo. Pass null to delete the chat photo +//@description Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right +//@chat_id Chat identifier @photo New chat photo; pass null to delete the chat photo setChatPhoto chat_id:int53 photo:InputChatPhoto = Ok; +//@description Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels +//-Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram) +//@chat_id Chat identifier @ttl New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret +setChatMessageTtl chat_id:int53 ttl:int32 = Ok; + //@description Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right //@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 @message_thread_id If not 0, a message thread identifier in which the draft was changed @draft_message New draft message; may be null +//@description Changes the chat theme. Supported only in private and secret chats @chat_id Chat identifier @theme_name Name of the new chat theme; pass an empty string to return the default theme +setChatTheme chat_id:int53 theme_name:string = 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; pass null to remove the draft 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 ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges +//@chat_id Chat identifier @has_protected_content True, if chat content can't be saved locally, forwarded, or copied +toggleChatHasProtectedContent chat_id:int53 has_protected_content:Bool = Ok; + //@description Changes the marked as unread state of a chat @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread toggleChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Ok; @@ -4105,23 +4793,23 @@ toggleChatDefaultDisableNotification chat_id:int53 default_disable_notification: //@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 +//@description Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @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. +//@description Changes the discussion group of a channel chat; requires can_change_info administrator right 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 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 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 +//@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, in seconds; 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 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 +//@disable_notification True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats //@only_for_self True, if the message needs to be pinned for one side only; private chats only pinChatMessage chat_id:int53 message_id:int53 disable_notification:Bool only_for_self:Bool = Ok; @@ -4132,35 +4820,46 @@ unpinChatMessage chat_id:int53 message_id:int53 = Ok; 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 +//@description Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method @chat_id Chat identifier joinChat chat_id:int53 = Ok; -//@description Removes current user from chat members. Private and secret chats can't be left using this method @chat_id Chat identifier +//@description Removes the current user from chat members. Private and secret chats can't be left using this method @chat_id Chat identifier leaveChat chat_id:int53 = Ok; -//@description Adds a new member to a chat. Members can't be added to private or secret chats. Members will not be added until the chat state has been synchronized with the server -//@chat_id Chat identifier @user_id Identifier of the user @forward_limit The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels -addChatMember chat_id:int53 user_id:int32 forward_limit:int32 = Ok; +//@description Adds a new member to a chat. Members can't be added to private or secret chats +//@chat_id Chat identifier @user_id Identifier of the user @forward_limit The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot +addChatMember chat_id:int53 user_id:int53 forward_limit:int32 = Ok; -//@description Adds multiple new members to a chat. Currently this option is only available for supergroups and channels. This option can't be used to join a chat. Members can't be added to a channel if it has more than 200 members. Members will not be added until the chat state has been synchronized with the server -//@chat_id Chat identifier @user_ids Identifiers of the users to be added to the chat -addChatMembers chat_id:int53 user_ids:vector = Ok; +//@description Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members +//@chat_id Chat identifier @user_ids Identifiers of the users to be added to the chat. The maximum number of added users is 20 for supergroups and 100 for channels +addChatMembers chat_id:int53 user_ids:vector = Ok; -//@description Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for adding new members to the chat and transferring chat ownership; instead, use addChatMember or transferChatOwnership. The chat member status will not be changed until it has been synchronized with the server -//@chat_id Chat identifier @user_id User identifier @status The new status of the member in the chat -setChatMemberStatus chat_id:int53 user_id:int32 status:ChatMemberStatus = Ok; +//@description Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed +//@chat_id Chat identifier @member_id Member identifier. Chats can be only banned and unbanned in supergroups and channels @status The new status of the member in the chat +setChatMemberStatus chat_id:int53 member_id:MessageSender status:ChatMemberStatus = Ok; + +//@description Bans a member in a chat. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first +//@chat_id Chat identifier +//@member_id Member identifier +//@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned +//@revoke_messages Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels +banChatMember chat_id:int53 member_id:MessageSender banned_until_date:int32 revoke_messages:Bool = Ok; //@description Checks whether the current session can be used to transfer a chat ownership to another user canTransferOwnership = CanTransferOwnershipResult; //@description Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats //@chat_id Chat identifier @user_id Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user @password The password of the current user -transferChatOwnership chat_id:int53 user_id:int32 password:string = Ok; +transferChatOwnership chat_id:int53 user_id:int53 password:string = Ok; -//@description Returns information about a single member of a chat @chat_id Chat identifier @user_id User identifier -getChatMember chat_id:int53 user_id:int32 = ChatMember; +//@description Returns information about a single member of a chat @chat_id Chat identifier @member_id Member identifier +getChatMember chat_id:int53 member_id:MessageSender = ChatMember; -//@description Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels @chat_id Chat identifier @query Query to search for @limit The maximum number of users to be returned @filter The type of users to return. By default, chatMembersFilterMembers +//@description Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels +//@chat_id Chat identifier +//@query Query to search for +//@limit The maximum number of users to be returned; up to 200 +//@filter The type of users to search for; pass null to search among all chat members searchChatMembers chat_id:int53 query:string limit:int32 filter:ChatMembersFilter = ChatMembers; //@description Returns a list of administrators of the chat with their custom titles @chat_id Chat identifier @@ -4171,7 +4870,9 @@ getChatAdministrators chat_id:int53 = ChatAdministrators; clearAllDraftMessages exclude_secret_chats:Bool = Ok; -//@description Returns list of chats with non-default notification settings @scope If specified, only chats from the specified scope will be returned @compare_sound If true, also chats with non-default sound will be returned +//@description Returns list of chats with non-default notification settings +//@scope If specified, only chats from the scope will be returned; pass null to return chats from all scopes +//@compare_sound If true, also chats with non-default sound will be returned getChatNotificationSettingsExceptions scope:NotificationSettingsScope compare_sound:Bool = Chats; //@description Returns the notification settings for chats of a given type @scope Types of chats for which to return the notification settings information @@ -4195,19 +4896,24 @@ setPinnedChats chat_list:ChatList chat_ids:vector = Ok; //@description Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates //@file_id Identifier of the file to download //@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first -//@offset The starting position from which the file should be downloaded -//@limit Number of bytes which should be downloaded starting from the "offset" position before the download will be automatically cancelled; use 0 to download without a limit +//@offset The starting position from which the file needs to be downloaded +//@limit Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit //@synchronous If false, this request returns file state just after the download has been started. If true, this request returns file state only after -//-the download has succeeded, has failed, has been cancelled or a new downloadFile request with different offset/limit parameters was sent +//-the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent downloadFile file_id:int32 priority:int32 offset:int32 limit:int32 synchronous:Bool = File; -//@description Returns file downloaded prefix size from a given offset @file_id Identifier of the file @offset Offset from which downloaded prefix size should be calculated +//@description Returns file downloaded prefix size from a given offset, in bytes @file_id Identifier of the file @offset Offset from which downloaded prefix size needs to be calculated getFileDownloadedPrefixSize file_id:int32 offset:int32 = Count; //@description Stops the downloading of a file. If a file has already been downloaded, does nothing @file_id Identifier of a file to stop downloading @only_if_pending Pass true to stop downloading only if it hasn't been started, i.e. request hasn't been sent to server cancelDownloadFile file_id:int32 only_if_pending:Bool = Ok; -//@description Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message @file File to upload @file_type File type +//@description Returns suggested name for saving a file in a given directory @file_id Identifier of the file @directory Directory in which the file is supposed to be saved +getSuggestedFileName file_id:int32 directory:string = Text; + +//@description Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message +//@file File to upload +//@file_type File type; pass null if unknown //@priority Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded first uploadFile file:InputFile file_type:FileType priority:int32 = File; @@ -4226,7 +4932,7 @@ setFileGenerationProgress generation_id:int64 expected_size:int32 local_prefix_s //@description Finishes the file generation //@generation_id The identifier of the generation process -//@error If set, means that file generation has failed and should be terminated +//@error If passed, the file generation has failed and must be terminated; pass null if the file generation succeeded 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 application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file @@ -4239,21 +4945,103 @@ readFilePart file_id:int32 offset:int32 count:int32 = FilePart; deleteFile file_id:int32 = Ok; -//@description Generates a new invite link for a chat; the previously generated link is revoked. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right @chat_id Chat identifier -generateChatInviteLink chat_id:int53 = ChatInviteLink; +//@description Returns information about a file with messages exported from another app @message_file_head Beginning of the message file; up to 100 first lines +getMessageFileType message_file_head:string = MessageFileType; -//@description Checks the validity of an invite link for a chat and returns information about the corresponding chat @invite_link Invite link to be checked; should begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/" +//@description Returns a confirmation text to be shown to the user before starting message import +//@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right +getMessageImportConfirmationText chat_id:int53 = Text; + +//@description Imports messages exported from another app +//@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right +//@message_file File with messages to import. Only inputFileLocal and inputFileGenerated are supported. The file must not be previously uploaded +//@attached_files Files used in the imported messages. Only inputFileLocal and inputFileGenerated are supported. The files must not be previously uploaded +importMessages chat_id:int53 message_file:InputFile attached_files:vector = Ok; + + +//@description Replaces current primary invite link for a chat with a new primary invite link. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right @chat_id Chat identifier +replacePrimaryChatInviteLink chat_id:int53 = ChatInviteLink; + +//@description Creates a new invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat +//@chat_id Chat identifier +//@name Invite link name; 0-32 characters +//@expiration_date Point in time (Unix timestamp) when the link will expire; pass 0 if never +//@member_limit The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited +//@creates_join_request True, if the link only creates join request. If true, member_limit must not be specified +createChatInviteLink chat_id:int53 name:string expiration_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink; + +//@description Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +//@chat_id Chat identifier +//@invite_link Invite link to be edited +//@name Invite link name; 0-32 characters +//@expiration_date Point in time (Unix timestamp) when the link will expire; pass 0 if never +//@member_limit The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited +//@creates_join_request True, if the link only creates join request. If true, member_limit must not be specified +editChatInviteLink chat_id:int53 invite_link:string name:string expiration_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink; + +//@description Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links +//@chat_id Chat identifier +//@invite_link Invite link to get +getChatInviteLink chat_id:int53 invite_link:string = ChatInviteLink; + +//@description Returns list of chat administrators with number of their invite links. Requires owner privileges in the chat @chat_id Chat identifier +getChatInviteLinkCounts chat_id:int53 = ChatInviteLinkCounts; + +//@description Returns invite links for a chat created by specified administrator. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links +//@chat_id Chat identifier +//@creator_user_id User identifier of a chat administrator. Must be an identifier of the current user for non-owner +//@is_revoked Pass true if revoked links needs to be returned instead of active or expired +//@offset_date Creation date of an invite link starting after which to return invite links; use 0 to get results from the beginning +//@offset_invite_link Invite link starting after which to return invite links; use empty string to get results from the beginning +//@limit The maximum number of invite links to return; up to 100 +getChatInviteLinks chat_id:int53 creator_user_id:int53 is_revoked:Bool offset_date:int32 offset_invite_link:string limit:int32 = ChatInviteLinks; + +//@description Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links @chat_id Chat identifier @invite_link Invite link for which to return chat members +//@offset_member A chat member from which to return next chat members; pass null to get results from the beginning @limit The maximum number of chat members to return; up to 100 +getChatInviteLinkMembers chat_id:int53 invite_link:string offset_member:chatInviteLinkMember limit:int32 = ChatInviteLinkMembers; + +//@description Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links. +//-If a primary link is revoked, then additionally to the revoked link returns new primary link +//@chat_id Chat identifier +//@invite_link Invite link to be revoked +revokeChatInviteLink chat_id:int53 invite_link:string = ChatInviteLinks; + +//@description Deletes revoked chat invite links. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links @chat_id Chat identifier @invite_link Invite link to revoke +deleteRevokedChatInviteLink chat_id:int53 invite_link:string = Ok; + +//@description Deletes all revoked chat invite links created by a given chat administrator. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +//@chat_id Chat identifier +//@creator_user_id User identifier of a chat administrator, which links will be deleted. Must be an identifier of the current user for non-owner +deleteAllRevokedChatInviteLinks chat_id:int53 creator_user_id:int53 = Ok; + +//@description Checks the validity of an invite link for a chat and returns information about the corresponding chat @invite_link Invite link to be checked checkChatInviteLink invite_link:string = ChatInviteLinkInfo; -//@description Uses an invite link to add the current user to the chat if possible. The new member will not be added until the chat state has been synchronized with the server -//@invite_link Invite link to import; should begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/" +//@description Uses an invite link to add the current user to the chat if possible @invite_link Invite link to use joinChatByInviteLink invite_link:string = Chat; +//@description Returns pending join requests in a chat +//@chat_id Chat identifier +//@invite_link Invite link for which to return join requests. If empty, all join requests will be returned. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +//@query A query to search for in the first names, last names and usernames of the users to return +//@offset_request A chat join request from which to return next requests; pass null to get results from the beginning +//@limit The maximum number of requests to join the chat to return +getChatJoinRequests chat_id:int53 invite_link:string query:string offset_request:chatJoinRequest limit:int32 = ChatJoinRequests; -//@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 Handles a pending join request in a chat @chat_id Chat identifier @user_id Identifier of the user that sent the request @approve True, if the request is approved. Otherwise the request is declived +processChatJoinRequest chat_id:int53 user_id:int53 approve:Bool = Ok; -//@description Accepts an incoming call @call_id Call identifier @protocol Description of the call protocols supported by the application +//@description Handles all pending join requests for a given link in a chat +//@chat_id Chat identifier +//@invite_link Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +//@approve True, if the requests are approved. Otherwise the requests are declived +processChatJoinRequests chat_id:int53 invite_link:string approve:Bool = Ok; + + +//@description Creates a new call @user_id Identifier of the user to be called @protocol The call protocols supported by the application @is_video True, if a video call needs to be created +createCall user_id:int53 protocol:callProtocol is_video:Bool = CallId; + +//@description Accepts an incoming call @call_id Call identifier @protocol The call protocols supported by the application acceptCall call_id:int32 protocol:callProtocol = Ok; //@description Sends call signaling data @call_id Call identifier @data The data @@ -4269,8 +5057,121 @@ sendCallRating call_id:int32 rating:int32 comment:string problems:vector = Ok; + +//@description Returns invite link to a video chat in a public chat +//@group_call_id Group call identifier +//@can_self_unmute Pass true if the invite link needs to contain an invite hash, passing which to joinGroupCall would allow the invited user to unmute themselves. Requires groupCall.can_be_managed group call flag +getGroupCallInviteLink group_call_id:int32 can_self_unmute:Bool = HttpUrl; + +//@description Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag @group_call_id Group call identifier +revokeGroupCallInviteLink group_call_id:int32 = Ok; + +//@description Starts recording of an active group call. Requires groupCall.can_be_managed group call flag @group_call_id Group call identifier @title Group call recording title; 0-64 characters +//@record_video Pass true to record a video file instead of an audio file @use_portrait_orientation Pass true to use portrait orientation for video instead of landscape one +startGroupCallRecording group_call_id:int32 title:string record_video:Bool use_portrait_orientation:Bool = Ok; + +//@description Ends recording of an active group call. Requires groupCall.can_be_managed group call flag @group_call_id Group call identifier +endGroupCallRecording group_call_id:int32 = Ok; + +//@description Toggles whether current user's video is paused @group_call_id Group call identifier @is_my_video_paused Pass true if the current user's video is paused +toggleGroupCallIsMyVideoPaused group_call_id:int32 is_my_video_paused:Bool = Ok; + +//@description Toggles whether current user's video is enabled @group_call_id Group call identifier @is_my_video_enabled Pass true if the current user's video is enabled +toggleGroupCallIsMyVideoEnabled group_call_id:int32 is_my_video_enabled:Bool = Ok; + +//@description Informs TDLib that speaking state of a participant of an active group has changed @group_call_id Group call identifier +//@audio_source Group call participant's synchronization audio source identifier, or 0 for the current user @is_speaking True, if the user is speaking +setGroupCallParticipantIsSpeaking group_call_id:int32 audio_source:int32 is_speaking:Bool = Ok; + +//@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves +//@group_call_id Group call identifier @participant_id Participant identifier @is_muted Pass true if the user must be muted and false otherwise +toggleGroupCallParticipantIsMuted group_call_id:int32 participant_id:MessageSender is_muted:Bool = Ok; + +//@description Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level +//@group_call_id Group call identifier @participant_id Participant identifier @volume_level New participant's volume level; 1-20000 in hundreds of percents +setGroupCallParticipantVolumeLevel group_call_id:int32 participant_id:MessageSender volume_level:int32 = Ok; + +//@description Toggles whether a group call participant hand is rased +//@group_call_id Group call identifier @participant_id Participant identifier +//@is_hand_raised Pass true if the user's hand needs to be raised. Only self hand can be raised. Requires groupCall.can_be_managed group call flag to lower other's hand +toggleGroupCallParticipantIsHandRaised group_call_id:int32 participant_id:MessageSender is_hand_raised:Bool = Ok; + +//@description Loads more participants of a group call. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded +//@group_call_id Group call identifier. The group call must be previously received through getGroupCall and must be joined or being joined +//@limit The maximum number of participants to load; up to 100 +loadGroupCallParticipants group_call_id:int32 limit:int32 = Ok; + +//@description Leaves a group call @group_call_id Group call identifier +leaveGroupCall group_call_id:int32 = Ok; + +//@description Ends a group call. Requires groupCall.can_be_managed @group_call_id Group call identifier +endGroupCall group_call_id:int32 = Ok; + +//@description Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video +//@group_call_id Group call identifier +//@time_offset Point in time when the stream segment begins; Unix timestamp in milliseconds +//@scale Segment duration scale; 0-1. Segment's duration is 1000/(2**scale) milliseconds +//@channel_id Identifier of an audio/video channel to get as received from tgcalls +//@video_quality Video quality as received from tgcalls; pass null to get the worst available quality +getGroupCallStreamSegment group_call_id:int32 time_offset:int53 scale:int32 channel_id:int32 video_quality:GroupCallVideoQuality = FilePart; + + +//@description Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked @sender_id Identifier of a message sender to block/unblock @is_blocked New value of is_blocked +toggleMessageSenderIsBlocked sender_id:MessageSender is_blocked:Bool = Ok; //@description Blocks an original sender of a message in the Replies chat //@message_id The identifier of an incoming message in the Replies chat @@ -4284,7 +5185,7 @@ getBlockedMessageSenders offset:int32 limit:int32 = MessageSenders; //@description Adds a user to the contact list or edits an existing contact by their user identifier @contact The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored -//@share_phone_number True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field UserFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number +//@share_phone_number True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number addContact contact:contact share_phone_number:Bool = Ok; //@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @contacts The list of contacts to import or edit; contacts' vCard are ignored and are not imported @@ -4297,12 +5198,12 @@ getContacts = Users; searchContacts query:string limit:int32 = Users; //@description Removes users from the contact list @user_ids Identifiers of users to be deleted -removeContacts user_ids:vector = Ok; +removeContacts user_ids:vector = Ok; //@description Returns the total number of imported contacts getImportedContactCount = Count; -//@description Changes imported contacts using the list of current user contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. +//@description Changes imported contacts using the list of contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. //-Query result depends on the result of the previous query, so only one query is possible at the same time @contacts The new list of contacts, contact's vCard are ignored and are not imported changeImportedContacts contacts:vector = ImportedContacts; @@ -4311,14 +5212,14 @@ clearImportedContacts = Ok; //@description Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber @user_id Identifier of the user with whom to share the phone number. The user must be a mutual contact -sharePhoneNumber user_id:int32 = Ok; +sharePhoneNumber user_id:int53 = Ok; //@description Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already @user_id User identifier @offset The number of photos to skip; must be non-negative @limit The maximum number of photos to be returned; up to 100 -getUserProfilePhotos user_id:int32 offset:int32 limit:int32 = ChatPhotos; +getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos; -//@description Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is not empty, favorite and recently used stickers may also be returned @emoji String representation of emoji. If empty, returns all known installed stickers @limit The maximum number of stickers to be returned +//@description Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, favorite and recently used stickers may also be returned @emoji String representation of emoji. If empty, returns all known installed stickers @limit The maximum number of stickers to be returned getStickers emoji:string limit:int32 = Stickers; //@description Searches for stickers from public sticker sets that correspond to a given emoji @emoji String representation of emoji; must be non-empty @limit The maximum number of stickers to be returned @@ -4327,15 +5228,15 @@ searchStickers emoji:string limit:int32 = Stickers; //@description Returns a list of installed sticker sets @is_masks Pass true to return mask sticker sets; pass false to return ordinary sticker sets getInstalledStickerSets is_masks:Bool = StickerSets; -//@description Returns a list of archived sticker sets @is_masks Pass true to return mask stickers sets; pass false to return ordinary sticker sets @offset_sticker_set_id Identifier of the sticker set from which to return the result @limit The maximum number of sticker sets to return +//@description Returns a list of archived sticker sets @is_masks Pass true to return mask stickers sets; pass false to return ordinary sticker sets @offset_sticker_set_id Identifier of the sticker set from which to return the result @limit The maximum number of sticker sets to return; up to 100 getArchivedStickerSets is_masks:Bool offset_sticker_set_id:int64 limit:int32 = StickerSets; -//@description Returns a list of trending sticker sets. For the optimal performance the number of returned sticker sets is chosen by the library +//@description Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib //@offset The offset from which to return the sticker sets; must be non-negative -//@limit 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 The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached getTrendingStickerSets offset:int32 limit:int32 = StickerSets; -//@description Returns a list of sticker sets attached to a file. Currently only photos and videos can have attached sticker sets @file_id File identifier +//@description Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets @file_id File identifier getAttachedStickerSets file_id:int32 = StickerSets; //@description Returns information about a sticker set by its identifier @set_id Identifier of the sticker set @@ -4388,6 +5289,9 @@ getStickerEmojis sticker:InputFile = Emojis; //@description Searches for emojis by keywords. Supported only if the file database is enabled @text Text to search for @exact_match True, if only emojis, which exactly match text needs to be returned @input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown searchEmojis text:string exact_match:Bool input_language_codes:vector = Emojis; +//@description Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji @emoji The emoji +getAnimatedEmoji emoji:string = AnimatedEmoji; + //@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; @@ -4396,7 +5300,7 @@ getEmojiSuggestionsUrl language_code:string = HttpUrl; getSavedAnimations = Animations; //@description Manually adds a new animation to the list of saved animations. The new animation is added to the beginning of the list. If the animation was already in the list, it is removed first. Only non-secret video animations with MIME type "video/mp4" can be added to the list -//@animation The animation file to be added. Only animations known to the server (i.e. successfully sent via a message) can be added to the list +//@animation The animation file to be added. Only animations known to the server (i.e., successfully sent via a message) can be added to the list addSavedAnimation animation:InputFile = Ok; //@description Removes an animation from the list of saved animations @animation Animation file to be removed @@ -4427,7 +5331,7 @@ setProfilePhoto photo:InputChatPhoto = Ok; //@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 @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 current user; 1-64 characters @last_name The new value of the optional last name for the current 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 @@ -4440,17 +5344,31 @@ setUsername username:string = Ok; 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 +//@phone_number The new phone number of the user in international format @settings Settings for the authentication of the user's phone number; pass null to use default settings changePhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; -//@description Re-sends the authentication code sent to confirm a new phone number for the user. Works only if the previously received authenticationCodeInfo next_code_type was not null +//@description Re-sends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed 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 +//@description Checks the authentication code sent to confirm a new phone number of the user @code Authentication code to check 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 Sets the list of commands supported by the bot for the given user scope and language; for bots only +//@scope The scope to which the commands are relevant; pass null to change commands in the default bot command scope +//@language_code A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands +//@commands List of the bot's commands +setCommands scope:BotCommandScope language_code:string commands:vector = Ok; + +//@description Deletes commands supported by the bot for the given user scope and language; for bots only +//@scope The scope to which the commands are relevant; pass null to delete commands in the default bot command scope +//@language_code A two-letter ISO 639-1 country code or an empty string +deleteCommands scope:BotCommandScope language_code:string = Ok; + +//@description Returns the list of commands supported by the bot for the given user scope and language; for bots only +//@scope The scope to which the commands are relevant; pass null to get commands in the default bot command scope +//@language_code A two-letter ISO 639-1 country code or an empty string +getCommands scope:BotCommandScope language_code:string = BotCommands; //@description Returns all active sessions of the current user @@ -4462,6 +5380,15 @@ terminateSession session_id:int64 = Ok; //@description Terminates all other sessions of the current user terminateAllOtherSessions = Ok; +//@description Toggles whether a session can accept incoming calls @session_id Session identifier @can_accept_calls True, if incoming calls can be accepted by the session +toggleSessionCanAcceptCalls session_id:int64 can_accept_calls:Bool = Ok; + +//@description Toggles whether a session can accept incoming secret chats @session_id Session identifier @can_accept_secret_chats True, if incoming secret chats can be accepted by the session +toggleSessionCanAcceptSecretChats session_id:int64 can_accept_secret_chats:Bool = Ok; + +//@description Changes the period of inactivity after which sessions will automatically be terminated @inactive_session_ttl_days New number of days of inactivity before sessions will be automatically terminated; 1-366 days +setInactiveSessionTtl inactive_session_ttl_days:int32 = Ok; + //@description Returns all website where the current user used Telegram to log in getConnectedWebsites = ConnectedWebsites; @@ -4474,26 +5401,26 @@ disconnectAllWebsites = Ok; //@description Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel @username New value of the username. Use an empty string to remove the username -setSupergroupUsername supergroup_id:int32 username:string = Ok; +setSupergroupUsername supergroup_id:int53 username:string = Ok; -//@description Changes the sticker set of a supergroup; requires can_change_info rights @supergroup_id Identifier of the supergroup @sticker_set_id New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set -setSupergroupStickerSet supergroup_id:int32 sticker_set_id:int64 = Ok; +//@description Changes the sticker set of a supergroup; requires can_change_info administrator right @supergroup_id Identifier of the supergroup @sticker_set_id New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set +setSupergroupStickerSet supergroup_id:int53 sticker_set_id:int64 = Ok; -//@description Toggles sender signatures messages sent in a channel; requires can_change_info rights @supergroup_id Identifier of the channel @sign_messages New value of sign_messages -toggleSupergroupSignMessages supergroup_id:int32 sign_messages:Bool = Ok; +//@description Toggles whether sender signature is added to sent messages in a channel; requires can_change_info administrator right @supergroup_id Identifier of the channel @sign_messages New value of sign_messages +toggleSupergroupSignMessages supergroup_id:int53 sign_messages:Bool = Ok; -//@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info rights @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available -toggleSupergroupIsAllHistoryAvailable supergroup_id:int32 is_all_history_available:Bool = Ok; +//@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available +toggleSupergroupIsAllHistoryAvailable supergroup_id:int53 is_all_history_available:Bool = Ok; -//@description Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup @supergroup_id Supergroup identifier @user_id User identifier @message_ids Identifiers of messages sent in the supergroup by the user. This list must be non-empty -reportSupergroupSpam supergroup_id:int32 user_id:int32 message_ids:vector = Ok; +//@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup +toggleSupergroupIsBroadcastGroup supergroup_id:int53 = Ok; -//@description 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, 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 Reports messages in a supergroup as spam; requires administrator rights in the supergroup @supergroup_id Supergroup identifier @message_ids Identifiers of messages to report +reportSupergroupSpam supergroup_id:int53 message_ids:vector = Ok; -//@description 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 -deleteSupergroup supergroup_id:int32 = 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; pass null to use supergroupMembersFilterRecent @offset Number of users to skip @limit The maximum number of users be returned; up to 200 +getSupergroupMembers supergroup_id:int53 filter:SupergroupMembersFilter offset:int32 limit:int32 = ChatMembers; //@description Closes a secret chat, effectively transferring its state to secretChatStateClosed @secret_chat_id Secret chat identifier @@ -4502,19 +5429,27 @@ closeSecretChat secret_chat_id:int32 = Ok; //@description Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id) //@chat_id Chat identifier @query Search query by which to filter events @from_event_id Identifier of an event from which to return results. Use 0 to get results from the latest events @limit The maximum number of events to return; up to 100 -//@filters The types of events to return. By default, all types will be returned @user_ids User identifiers by which to filter events. By default, events relating to all users will be returned -getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector = ChatEvents; +//@filters The types of events to return; pass null to get chat events of all types @user_ids User identifiers by which to filter events. By default, events relating to all users will be returned +getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector = ChatEvents; -//@description Returns an invoice payment form. This method should be called when the user presses inlineKeyboardButtonBuy @chat_id Chat identifier of the Invoice message @message_id Message identifier -getPaymentForm chat_id:int53 message_id:int53 = PaymentForm; +//@description Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy +//@chat_id Chat identifier of the Invoice message +//@message_id Message identifier +//@theme Preferred payment form theme; pass null to use the default theme +getPaymentForm chat_id:int53 message_id:int53 theme:paymentFormTheme = PaymentForm; -//@description Validates the order information provided by a user and returns the available shipping options for a flexible invoice @chat_id Chat identifier of the Invoice message @message_id Message identifier @order_info The order information, provided by the user @allow_save True, if the order information can be saved +//@description Validates the order information provided by a user and returns the available shipping options for a flexible invoice +//@chat_id Chat identifier of the Invoice message +//@message_id Message identifier +//@order_info The order information, provided by the user; pass null if empty +//@allow_save True, if the order information can be saved validateOrderInfo chat_id:int53 message_id:int53 order_info:orderInfo allow_save:Bool = ValidatedOrderInfo; -//@description Sends a filled-out payment form to the bot for final verification @chat_id Chat identifier of the Invoice message @message_id Message identifier @order_info_id Identifier returned by ValidateOrderInfo, or an empty string @shipping_option_id Identifier of a chosen shipping option, if applicable -//@credentials The credentials chosen by user for payment -sendPaymentForm chat_id:int53 message_id:int53 order_info_id:string shipping_option_id:string credentials:InputCredentials = PaymentResult; +//@description Sends a filled-out payment form to the bot for final verification @chat_id Chat identifier of the Invoice message @message_id Message identifier +//@payment_form_id Payment form identifier returned by getPaymentForm @order_info_id Identifier returned by validateOrderInfo, or an empty string @shipping_option_id Identifier of a chosen shipping option, if applicable +//@credentials The credentials chosen by user for payment @tip_amount Chosen by the user amount of tip in the smallest units of the currency +sendPaymentForm chat_id:int53 message_id:int53 payment_form_id:int64 order_info_id:string shipping_option_id:string credentials:InputCredentials tip_amount:int53 = PaymentResult; //@description Returns information about a successful payment @chat_id Chat identifier of the PaymentSuccessful message @message_id Message identifier getPaymentReceipt chat_id:int53 message_id:int53 = PaymentReceipt; @@ -4543,8 +5478,8 @@ getBackgroundUrl name:string type:BackgroundType = HttpUrl; searchBackground name:string = Background; //@description Changes the background selected by the user; adds background to the list of installed backgrounds -//@background The input background to use, null for filled backgrounds -//@type Background type; null for default background. The method will return error 404 if type is null +//@background The input background to use; pass null to create a new filled backgrounds or to remove the current background +//@type Background type; pass null to use the default type of the remote background or to remove the current background //@for_dark_theme True, if the background is chosen for dark theme setBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; @@ -4564,7 +5499,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 shouldn't 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 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 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 @@ -4584,7 +5519,7 @@ 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 application -registerDevice device_token:DeviceToken other_user_ids:vector = PushReceiverId; +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 @@ -4610,7 +5545,7 @@ getUserPrivacySettingRules setting:UserPrivacySetting = UserPrivacySettingRules; getOption name:string = OptionValue; //@description Sets the value of an option. (Check the list of available options on https://core.telegram.org/tdlib/options.) Only writable options can be set. Can be called before authorization -//@name The name of the option @value The new value of the option +//@name The name of the option @value The new value of the option; pass null to reset option value to a default value setOption name:string value:OptionValue = Ok; @@ -4627,24 +5562,25 @@ deleteAccount reason:string = Ok; //@description Removes a chat action bar without any other action @chat_id Chat identifier removeChatActionBar chat_id:int53 = Ok; -//@description Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if this is a private 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 Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported +//@chat_id Chat identifier @message_ids Identifiers of reported messages, if any @reason The reason for reporting the chat @text Additional report details; 0-1024 characters +reportChat chat_id:int53 message_ids:vector reason:ChatReportReason text:string = Ok; +//@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported +//@chat_id Chat identifier @file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported @reason The reason for reporting the chat photo @text Additional report details; 0-1024 characters +reportChatPhoto chat_id:int53 file_id:int32 reason:ChatReportReason text:string = Ok; -//@description Returns 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 +//@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 +//@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 +//@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 need to 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; //@description Quickly returns approximate storage usage statistics. Can be called before authorization @@ -4654,20 +5590,20 @@ getStorageStatisticsFast = StorageStatisticsFast; getDatabaseStatistics = DatabaseStatistics; //@description Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted -//@size Limit on the total size of files after deletion. Pass -1 to use the default limit +//@size Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit //@ttl Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit //@count Limit on the total count of files after deletion. Pass -1 to use the default limit //@immunity_delay The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value -//@file_types If 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) +//@file_types If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted +//@chat_ids If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos) +//@exclude_chat_ids If non-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 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. -//-Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics @type The new network type. By default, networkTypeOther +//@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 must be called whenever the network is changed, even if the network type remains the same. +//-Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics @type The new network type; pass null to set network type to networkTypeOther setNetworkType type:NetworkType = Ok; //@description Returns network data usage statistics. Can be called before authorization @only_current If true, returns only data for the current library launch @@ -4682,7 +5618,7 @@ resetNetworkStatistics = Ok; //@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 +//@description Sets auto-download settings @settings New user auto-download settings @type Type of the network for which the new settings are relevant setAutoDownloadSettings settings:autoDownloadSettings type:NetworkType = Ok; @@ -4703,21 +5639,21 @@ setPassportElement element:InputPassportElement password:string = PassportElemen deletePassportElement type:PassportElementType = Ok; //@description Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed @user_id User identifier @errors The errors -setPassportElementErrors user_id:int32 errors:vector = Ok; +setPassportElementErrors user_id:int53 errors:vector = Ok; -//@description Returns an IETF language tag of the language preferred in the country, which should be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown @country_code A two-letter ISO 3166-1 alpha-2 country code +//@description Returns an IETF language tag of the language preferred in the country, which must be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown @country_code A two-letter ISO 3166-1 alpha-2 country code getPreferredCountryLanguage country_code:string = Text; //@description Sends a code to verify a phone number to be added to a user's Telegram Passport -//@phone_number The phone number of the user, in international format @settings Settings for the authentication of the user's phone number +//@phone_number The phone number of the user, in international format @settings Settings for the authentication of the user's phone number; pass null to use default settings sendPhoneNumberVerificationCode phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; //@description Re-sends the code to verify a phone number to be added to a user's Telegram Passport resendPhoneNumberVerificationCode = AuthenticationCodeInfo; -//@description Checks the phone number verification code for Telegram Passport @code Verification code +//@description Checks the phone number verification code for Telegram Passport @code Verification code to check checkPhoneNumberVerificationCode code:string = Ok; @@ -4727,12 +5663,12 @@ sendEmailAddressVerificationCode email_address:string = EmailAddressAuthenticati //@description Re-sends the code to verify an email address to be added to a user's Telegram Passport resendEmailAddressVerificationCode = EmailAddressAuthenticationCodeInfo; -//@description Checks the email address verification code for Telegram Passport @code Verification code +//@description Checks the email address verification code for Telegram Passport @code Verification code to check checkEmailAddressVerificationCode code:string = Ok; -//@description Returns a Telegram Passport authorization form for sharing data with a service @bot_user_id User identifier of the service's bot @scope Telegram Passport element types requested by the service @public_key Service's public_key @nonce Authorization form nonce provided by the service -getPassportAuthorizationForm bot_user_id:int32 scope:string public_key:string nonce:string = PassportAuthorizationForm; +//@description Returns a Telegram Passport authorization form for sharing data with a service @bot_user_id User identifier of the service's bot @scope Telegram Passport element types requested by the service @public_key Service's public key @nonce Unique request identifier provided by the service +getPassportAuthorizationForm bot_user_id:int53 scope:string public_key:string nonce:string = PassportAuthorizationForm; //@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; @@ -4742,14 +5678,13 @@ getPassportAuthorizationFormAvailableElements autorization_form_id:int32 passwor sendPassportAuthorizationForm autorization_form_id:int32 types:vector = Ok; -//@description Sends phone number confirmation code. Should be called when user presses "https://t.me/confirmphone?phone=*******&hash=**********" or "tg://confirmphone?phone=*******&hash=**********" link @hash Value of the "hash" parameter from the link -//@phone_number Value of the "phone" parameter from the link @settings Settings for the authentication of the user's phone number +//@description Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation @hash Hash value from the link @phone_number Phone number value from the link @settings Settings for the authentication of the user's phone number; pass null to use default settings sendPhoneNumberConfirmationCode hash:string phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; //@description Resends phone number confirmation code resendPhoneNumberConfirmationCode = AuthenticationCodeInfo; -//@description Checks phone number confirmation code @code The phone number confirmation code +//@description Checks phone number confirmation code @code Confirmation code to check checkPhoneNumberConfirmationCode code:string = Ok; @@ -4757,26 +5692,32 @@ 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 -uploadStickerFile user_id:int32 png_sticker:InputFile = File; +//@description Uploads a file with a sticker; returns the uploaded file @user_id Sticker file owner; ignored for regular users @sticker Sticker file to upload +uploadStickerFile user_id:int53 sticker:InputSticker = File; -//@description Creates a new sticker set; for bots only. Returns the newly created sticker set -//@user_id Sticker set owner +//@description Returns a suggested name for a new sticker set with a given title @title Sticker set title; 1-64 characters +getSuggestedStickerSetName title:string = Text; + +//@description Checks whether a name can be used for a new sticker set @name Name to be checked +checkStickerSetName name:string = CheckStickerSetNameResult; + +//@description Creates a new sticker set. Returns the newly created sticker set +//@user_id Sticker set owner; ignored for regular users //@title Sticker set title; 1-64 characters -//@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive); 1-64 characters +//@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters //@is_masks True, if stickers are masks. Animated stickers can't be masks -//@stickers List of stickers to be added to the set; must be non-empty. All stickers must be of the same type -createNewStickerSet user_id:int32 title:string name:string is_masks:Bool stickers:vector = StickerSet; +//@stickers List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown +//@source Source of the sticker set; may be empty if unknown +createNewStickerSet user_id:int53 title:string name:string is_masks:Bool stickers:vector source:string = StickerSet; //@description Adds a new sticker to a set; for bots only. Returns the sticker set //@user_id Sticker set owner @name Sticker set name @sticker Sticker to add to the set -addStickerToSet user_id:int32 name:string sticker:InputSticker = StickerSet; +addStickerToSet user_id:int53 name:string sticker:InputSticker = StickerSet; //@description Sets a sticker set thumbnail; for bots only. Returns the sticker set //@user_id Sticker set owner @name Sticker set name -//@thumbnail Thumbnail to set in PNG or TGS format. 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; +//@thumbnail Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them +setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile = StickerSet; //@description Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot //@sticker Sticker @position New position of the sticker in the set, zero-based @@ -4808,14 +5749,18 @@ setAlarm seconds:double = Ok; //@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 +//@description Uses the current IP address to find the current country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization 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; +//@description Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after changing localization to the specified language if properly localized country information is expected. Can be called synchronously +//@language_code A two-letter ISO 639-1 country code for country information localization @phone_number_prefix The phone number prefix +getPhoneNumberInfoSync language_code:string phone_number_prefix:string = PhoneNumberInfo; + +//@description Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram +getApplicationDownloadLink = HttpUrl; //@description Returns information about a tg:// deep link. Use "tg://need_update_for_some_feature" or "tg:some_unsupported_feature" for testing. Returns a 404 error for unknown links. Can be called before authorization @link The link getDeepLinkInfo link:string = DeepLinkInfo; @@ -4828,10 +5773,10 @@ getApplicationConfig = JsonValue; saveApplicationLogEvent type:string chat_id:int53 data:JsonValue = Ok; -//@description Adds a proxy server for network requests. Can be called before authorization @server Proxy server IP address @port Proxy server port @enable True, if the proxy should be enabled @type Proxy type +//@description Adds a proxy server for network requests. Can be called before authorization @server Proxy server IP address @port Proxy server port @enable True, if the proxy needs to be enabled @type Proxy type addProxy server:string port:int32 enable:Bool type:ProxyType = Proxy; -//@description Edits an existing proxy server for network requests. Can be called before authorization @proxy_id Proxy identifier @server Proxy server IP address @port Proxy server port @enable True, if the proxy should be enabled @type Proxy type +//@description Edits an existing proxy server for network requests. Can be called before authorization @proxy_id Proxy identifier @server Proxy server IP address @port Proxy server port @enable True, if the proxy needs to be enabled @type Proxy type editProxy proxy_id:int32 server:string port:int32 enable:Bool type:ProxyType = Proxy; //@description Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization @proxy_id Proxy identifier @@ -4847,7 +5792,7 @@ removeProxy proxy_id:int32 = Ok; getProxies = Proxies; //@description Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization @proxy_id Proxy identifier -getProxyLink proxy_id:int32 = Text; +getProxyLink proxy_id:int32 = HttpUrl; //@description Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization @proxy_id Proxy identifier. Use 0 to ping a Telegram server without a proxy pingProxy proxy_id:int32 = Seconds; @@ -4877,7 +5822,7 @@ setLogTagVerbosityLevel tag:string new_verbosity_level:int32 = Ok; getLogTagVerbosityLevel tag:string = LogVerbosityLevel; //@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 +//@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;