diff --git a/Makefile b/Makefile index 411bf9a..d3c4c50 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := v1.5.0 +TAG := v1.6.0 schema-update: curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl diff --git a/client/function.go b/client/function.go index 45cb8e8..d745901 100755 --- a/client/function.go +++ b/client/function.go @@ -35,6 +35,9 @@ func (client *Client) GetAuthorizationState() (AuthorizationState, error) { case TypeAuthorizationStateWaitCode: return UnmarshalAuthorizationStateWaitCode(result.Data) + case TypeAuthorizationStateWaitOtherDeviceConfirmation: + return UnmarshalAuthorizationStateWaitOtherDeviceConfirmation(result.Data) + case TypeAuthorizationStateWaitRegistration: return UnmarshalAuthorizationStateWaitRegistration(result.Data) @@ -117,7 +120,7 @@ type SetAuthenticationPhoneNumberRequest struct { Settings *PhoneNumberAuthenticationSettings `json:"settings"` } -// 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 or authorizationStateWaitPassword +// 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 func (client *Client) SetAuthenticationPhoneNumber(req *SetAuthenticationPhoneNumberRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -184,6 +187,32 @@ func (client *Client) CheckAuthenticationCode(req *CheckAuthenticationCodeReques return UnmarshalOk(result.Data) } +type RequestQrCodeAuthenticationRequest struct { + // List of user identifiers of other users currently using the client + OtherUserIds []int32 `json:"other_user_ids"` +} + +// Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber +func (client *Client) RequestQrCodeAuthentication(req *RequestQrCodeAuthenticationRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "requestQrCodeAuthentication", + }, + Data: map[string]interface{}{ + "other_user_ids": req.OtherUserIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type RegisterUserRequest struct { // The first name of the user; 1-64 characters FirstName string `json:"first_name"` @@ -367,7 +396,33 @@ func (client *Client) Destroy() (*Ok, error) { return UnmarshalOk(result.Data) } -// Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially usefull if TDLib is run in a separate process. This is an offline method. Can be called before authorization +type ConfirmQrCodeAuthenticationRequest struct { + // A link from a QR code. The link must be scanned by the in-app camera + Link string `json:"link"` +} + +// Confirms QR code authentication on another device. Returns created session on success +func (client *Client) ConfirmQrCodeAuthentication(req *ConfirmQrCodeAuthenticationRequest) (*Session, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "confirmQrCodeAuthentication", + }, + Data: map[string]interface{}{ + "link": req.Link, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalSession(result.Data) +} + +// Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially useful if TDLib is run in a separate process. This is an offline method. Can be called before authorization func (client *Client) GetCurrentState() (*Updates, error) { result, err := client.Send(Request{ meta: meta{ @@ -790,7 +845,7 @@ type GetSupergroupRequest struct { SupergroupId int32 `json:"supergroup_id"` } -// Returns information about a supergroup or channel by its identifier. This is an offline request if the current user is not a bot +// Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot func (client *Client) GetSupergroup(req *GetSupergroupRequest) (*Supergroup, error) { result, err := client.Send(Request{ meta: meta{ @@ -816,7 +871,7 @@ type GetSupergroupFullInfoRequest struct { SupergroupId int32 `json:"supergroup_id"` } -// Returns full information about a supergroup or channel by its identifier, cached for up to 1 minute +// Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute func (client *Client) GetSupergroupFullInfo(req *GetSupergroupFullInfoRequest) (*SupergroupFullInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -1064,7 +1119,7 @@ type GetRemoteFileRequest struct { FileType FileType `json:"file_type"` } -// Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message +// Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client func (client *Client) GetRemoteFile(req *GetRemoteFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -1087,6 +1142,8 @@ func (client *Client) GetRemoteFile(req *GetRemoteFileRequest) (*File, error) { } type GetChatsRequest struct { + // The chat list in which to return chats + ChatList ChatList `json:"chat_list"` // Chat order to return chats from OffsetOrder JsonInt64 `json:"offset_order"` // Chat identifier to return chats from @@ -1095,13 +1152,14 @@ type GetChatsRequest struct { Limit int32 `json:"limit"` } -// Returns an ordered list of chats. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). For optimal performance the number of returned chats is chosen by the library +// Returns an ordered list of chats in a chat list. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). For optimal performance the number of returned chats is chosen by the library 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, @@ -1173,7 +1231,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 string `json:"query"` - // Maximum number of chats to be returned + // The maximum number of chats to be returned Limit int32 `json:"limit"` } @@ -1202,7 +1260,7 @@ func (client *Client) SearchChats(req *SearchChatsRequest) (*Chats, error) { type SearchChatsOnServerRequest struct { // Query to search for Query string `json:"query"` - // Maximum number of chats to be returned + // The maximum number of chats to be returned Limit int32 `json:"limit"` } @@ -1228,10 +1286,36 @@ func (client *Client) SearchChatsOnServer(req *SearchChatsOnServerRequest) (*Cha return UnmarshalChats(result.Data) } +type SearchChatsNearbyRequest struct { + // Current user location + 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 +func (client *Client) SearchChatsNearby(req *SearchChatsNearbyRequest) (*ChatsNearby, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchChatsNearby", + }, + Data: map[string]interface{}{ + "location": req.Location, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatsNearby(result.Data) +} + type GetTopChatsRequest struct { // Category of chats to be returned Category TopChatCategory `json:"category"` - // Maximum number of chats to be returned; up to 30 + // The maximum number of chats to be returned; up to 30 Limit int32 `json:"limit"` } @@ -1404,12 +1488,83 @@ func (client *Client) CheckChatUsername(req *CheckChatUsernameRequest) (CheckCha } } -// Returns a list of public chats with username created by the user -func (client *Client) GetCreatedPublicChats() (*Chats, error) { +type GetCreatedPublicChatsRequest struct { + // Type of the public chats to return + Type PublicChatType `json:"type"` +} + +// Returns a list of public chats of the specified type, owned by the user +func (client *Client) GetCreatedPublicChats(req *GetCreatedPublicChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ Type: "getCreatedPublicChats", }, + Data: map[string]interface{}{ + "type": req.Type, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type CheckCreatedPublicChatsLimitRequest struct { + // Type of the public chats, for which to check the limit + Type PublicChatType `json:"type"` +} + +// Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached +func (client *Client) CheckCreatedPublicChatsLimit(req *CheckCreatedPublicChatsLimitRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkCreatedPublicChatsLimit", + }, + Data: map[string]interface{}{ + "type": req.Type, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Basic group chats need to be first upgraded to supergroups before they can be set as a discussion group +func (client *Client) GetSuitableDiscussionChats() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSuitableDiscussionChats", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +// Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error +func (client *Client) GetInactiveSupergroupChats() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getInactiveSupergroupChats", + }, Data: map[string]interface{}{}, }) if err != nil { @@ -1428,7 +1583,7 @@ type GetGroupsInCommonRequest struct { UserId int32 `json:"user_id"` // Chat identifier starting from which to return chats; use 0 for the first request OffsetChatId int64 `json:"offset_chat_id"` - // Maximum number of chats to be returned; up to 100 + // The maximum number of chats to be returned; up to 100 Limit int32 `json:"limit"` } @@ -1570,6 +1725,8 @@ 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 + 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 @@ -1589,6 +1746,7 @@ func (client *Client) SearchMessages(req *SearchMessagesRequest) (*Messages, err Type: "searchMessages", }, Data: map[string]interface{}{ + "chat_list": req.ChatList, "query": req.Query, "offset_date": req.OffsetDate, "offset_chat_id": req.OffsetChatId, @@ -1614,7 +1772,7 @@ type SearchSecretMessagesRequest struct { Query string `json:"query"` // The identifier from the result of a previous request, use 0 to get results from the last message FromSearchId JsonInt64 `json:"from_search_id"` - // Maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached + // The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached Limit int32 `json:"limit"` // A filter for the content of messages in the search results Filter SearchMessagesFilter `json:"filter"` @@ -1680,7 +1838,7 @@ func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*Messa type SearchChatRecentLocationMessagesRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Maximum number of messages to be returned + // The maximum number of messages to be returned Limit int32 `json:"limit"` } @@ -1786,6 +1944,32 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou return UnmarshalCount(result.Data) } +type GetChatScheduledMessagesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) +func (client *Client) GetChatScheduledMessages(req *GetChatScheduledMessagesRequest) (*Messages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatScheduledMessages", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessages(result.Data) +} + type RemoveNotificationRequest struct { // Identifier of notification group to which the notification belongs NotificationGroupId int32 `json:"notification_group_id"` @@ -1818,7 +2002,7 @@ func (client *Client) RemoveNotification(req *RemoveNotificationRequest) (*Ok, e type RemoveNotificationGroupRequest struct { // Notification group identifier NotificationGroupId int32 `json:"notification_group_id"` - // Maximum identifier of removed notifications + // The maximum identifier of removed notifications MaxNotificationId int32 `json:"max_notification_id"` } @@ -1853,7 +2037,7 @@ type GetPublicMessageLinkRequest struct { ForAlbum bool `json:"for_album"` } -// Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with username +// Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with a username func (client *Client) GetPublicMessageLink(req *GetPublicMessageLinkRequest) (*PublicMessageLink, error) { result, err := client.Send(Request{ meta: meta{ @@ -1936,10 +2120,8 @@ type SendMessageRequest struct { ChatId int64 `json:"chat_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. Not supported in secret chats - DisableNotification bool `json:"disable_notification"` - // Pass true if the message is sent from the background - FromBackground bool `json:"from_background"` + // Options to be used to send the message + Options *SendMessageOptions `json:"options"` // Markup for replying to the message; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` // The content of the message to be sent @@ -1955,8 +2137,7 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { Data: map[string]interface{}{ "chat_id": req.ChatId, "reply_to_message_id": req.ReplyToMessageId, - "disable_notification": req.DisableNotification, - "from_background": req.FromBackground, + "options": req.Options, "reply_markup": req.ReplyMarkup, "input_message_content": req.InputMessageContent, }, @@ -1977,10 +2158,8 @@ type SendMessageAlbumRequest struct { ChatId int64 `json:"chat_id"` // Identifier of a message to reply to or 0 ReplyToMessageId int64 `json:"reply_to_message_id"` - // Pass true to disable notification for the messages. Not supported in secret chats - DisableNotification bool `json:"disable_notification"` - // Pass true if the messages are sent from the background - FromBackground bool `json:"from_background"` + // Options to be used to send the messages + Options *SendMessageOptions `json:"options"` // Contents of messages to be sent InputMessageContents []InputMessageContent `json:"input_message_contents"` } @@ -1994,8 +2173,7 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, Data: map[string]interface{}{ "chat_id": req.ChatId, "reply_to_message_id": req.ReplyToMessageId, - "disable_notification": req.DisableNotification, - "from_background": req.FromBackground, + "options": req.Options, "input_message_contents": req.InputMessageContents, }, }) @@ -2047,10 +2225,8 @@ type SendInlineQueryResultMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of a message to reply to or 0 ReplyToMessageId int64 `json:"reply_to_message_id"` - // Pass true to disable notification for the message. Not supported in secret chats - DisableNotification bool `json:"disable_notification"` - // Pass true if the message is sent from background - FromBackground bool `json:"from_background"` + // Options to be used to send the message + Options *SendMessageOptions `json:"options"` // Identifier of the inline query QueryId JsonInt64 `json:"query_id"` // Identifier of the inline result @@ -2066,13 +2242,12 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes Type: "sendInlineQueryResultMessage", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "reply_to_message_id": req.ReplyToMessageId, - "disable_notification": req.DisableNotification, - "from_background": req.FromBackground, - "query_id": req.QueryId, - "result_id": req.ResultId, - "hide_via_bot": req.HideViaBot, + "chat_id": req.ChatId, + "reply_to_message_id": req.ReplyToMessageId, + "options": req.Options, + "query_id": req.QueryId, + "result_id": req.ResultId, + "hide_via_bot": req.HideViaBot, }, }) if err != nil { @@ -2093,10 +2268,8 @@ type ForwardMessagesRequest struct { FromChatId int64 `json:"from_chat_id"` // Identifiers of the messages to forward MessageIds []int64 `json:"message_ids"` - // Pass true to disable notification for the message, doesn't work if messages are forwarded to a secret chat - DisableNotification bool `json:"disable_notification"` - // Pass true if the messages are sent from the background - FromBackground bool `json:"from_background"` + // Options to be used to send the messages + Options *SendMessageOptions `json:"options"` // True, if the messages should be grouped into an album after forwarding. For this to work, no more than 10 messages may be forwarded, and all of them must be photo or video messages AsAlbum bool `json:"as_album"` // 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 @@ -2112,14 +2285,13 @@ func (client *Client) ForwardMessages(req *ForwardMessagesRequest) (*Messages, e Type: "forwardMessages", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "from_chat_id": req.FromChatId, - "message_ids": req.MessageIds, - "disable_notification": req.DisableNotification, - "from_background": req.FromBackground, - "as_album": req.AsAlbum, - "send_copy": req.SendCopy, - "remove_caption": req.RemoveCaption, + "chat_id": req.ChatId, + "from_chat_id": req.FromChatId, + "message_ids": req.MessageIds, + "options": req.Options, + "as_album": req.AsAlbum, + "send_copy": req.SendCopy, + "remove_caption": req.RemoveCaption, }, }) if err != nil { @@ -2294,7 +2466,7 @@ type DeleteChatMessagesFromUserRequest struct { UserId int32 `json:"user_id"` } -// Deletes all messages sent by the specified user to a chat. Supported only in supergroups; requires can_delete_messages administrator privileges +// 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) { result, err := client.Send(Request{ meta: meta{ @@ -2645,6 +2817,38 @@ func (client *Client) EditInlineMessageReplyMarkup(req *EditInlineMessageReplyMa return UnmarshalOk(result.Data) } +type EditMessageSchedulingStateRequest struct { + // The chat the message belongs to + 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 + SchedulingState MessageSchedulingState `json:"scheduling_state"` +} + +// 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 +func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingStateRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editMessageSchedulingState", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "scheduling_state": req.SchedulingState, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetTextEntitiesRequest struct { // The text in which to look for entites Text string `json:"text"` @@ -2678,7 +2882,7 @@ type ParseTextEntitiesRequest struct { ParseMode TextParseMode `json:"parse_mode"` } -// Parses Bold, Italic, Code, Pre, PreCode and TextUrl entities contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -2903,11 +3107,11 @@ type SetPollAnswerRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message containing the poll MessageId int64 `json:"message_id"` - // 0-based identifiers of options, chosen by the user. Currently user can't choose more than 1 option + // 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 OptionIds []int32 `json:"option_ids"` } -// Changes user answer to a poll +// Changes the user answer to a poll. A poll in quiz mode can be answered only once func (client *Client) SetPollAnswer(req *SetPollAnswerRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -2930,6 +3134,44 @@ func (client *Client) SetPollAnswer(req *SetPollAnswerRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetPollVotersRequest struct { + // Identifier of the chat to which the poll belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message containing the poll + MessageId int64 `json:"message_id"` + // 0-based identifier of the answer option + 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 + 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 +func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*Users, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPollVoters", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "option_id": req.OptionId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUsers(result.Data) +} + type StopPollRequest struct { // Identifier of the chat to which the poll belongs ChatId int64 `json:"chat_id"` @@ -2962,10 +3204,86 @@ func (client *Client) StopPoll(req *StopPollRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetLoginUrlInfoRequest struct { + // Chat identifier of the message with the button + ChatId int64 `json:"chat_id"` + // Message identifier of the message with the button + MessageId int64 `json:"message_id"` + // Button identifier + ButtonId int32 `json:"button_id"` +} + +// Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button +func (client *Client) GetLoginUrlInfo(req *GetLoginUrlInfoRequest) (LoginUrlInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLoginUrlInfo", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "button_id": req.ButtonId, + }, + }) + 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 GetLoginUrlRequest struct { + // Chat identifier of the message with the button + ChatId int64 `json:"chat_id"` + // Message identifier of the message with the button + MessageId int64 `json:"message_id"` + // Button identifier + ButtonId int32 `json:"button_id"` + // True, if the user allowed the bot to send them messages + AllowWriteAccess bool `json:"allow_write_access"` +} + +// 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 +func (client *Client) GetLoginUrl(req *GetLoginUrlRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLoginUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "button_id": req.ButtonId, + "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 GetInlineQueryResultsRequest struct { // The identifier of the target bot BotUserId int32 `json:"bot_user_id"` - // Identifier of the chat, where the query was sent + // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` // Location of the user, only if needed UserLocation *Location `json:"user_location"` @@ -3661,6 +3979,8 @@ type CreateNewSupergroupChatRequest struct { IsChannel bool `json:"is_channel"` // Chat description; 0-255 characters Description string `json:"description"` + // Chat location if a location-based supergroup is being created + Location *ChatLocation `json:"location"` } // Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat @@ -3673,6 +3993,7 @@ func (client *Client) CreateNewSupergroupChat(req *CreateNewSupergroupChatReques "title": req.Title, "is_channel": req.IsChannel, "description": req.Description, + "location": req.Location, }, }) if err != nil { @@ -3738,6 +4059,35 @@ func (client *Client) UpgradeBasicGroupChatToSupergroupChat(req *UpgradeBasicGro return UnmarshalChat(result.Data) } +type SetChatChatListRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New chat list of the chat + ChatList ChatList `json:"chat_list"` +} + +// Moves a chat to a different chat list. Current chat list of the chat must ne non-null +func (client *Client) SetChatChatList(req *SetChatChatListRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatChatList", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "chat_list": req.ChatList, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatTitleRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -3857,11 +4207,11 @@ func (client *Client) SetChatDraftMessage(req *SetChatDraftMessageRequest) (*Ok, type SetChatNotificationSettingsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New notification settings for the chat + // New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever NotificationSettings *ChatNotificationSettings `json:"notification_settings"` } -// Changes the notification settings of a chat +// Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed func (client *Client) SetChatNotificationSettings(req *SetChatNotificationSettingsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -3890,7 +4240,7 @@ type ToggleChatIsPinnedRequest struct { IsPinned bool `json:"is_pinned"` } -// Changes the pinned state of a chat. You can pin up to GetOption("pinned_chat_count_max") non-secret chats and the same number of secret chats +// Changes the pinned state of a chat. You can pin up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") non-secret chats and the same number of secret chats in the main/archive chat list func (client *Client) ToggleChatIsPinned(req *ToggleChatIsPinnedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4028,6 +4378,93 @@ func (client *Client) SetChatDescription(req *SetChatDescriptionRequest) (*Ok, e return UnmarshalOk(result.Data) } +type SetChatDiscussionGroupRequest struct { + // Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup) + ChatId int64 `json:"chat_id"` + // Identifier of a new channel's discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats needs to be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable needs to be used first to change that + 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 +func (client *Client) SetChatDiscussionGroup(req *SetChatDiscussionGroupRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatDiscussionGroup", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "discussion_chat_id": req.DiscussionChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetChatLocationRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New location for the chat; must be valid and not null + Location *ChatLocation `json:"location"` +} + +// 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 +func (client *Client) SetChatLocation(req *SetChatLocationRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatLocation", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "location": req.Location, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +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 + SlowModeDelay int32 `json:"slow_mode_delay"` +} + +// Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights +func (client *Client) SetChatSlowModeDelay(req *SetChatSlowModeDelayRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatSlowModeDelay", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "slow_mode_delay": req.SlowModeDelay, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type PinChatMessageRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` @@ -4208,7 +4645,7 @@ type SetChatMemberStatusRequest struct { 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; instead, use addChatMember. 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 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 func (client *Client) SetChatMemberStatus(req *SetChatMemberStatusRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4231,6 +4668,72 @@ func (client *Client) SetChatMemberStatus(req *SetChatMemberStatusRequest) (*Ok, return UnmarshalOk(result.Data) } +// Checks whether the current session can be used to transfer a chat ownership to another user +func (client *Client) CanTransferOwnership() (CanTransferOwnershipResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "canTransferOwnership", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeCanTransferOwnershipResultOk: + return UnmarshalCanTransferOwnershipResultOk(result.Data) + + case TypeCanTransferOwnershipResultPasswordNeeded: + return UnmarshalCanTransferOwnershipResultPasswordNeeded(result.Data) + + case TypeCanTransferOwnershipResultPasswordTooFresh: + return UnmarshalCanTransferOwnershipResultPasswordTooFresh(result.Data) + + case TypeCanTransferOwnershipResultSessionTooFresh: + return UnmarshalCanTransferOwnershipResultSessionTooFresh(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +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"` + // The password of the current user + Password string `json:"password"` +} + +// 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 +func (client *Client) TransferChatOwnership(req *TransferChatOwnershipRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "transferChatOwnership", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "user_id": req.UserId, + "password": req.Password, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetChatMemberRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -4300,8 +4803,8 @@ type GetChatAdministratorsRequest struct { ChatId int64 `json:"chat_id"` } -// Returns a list of users who are administrators of the chat -func (client *Client) GetChatAdministrators(req *GetChatAdministratorsRequest) (*Users, error) { +// Returns a list of administrators of the chat with their custom titles +func (client *Client) GetChatAdministrators(req *GetChatAdministratorsRequest) (*ChatAdministrators, error) { result, err := client.Send(Request{ meta: meta{ Type: "getChatAdministrators", @@ -4318,7 +4821,7 @@ func (client *Client) GetChatAdministrators(req *GetChatAdministratorsRequest) ( return nil, buildResponseError(result.Data) } - return UnmarshalUsers(result.Data) + return UnmarshalChatAdministrators(result.Data) } type ClearAllDraftMessagesRequest struct { @@ -4451,6 +4954,8 @@ func (client *Client) ResetAllNotificationSettings() (*Ok, error) { } type SetPinnedChatsRequest struct { + // Chat list in which to change the order of pinned chats + ChatList ChatList `json:"chat_list"` // The new list of pinned chats ChatIds []int64 `json:"chat_ids"` } @@ -4462,7 +4967,8 @@ func (client *Client) SetPinnedChats(req *SetPinnedChatsRequest) (*Ok, error) { Type: "setPinnedChats", }, Data: map[string]interface{}{ - "chat_ids": req.ChatIds, + "chat_list": req.ChatList, + "chat_ids": req.ChatIds, }, }) if err != nil { @@ -4671,7 +5177,7 @@ type SetFileGenerationProgressRequest struct { LocalPrefixSize int32 `json:"local_prefix_size"` } -// Informs TDLib on a file generation prograss +// Informs TDLib on a file generation progress func (client *Client) SetFileGenerationProgress(req *SetFileGenerationProgressRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5071,7 +5577,7 @@ func (client *Client) UnblockUser(req *UnblockUserRequest) (*Ok, error) { type GetBlockedUsersRequest struct { // Number of users to skip in the result; must be non-negative Offset int32 `json:"offset"` - // Maximum number of users to return; up to 100 + // The maximum number of users to return; up to 100 Limit int32 `json:"limit"` } @@ -5097,12 +5603,41 @@ func (client *Client) GetBlockedUsers(req *GetBlockedUsersRequest) (*Users, erro return UnmarshalUsers(result.Data) } +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 + SharePhoneNumber bool `json:"share_phone_number"` +} + +// Adds a user to the contact list or edits an existing contact by their user identifier +func (client *Client) AddContact(req *AddContactRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addContact", + }, + Data: map[string]interface{}{ + "contact": req.Contact, + "share_phone_number": req.SharePhoneNumber, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ImportContactsRequest struct { - // The list of contacts to import or edit, contact's vCard are ignored and are not imported + // The list of contacts to import or edit; contacts' vCard are ignored and are not imported Contacts []*Contact `json:"contacts"` } -// Adds new contacts or edits existing contacts; contacts' user identifiers are ignored +// Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored func (client *Client) ImportContacts(req *ImportContactsRequest) (*ImportedContacts, error) { result, err := client.Send(Request{ meta: meta{ @@ -5145,7 +5680,7 @@ func (client *Client) GetContacts() (*Users, error) { type SearchContactsRequest struct { // Query to search for; may be empty to return all contacts Query string `json:"query"` - // Maximum number of users to be returned + // The maximum number of users to be returned Limit int32 `json:"limit"` } @@ -5261,12 +5796,38 @@ func (client *Client) ClearImportedContacts() (*Ok, error) { return UnmarshalOk(result.Data) } +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"` +} + +// Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber +func (client *Client) SharePhoneNumber(req *SharePhoneNumberRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sharePhoneNumber", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetUserProfilePhotosRequest struct { // User identifier UserId int32 `json:"user_id"` // The number of photos to skip; must be non-negative Offset int32 `json:"offset"` - // Maximum number of photos to be returned; up to 100 + // The maximum number of photos to be returned; up to 100 Limit int32 `json:"limit"` } @@ -5296,7 +5857,7 @@ func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*U type GetStickersRequest struct { // String representation of emoji. If empty, returns all known installed stickers Emoji string `json:"emoji"` - // Maximum number of stickers to be returned + // The maximum number of stickers to be returned Limit int32 `json:"limit"` } @@ -5325,7 +5886,7 @@ func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) { type SearchStickersRequest struct { // String representation of emoji; must be non-empty Emoji string `json:"emoji"` - // Maximum number of stickers to be returned + // The maximum number of stickers to be returned Limit int32 `json:"limit"` } @@ -5382,7 +5943,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"` - // Maximum number of sticker sets to return + // The maximum number of sticker sets to return Limit int32 `json:"limit"` } @@ -5511,7 +6072,7 @@ type SearchInstalledStickerSetsRequest struct { IsMasks bool `json:"is_masks"` // Query to search for Query string `json:"query"` - // Maximum number of sticker sets to return + // The maximum number of sticker sets to return Limit int32 `json:"limit"` } @@ -5863,6 +6424,8 @@ type SearchEmojisRequest struct { Text string `json:"text"` // True, if only emojis, which exactly match text needs to be returned ExactMatch bool `json:"exact_match"` + // IETF language tag of the user's input language; may be empty if unknown + InputLanguageCode string `json:"input_language_code"` } // Searches for emojis by keywords. Supported only if the file database is enabled @@ -5872,8 +6435,9 @@ func (client *Client) SearchEmojis(req *SearchEmojisRequest) (*Emojis, error) { Type: "searchEmojis", }, Data: map[string]interface{}{ - "text": req.Text, - "exact_match": req.ExactMatch, + "text": req.Text, + "exact_match": req.ExactMatch, + "input_language_code": req.InputLanguageCode, }, }) if err != nil { @@ -6006,7 +6570,7 @@ func (client *Client) GetRecentInlineBots() (*Users, error) { type SearchHashtagsRequest struct { // Hashtag prefix to search for Prefix string `json:"prefix"` - // Maximum number of hashtags to be returned + // The maximum number of hashtags to be returned Limit int32 `json:"limit"` } @@ -6455,7 +7019,7 @@ type SetSupergroupUsernameRequest struct { Username string `json:"username"` } -// Changes the username of a supergroup or channel, requires creator privileges in the supergroup or channel +// Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel func (client *Client) SetSupergroupUsername(req *SetSupergroupUsernameRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6636,7 +7200,7 @@ type DeleteSupergroupRequest struct { 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 creator privileges in the supergroup or channel. Chats with more than 1000 members can't be deleted using this method +// 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{ @@ -6662,7 +7226,7 @@ type CloseSecretChatRequest struct { SecretChatId int32 `json:"secret_chat_id"` } -// Closes a secret chat, effectively transfering its state to secretChatStateClosed +// Closes a secret chat, effectively transferring its state to secretChatStateClosed func (client *Client) CloseSecretChat(req *CloseSecretChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6690,7 +7254,7 @@ type GetChatEventLogRequest struct { Query string `json:"query"` // Identifier of an event from which to return results. Use 0 to get results from the latest events FromEventId JsonInt64 `json:"from_event_id"` - // Maximum number of events to return; up to 100 + // 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 Filters *ChatEventLogFilters `json:"filters"` @@ -6698,7 +7262,7 @@ type GetChatEventLogRequest struct { UserIds []int32 `json:"user_ids"` } -// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only in supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id) +// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id) func (client *Client) GetChatEventLog(req *GetChatEventLogRequest) (*ChatEvents, error) { result, err := client.Send(Request{ meta: meta{ @@ -7013,7 +7577,7 @@ func (client *Client) SearchBackground(req *SearchBackgroundRequest) (*Backgroun } type SetBackgroundRequest struct { - // The input background to use, null for solid backgrounds + // The input background to use, null for filled backgrounds Background InputBackground `json:"background"` // Background type; null for default background. The method will return error 404 if type is null Type BackgroundType `json:"type"` @@ -7045,7 +7609,7 @@ func (client *Client) SetBackground(req *SetBackgroundRequest) (*Background, err } type RemoveBackgroundRequest struct { - // The background indentifier + // The background identifier BackgroundId JsonInt64 `json:"background_id"` } @@ -7635,16 +8199,16 @@ func (client *Client) DeleteAccount(req *DeleteAccountRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GetChatReportSpamStateRequest struct { +type RemoveChatActionBarRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` } -// Returns information on whether the current chat can be reported as spam -func (client *Client) GetChatReportSpamState(req *GetChatReportSpamStateRequest) (*ChatReportSpamState, error) { +// Removes a chat action bar without any other action +func (client *Client) RemoveChatActionBar(req *RemoveChatActionBarRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getChatReportSpamState", + Type: "removeChatActionBar", }, Data: map[string]interface{}{ "chat_id": req.ChatId, @@ -7658,35 +8222,6 @@ func (client *Client) GetChatReportSpamState(req *GetChatReportSpamStateRequest) return nil, buildResponseError(result.Data) } - return UnmarshalChatReportSpamState(result.Data) -} - -type ChangeChatReportSpamStateRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // If true, the chat will be reported as spam; otherwise it will be marked as not spam - IsSpamChat bool `json:"is_spam_chat"` -} - -// Reports to the server whether a chat is a spam chat or not. Can be used only if ChatReportSpamState.can_report_spam is true. After this request, ChatReportSpamState.can_report_spam becomes false forever -func (client *Client) ChangeChatReportSpamState(req *ChangeChatReportSpamStateRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "changeChatReportSpamState", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "is_spam_chat": req.IsSpamChat, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - return UnmarshalOk(result.Data) } @@ -7699,7 +8234,7 @@ type ReportChatRequest struct { MessageIds []int64 `json:"message_ids"` } -// Reports a chat to the Telegram moderators. Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by moderators +// Reports a chat to the Telegram moderators. Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by moderators, or when the report is done from the chat action bar func (client *Client) ReportChat(req *ReportChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7731,7 +8266,7 @@ type GetChatStatisticsUrlRequest struct { IsDark bool `json:"is_dark"` } -// Returns an HTTP URL with the chat statistics. Currently this method can be used only for channels +// Returns an HTTP URL with the chat statistics. Currently this method can be used only for channels. Can be used only if SupergroupFullInfo.can_view_statistics == true func (client *Client) GetChatStatisticsUrl(req *GetChatStatisticsUrlRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -7755,7 +8290,7 @@ func (client *Client) GetChatStatisticsUrl(req *GetChatStatisticsUrlRequest) (*H } type GetStorageStatisticsRequest struct { - // 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 should be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0 ChatLimit int32 `json:"chat_limit"` } @@ -9436,7 +9971,7 @@ func (client *Client) GetLogTagVerbosityLevel(req *GetLogTagVerbosityLevelReques } type AddLogMessageRequest struct { - // 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"` @@ -9691,6 +10226,10 @@ type TestProxyRequest struct { Port int32 `json:"port"` // Proxy type Type ProxyType `json:"type"` + // Identifier of a datacenter, with which to test connection + DcId int32 `json:"dc_id"` + // The maximum overall timeout for the request + Timeout float64 `json:"timeout"` } // Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization @@ -9700,9 +10239,11 @@ func (client *Client) TestProxy(req *TestProxyRequest) (*Ok, error) { Type: "testProxy", }, Data: map[string]interface{}{ - "server": req.Server, - "port": req.Port, - "type": req.Type, + "server": req.Server, + "port": req.Port, + "type": req.Type, + "dc_id": req.DcId, + "timeout": req.Timeout, }, }) if err != nil { @@ -9782,9 +10323,15 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(result.Data) + case TypeUpdateMessageLiveLocationViewed: + return UnmarshalUpdateMessageLiveLocationViewed(result.Data) + case TypeUpdateNewChat: return UnmarshalUpdateNewChat(result.Data) + case TypeUpdateChatChatList: + return UnmarshalUpdateChatChatList(result.Data) + case TypeUpdateChatTitle: return UnmarshalUpdateChatTitle(result.Data) @@ -9809,6 +10356,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatIsSponsored: return UnmarshalUpdateChatIsSponsored(result.Data) + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(result.Data) + case TypeUpdateChatDefaultDisableNotification: return UnmarshalUpdateChatDefaultDisableNotification(result.Data) @@ -9827,6 +10377,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateScopeNotificationSettings: return UnmarshalUpdateScopeNotificationSettings(result.Data) + case TypeUpdateChatActionBar: + return UnmarshalUpdateChatActionBar(result.Data) + case TypeUpdateChatPinnedMessage: return UnmarshalUpdateChatPinnedMessage(result.Data) @@ -9935,6 +10488,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateTermsOfService: return UnmarshalUpdateTermsOfService(result.Data) + case TypeUpdateUsersNearby: + return UnmarshalUpdateUsersNearby(result.Data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(result.Data) @@ -9962,6 +10518,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdatePoll: return UnmarshalUpdatePoll(result.Data) + case TypeUpdatePollAnswer: + return UnmarshalUpdatePollAnswer(result.Data) + default: return nil, errors.New("invalid type") } diff --git a/client/type.go b/client/type.go index f27775d..60e4a0d 100755 --- a/client/type.go +++ b/client/type.go @@ -11,7 +11,7 @@ const ( ClassAuthorizationState = "AuthorizationState" ClassInputFile = "InputFile" ClassMaskPoint = "MaskPoint" - ClassLinkState = "LinkState" + ClassPollType = "PollType" ClassUserType = "UserType" ClassChatMemberStatus = "ChatMemberStatus" ClassChatMembersFilter = "ChatMembersFilter" @@ -21,9 +21,13 @@ const ( ClassMessageSendingState = "MessageSendingState" ClassNotificationSettingsScope = "NotificationSettingsScope" ClassChatType = "ChatType" + ClassChatList = "ChatList" + ClassPublicChatType = "PublicChatType" + ClassChatActionBar = "ChatActionBar" ClassKeyboardButtonType = "KeyboardButtonType" ClassInlineKeyboardButtonType = "InlineKeyboardButtonType" ClassReplyMarkup = "ReplyMarkup" + ClassLoginUrlInfo = "LoginUrlInfo" ClassRichText = "RichText" ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment" ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" @@ -36,6 +40,7 @@ const ( ClassInputPassportElementErrorSource = "InputPassportElementErrorSource" ClassMessageContent = "MessageContent" ClassTextEntityType = "TextEntityType" + ClassMessageSchedulingState = "MessageSchedulingState" ClassInputMessageContent = "InputMessageContent" ClassSearchMessagesFilter = "SearchMessagesFilter" ClassChatAction = "ChatAction" @@ -49,8 +54,10 @@ const ( ClassChatEventAction = "ChatEventAction" ClassLanguagePackStringValue = "LanguagePackStringValue" ClassDeviceToken = "DeviceToken" + ClassBackgroundFill = "BackgroundFill" ClassBackgroundType = "BackgroundType" ClassInputBackground = "InputBackground" + ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" ClassCheckChatUsernameResult = "CheckChatUsernameResult" ClassPushMessageContent = "PushMessageContent" ClassNotificationType = "NotificationType" @@ -106,11 +113,14 @@ const ( ClassChatPhoto = "ChatPhoto" ClassBotCommand = "BotCommand" ClassBotInfo = "BotInfo" + ClassChatLocation = "ChatLocation" ClassUser = "User" ClassUserFullInfo = "UserFullInfo" ClassUserProfilePhoto = "UserProfilePhoto" ClassUserProfilePhotos = "UserProfilePhotos" ClassUsers = "Users" + ClassChatAdministrator = "ChatAdministrator" + ClassChatAdministrators = "ChatAdministrators" ClassChatPermissions = "ChatPermissions" ClassChatMember = "ChatMember" ClassChatMembers = "ChatMembers" @@ -128,6 +138,8 @@ const ( ClassDraftMessage = "DraftMessage" ClassChat = "Chat" ClassChats = "Chats" + ClassChatNearby = "ChatNearby" + ClassChatsNearby = "ChatsNearby" ClassChatInviteLink = "ChatInviteLink" ClassChatInviteLinkInfo = "ChatInviteLinkInfo" ClassKeyboardButton = "KeyboardButton" @@ -166,6 +178,7 @@ const ( ClassEncryptedPassportElement = "EncryptedPassportElement" ClassInputPassportElementError = "InputPassportElementError" ClassInputThumbnail = "InputThumbnail" + ClassSendMessageOptions = "SendMessageOptions" ClassStickers = "Stickers" ClassEmojis = "Emojis" ClassStickerSet = "StickerSet" @@ -204,7 +217,6 @@ const ( ClassSessions = "Sessions" ClassConnectedWebsite = "ConnectedWebsite" ClassConnectedWebsites = "ConnectedWebsites" - ClassChatReportSpamState = "ChatReportSpamState" ClassPublicMessageLink = "PublicMessageLink" ClassMessageLinkInfo = "MessageLinkInfo" ClassFilePart = "FilePart" @@ -255,6 +267,7 @@ const ( TypeAuthorizationStateWaitEncryptionKey = "authorizationStateWaitEncryptionKey" TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" TypeAuthorizationStateWaitCode = "authorizationStateWaitCode" + TypeAuthorizationStateWaitOtherDeviceConfirmation = "authorizationStateWaitOtherDeviceConfirmation" TypeAuthorizationStateWaitRegistration = "authorizationStateWaitRegistration" TypeAuthorizationStateWaitPassword = "authorizationStateWaitPassword" TypeAuthorizationStateReady = "authorizationStateReady" @@ -279,6 +292,8 @@ const ( TypeMaskPointChin = "maskPointChin" TypeMaskPosition = "maskPosition" TypePollOption = "pollOption" + TypePollTypeRegular = "pollTypeRegular" + TypePollTypeQuiz = "pollTypeQuiz" TypeAnimation = "animation" TypeAudio = "audio" TypeDocument = "document" @@ -294,20 +309,20 @@ const ( TypePoll = "poll" TypeProfilePhoto = "profilePhoto" TypeChatPhoto = "chatPhoto" - TypeLinkStateNone = "linkStateNone" - TypeLinkStateKnowsPhoneNumber = "linkStateKnowsPhoneNumber" - TypeLinkStateIsContact = "linkStateIsContact" TypeUserTypeRegular = "userTypeRegular" TypeUserTypeDeleted = "userTypeDeleted" TypeUserTypeBot = "userTypeBot" TypeUserTypeUnknown = "userTypeUnknown" TypeBotCommand = "botCommand" TypeBotInfo = "botInfo" + TypeChatLocation = "chatLocation" TypeUser = "user" TypeUserFullInfo = "userFullInfo" TypeUserProfilePhoto = "userProfilePhoto" TypeUserProfilePhotos = "userProfilePhotos" TypeUsers = "users" + TypeChatAdministrator = "chatAdministrator" + TypeChatAdministrators = "chatAdministrators" TypeChatPermissions = "chatPermissions" TypeChatMemberStatusCreator = "chatMemberStatusCreator" TypeChatMemberStatusAdministrator = "chatMemberStatusAdministrator" @@ -357,13 +372,25 @@ const ( TypeChatTypeBasicGroup = "chatTypeBasicGroup" TypeChatTypeSupergroup = "chatTypeSupergroup" TypeChatTypeSecret = "chatTypeSecret" + TypeChatListMain = "chatListMain" + TypeChatListArchive = "chatListArchive" TypeChat = "chat" TypeChats = "chats" + TypeChatNearby = "chatNearby" + TypeChatsNearby = "chatsNearby" TypeChatInviteLink = "chatInviteLink" TypeChatInviteLinkInfo = "chatInviteLinkInfo" + TypePublicChatTypeHasUsername = "publicChatTypeHasUsername" + TypePublicChatTypeIsLocationBased = "publicChatTypeIsLocationBased" + TypeChatActionBarReportSpam = "chatActionBarReportSpam" + TypeChatActionBarReportUnrelatedLocation = "chatActionBarReportUnrelatedLocation" + TypeChatActionBarReportAddBlock = "chatActionBarReportAddBlock" + TypeChatActionBarAddContact = "chatActionBarAddContact" + TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber" TypeKeyboardButtonTypeText = "keyboardButtonTypeText" TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" + TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll" TypeKeyboardButton = "keyboardButton" TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl" @@ -376,6 +403,8 @@ const ( TypeReplyMarkupForceReply = "replyMarkupForceReply" TypeReplyMarkupShowKeyboard = "replyMarkupShowKeyboard" TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard" + TypeLoginUrlInfoOpen = "loginUrlInfoOpen" + TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" TypeRichTextItalic = "richTextItalic" @@ -419,6 +448,7 @@ const ( TypePageBlockAudio = "pageBlockAudio" TypePageBlockPhoto = "pageBlockPhoto" TypePageBlockVideo = "pageBlockVideo" + TypePageBlockVoiceNote = "pageBlockVoiceNote" TypePageBlockCover = "pageBlockCover" TypePageBlockEmbedded = "pageBlockEmbedded" TypePageBlockEmbeddedPost = "pageBlockEmbeddedPost" @@ -565,15 +595,20 @@ const ( TypeTextEntityTypeBotCommand = "textEntityTypeBotCommand" TypeTextEntityTypeUrl = "textEntityTypeUrl" TypeTextEntityTypeEmailAddress = "textEntityTypeEmailAddress" + TypeTextEntityTypePhoneNumber = "textEntityTypePhoneNumber" TypeTextEntityTypeBold = "textEntityTypeBold" TypeTextEntityTypeItalic = "textEntityTypeItalic" + TypeTextEntityTypeUnderline = "textEntityTypeUnderline" + TypeTextEntityTypeStrikethrough = "textEntityTypeStrikethrough" TypeTextEntityTypeCode = "textEntityTypeCode" TypeTextEntityTypePre = "textEntityTypePre" TypeTextEntityTypePreCode = "textEntityTypePreCode" TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl" TypeTextEntityTypeMentionName = "textEntityTypeMentionName" - TypeTextEntityTypePhoneNumber = "textEntityTypePhoneNumber" TypeInputThumbnail = "inputThumbnail" + TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate" + TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline" + TypeSendMessageOptions = "sendMessageOptions" TypeInputMessageText = "inputMessageText" TypeInputMessageAnimation = "inputMessageAnimation" TypeInputMessageAudio = "inputMessageAudio" @@ -704,8 +739,11 @@ const ( TypeChatEventUsernameChanged = "chatEventUsernameChanged" TypeChatEventPhotoChanged = "chatEventPhotoChanged" TypeChatEventInvitesToggled = "chatEventInvitesToggled" + TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" + TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" + TypeChatEventLocationChanged = "chatEventLocationChanged" TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" TypeChatEvent = "chatEvent" TypeChatEvents = "chatEvents" @@ -729,14 +767,20 @@ const ( TypeDeviceTokenBlackBerryPush = "deviceTokenBlackBerryPush" TypeDeviceTokenTizenPush = "deviceTokenTizenPush" TypePushReceiverId = "pushReceiverId" + TypeBackgroundFillSolid = "backgroundFillSolid" + TypeBackgroundFillGradient = "backgroundFillGradient" TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper" TypeBackgroundTypePattern = "backgroundTypePattern" - TypeBackgroundTypeSolid = "backgroundTypeSolid" + TypeBackgroundTypeFill = "backgroundTypeFill" TypeBackground = "background" TypeBackgrounds = "backgrounds" TypeInputBackgroundLocal = "inputBackgroundLocal" TypeInputBackgroundRemote = "inputBackgroundRemote" TypeHashtags = "hashtags" + TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" + TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" + TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" + TypeCanTransferOwnershipResultSessionTooFresh = "canTransferOwnershipResultSessionTooFresh" TypeCheckChatUsernameResultOk = "checkChatUsernameResultOk" TypeCheckChatUsernameResultUsernameInvalid = "checkChatUsernameResultUsernameInvalid" TypeCheckChatUsernameResultUsernameOccupied = "checkChatUsernameResultUsernameOccupied" @@ -792,27 +836,31 @@ const ( TypeUserPrivacySettingRuleAllowAll = "userPrivacySettingRuleAllowAll" TypeUserPrivacySettingRuleAllowContacts = "userPrivacySettingRuleAllowContacts" TypeUserPrivacySettingRuleAllowUsers = "userPrivacySettingRuleAllowUsers" + TypeUserPrivacySettingRuleAllowChatMembers = "userPrivacySettingRuleAllowChatMembers" TypeUserPrivacySettingRuleRestrictAll = "userPrivacySettingRuleRestrictAll" TypeUserPrivacySettingRuleRestrictContacts = "userPrivacySettingRuleRestrictContacts" TypeUserPrivacySettingRuleRestrictUsers = "userPrivacySettingRuleRestrictUsers" + TypeUserPrivacySettingRuleRestrictChatMembers = "userPrivacySettingRuleRestrictChatMembers" TypeUserPrivacySettingRules = "userPrivacySettingRules" TypeUserPrivacySettingShowStatus = "userPrivacySettingShowStatus" TypeUserPrivacySettingShowProfilePhoto = "userPrivacySettingShowProfilePhoto" TypeUserPrivacySettingShowLinkInForwardedMessages = "userPrivacySettingShowLinkInForwardedMessages" + TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" + TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber" TypeAccountTtl = "accountTtl" TypeSession = "session" TypeSessions = "sessions" TypeConnectedWebsite = "connectedWebsite" TypeConnectedWebsites = "connectedWebsites" - TypeChatReportSpamState = "chatReportSpamState" TypeChatReportReasonSpam = "chatReportReasonSpam" TypeChatReportReasonViolence = "chatReportReasonViolence" TypeChatReportReasonPornography = "chatReportReasonPornography" TypeChatReportReasonChildAbuse = "chatReportReasonChildAbuse" TypeChatReportReasonCopyright = "chatReportReasonCopyright" + TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation" TypeChatReportReasonCustom = "chatReportReasonCustom" TypePublicMessageLink = "publicMessageLink" TypeMessageLinkInfo = "messageLinkInfo" @@ -859,6 +907,7 @@ const ( TypeTopChatCategoryChannels = "topChatCategoryChannels" TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots" TypeTopChatCategoryCalls = "topChatCategoryCalls" + TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats" TypeTMeUrlTypeUser = "tMeUrlTypeUser" TypeTMeUrlTypeSupergroup = "tMeUrlTypeSupergroup" TypeTMeUrlTypeChatInvite = "tMeUrlTypeChatInvite" @@ -887,7 +936,9 @@ const ( TypeUpdateMessageViews = "updateMessageViews" TypeUpdateMessageContentOpened = "updateMessageContentOpened" TypeUpdateMessageMentionRead = "updateMessageMentionRead" + TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed" TypeUpdateNewChat = "updateNewChat" + TypeUpdateChatChatList = "updateChatChatList" TypeUpdateChatTitle = "updateChatTitle" TypeUpdateChatPhoto = "updateChatPhoto" TypeUpdateChatPermissions = "updateChatPermissions" @@ -896,12 +947,14 @@ const ( TypeUpdateChatIsPinned = "updateChatIsPinned" TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" TypeUpdateChatIsSponsored = "updateChatIsSponsored" + TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" TypeUpdateChatReadInbox = "updateChatReadInbox" TypeUpdateChatReadOutbox = "updateChatReadOutbox" TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" + TypeUpdateChatActionBar = "updateChatActionBar" TypeUpdateChatPinnedMessage = "updateChatPinnedMessage" TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" TypeUpdateChatDraftMessage = "updateChatDraftMessage" @@ -938,6 +991,7 @@ const ( TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" TypeUpdateTermsOfService = "updateTermsOfService" + TypeUpdateUsersNearby = "updateUsersNearby" TypeUpdateNewInlineQuery = "updateNewInlineQuery" TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult" TypeUpdateNewCallbackQuery = "updateNewCallbackQuery" @@ -947,6 +1001,7 @@ const ( TypeUpdateNewCustomEvent = "updateNewCustomEvent" TypeUpdateNewCustomQuery = "updateNewCustomQuery" TypeUpdatePoll = "updatePoll" + TypeUpdatePollAnswer = "updatePollAnswer" TypeUpdates = "updates" TypeLogStreamDefault = "logStreamDefault" TypeLogStreamFile = "logStreamFile" @@ -982,12 +1037,12 @@ type MaskPoint interface { MaskPointType() string } -// Represents the relationship between user A and user B. For incoming_link, user A is the current user; for outgoing_link, user B is the current user -type LinkState interface { - LinkStateType() string +// Describes the type of a poll +type PollType interface { + PollTypeType() string } -// Represents the type of the user. The following types are possible: regular users, deleted users and bots +// Represents the type of a user. The following types are possible: regular users, deleted users and bots type UserType interface { UserTypeType() string } @@ -1032,6 +1087,21 @@ type ChatType interface { ChatTypeType() string } +// Describes a list of chats +type ChatList interface { + ChatListType() string +} + +// Describes a type of public chats +type PublicChatType interface { + PublicChatTypeType() string +} + +// Describes actions which should be possible to do through a chat action bar +type ChatActionBar interface { + ChatActionBarType() string +} + // Describes a keyboard button type type KeyboardButtonType interface { KeyboardButtonTypeType() string @@ -1047,6 +1117,11 @@ type ReplyMarkup interface { ReplyMarkupType() string } +// Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl +type LoginUrlInfo interface { + LoginUrlInfoType() string +} + // Describes a text object inside an instant-view web page type RichText interface { RichTextType() string @@ -1107,6 +1182,11 @@ type TextEntityType interface { TextEntityTypeType() string } +// Contains information about the time when a scheduled message will be sent +type MessageSchedulingState interface { + MessageSchedulingStateType() string +} + // The content of a message to send type InputMessageContent interface { InputMessageContentType() string @@ -1172,7 +1252,12 @@ type DeviceToken interface { DeviceTokenType() string } -// Describes a type of a background +// Describes a fill of a background +type BackgroundFill interface { + BackgroundFillType() string +} + +// Describes the type of a background type BackgroundType interface { BackgroundTypeType() string } @@ -1182,6 +1267,11 @@ type InputBackground interface { InputBackgroundType() string } +// Represents result of checking whether the current session can be used to transfer a chat ownership to another user +type CanTransferOwnershipResult interface { + CanTransferOwnershipResultType() string +} + // Represents result of checking whether a username can be set for a chat type CheckChatUsernameResult interface { CheckChatUsernameResultType() string @@ -1197,7 +1287,7 @@ type NotificationType interface { NotificationTypeType() string } -// Describes type of notifications in the group +// Describes the type of notifications in a notification group type NotificationGroupType interface { NotificationGroupTypeType() string } @@ -1262,7 +1352,7 @@ type TextParseMode interface { TextParseModeType() string } -// Describes the type of the proxy server +// Describes the type of a proxy server type ProxyType interface { ProxyTypeType() string } @@ -1564,9 +1654,9 @@ func (*EmailAddressAuthenticationCodeInfo) GetType() string { // Represents a part of the text that needs to be formatted in some unusual way type TextEntity struct { meta - // Offset of the entity in UTF-16 code points + // Offset of the entity in UTF-16 code units Offset int32 `json:"offset"` - // Length of the entity, in UTF-16 code points + // Length of the entity, in UTF-16 code units Length int32 `json:"length"` // Type of the entity Type TextEntityType `json:"type"` @@ -1637,7 +1727,7 @@ type FormattedText struct { meta // The text Text string `json:"text"` - // Entities contained in the text + // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other Entities []*TextEntity `json:"entities"` } @@ -1662,7 +1752,7 @@ type TermsOfService struct { meta // Text of the terms of service Text *FormattedText `json:"text"` - // Minimum age of a user to be able to accept the terms; 0 if any + // The minimum age of a user to be able to accept the terms; 0 if any MinUserAge int32 `json:"min_user_age"` // True, if a blocking popup with terms of service must be shown to the user ShowPopup bool `json:"show_popup"` @@ -1736,7 +1826,7 @@ func (*AuthorizationStateWaitEncryptionKey) AuthorizationStateType() string { return TypeAuthorizationStateWaitEncryptionKey } -// TDLib needs the user's phone number to authorize +// TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options type AuthorizationStateWaitPhoneNumber struct { meta } @@ -1788,6 +1878,33 @@ func (*AuthorizationStateWaitCode) AuthorizationStateType() string { return TypeAuthorizationStateWaitCode } +// The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link +type AuthorizationStateWaitOtherDeviceConfirmation struct { + meta + // A tg:// URL for the QR code. The link will be updated frequently + Link string `json:"link"` +} + +func (entity *AuthorizationStateWaitOtherDeviceConfirmation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthorizationStateWaitOtherDeviceConfirmation + + return json.Marshal((*stub)(entity)) +} + +func (*AuthorizationStateWaitOtherDeviceConfirmation) GetClass() string { + return ClassAuthorizationState +} + +func (*AuthorizationStateWaitOtherDeviceConfirmation) GetType() string { + return TypeAuthorizationStateWaitOtherDeviceConfirmation +} + +func (*AuthorizationStateWaitOtherDeviceConfirmation) AuthorizationStateType() string { + return TypeAuthorizationStateWaitOtherDeviceConfirmation +} + // The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration type AuthorizationStateWaitRegistration struct { meta @@ -2065,8 +2182,10 @@ func (*LocalFile) GetType() string { // Represents a remote file type RemoteFile struct { meta - // Remote file identifier; may be empty. Can be used across application restarts or even from other devices for the current user. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the client with the HTTP URL in the original_path and "#url#" as the conversion string. Clients should generate the file by downloading it to the specified location + // Remote file identifier; may be empty. Can be used across application restarts or even from other devices for the current user. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the client with the HTTP URL in the original_path and "#url#" as the conversion string. Clients should generate the file by downloading it to the specified location 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"` // True, if the file is currently being uploaded (or a remote copy is being generated by some other means) IsUploadingActive bool `json:"is_uploading_active"` // True, if a remote copy is fully available @@ -2149,7 +2268,7 @@ func (*InputFileId) InputFileType() string { return TypeInputFileId } -// A file defined by its remote ID +// A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client type InputFileRemote struct { meta // Remote file identifier @@ -2473,6 +2592,60 @@ func (*PollOption) GetType() string { return TypePollOption } +// A regular poll +type PollTypeRegular struct { + meta + // True, if multiple answer options can be chosen simultaneously + AllowMultipleAnswers bool `json:"allow_multiple_answers"` +} + +func (entity *PollTypeRegular) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollTypeRegular + + return json.Marshal((*stub)(entity)) +} + +func (*PollTypeRegular) GetClass() string { + return ClassPollType +} + +func (*PollTypeRegular) GetType() string { + return TypePollTypeRegular +} + +func (*PollTypeRegular) PollTypeType() string { + return TypePollTypeRegular +} + +// A poll in quiz mode, which has exactly one correct answer option and can be answered only once +type PollTypeQuiz struct { + meta + // 0-based identifier of the correct answer option; -1 for a yet unanswered poll + CorrectOptionId int32 `json:"correct_option_id"` +} + +func (entity *PollTypeQuiz) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollTypeQuiz + + return json.Marshal((*stub)(entity)) +} + +func (*PollTypeQuiz) GetClass() string { + return ClassPollType +} + +func (*PollTypeQuiz) GetType() string { + return TypePollTypeQuiz +} + +func (*PollTypeQuiz) PollTypeType() string { + return TypePollTypeQuiz +} + // Describes an animation file. The animation must be encoded in GIF or MPEG4 format type Animation struct { meta @@ -2510,7 +2683,7 @@ func (*Animation) GetType() string { return TypeAnimation } -// Describes an audio file. Audio is usually in MP3 format +// Describes an audio file. Audio is usually in MP3 or M4A format type Audio struct { meta // Duration of the audio, in seconds; as defined by the sender @@ -2657,7 +2830,7 @@ type Video struct { FileName string `json:"file_name"` // MIME type of the file; as defined by the sender MimeType string `json:"mime_type"` - // True, if stickers were added to the photo + // True, if stickers were added to the video HasStickers bool `json:"has_stickers"` // True, if the video should be tried to be streamed SupportsStreaming bool `json:"supports_streaming"` @@ -2880,6 +3053,12 @@ type Poll struct { 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"` + // True, if the poll is anonymous + IsAnonymous bool `json:"is_anonymous"` + // Type of the poll + Type PollType `json:"type"` // True, if the poll is closed IsClosed bool `json:"is_closed"` } @@ -2900,6 +3079,37 @@ func (*Poll) GetType() string { return TypePoll } +func (poll *Poll) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Question string `json:"question"` + Options []*PollOption `json:"options"` + TotalVoterCount int32 `json:"total_voter_count"` + RecentVoterUserIds []int32 `json:"recent_voter_user_ids"` + IsAnonymous bool `json:"is_anonymous"` + Type json.RawMessage `json:"type"` + IsClosed bool `json:"is_closed"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + poll.Id = tmp.Id + poll.Question = tmp.Question + poll.Options = tmp.Options + poll.TotalVoterCount = tmp.TotalVoterCount + poll.RecentVoterUserIds = tmp.RecentVoterUserIds + poll.IsAnonymous = tmp.IsAnonymous + poll.IsClosed = tmp.IsClosed + + fieldType, _ := UnmarshalPollType(tmp.Type) + poll.Type = fieldType + + return nil +} + // Describes a user profile photo type ProfilePhoto struct { meta @@ -2952,81 +3162,6 @@ func (*ChatPhoto) GetType() string { return TypeChatPhoto } -// The phone number of user A is not known to user B -type LinkStateNone struct { - meta -} - -func (entity *LinkStateNone) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LinkStateNone - - return json.Marshal((*stub)(entity)) -} - -func (*LinkStateNone) GetClass() string { - return ClassLinkState -} - -func (*LinkStateNone) GetType() string { - return TypeLinkStateNone -} - -func (*LinkStateNone) LinkStateType() string { - return TypeLinkStateNone -} - -// The phone number of user A is known but that number has not been saved to the contact list of user B -type LinkStateKnowsPhoneNumber struct { - meta -} - -func (entity *LinkStateKnowsPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LinkStateKnowsPhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*LinkStateKnowsPhoneNumber) GetClass() string { - return ClassLinkState -} - -func (*LinkStateKnowsPhoneNumber) GetType() string { - return TypeLinkStateKnowsPhoneNumber -} - -func (*LinkStateKnowsPhoneNumber) LinkStateType() string { - return TypeLinkStateKnowsPhoneNumber -} - -// The phone number of user A has been saved to the contact list of user B -type LinkStateIsContact struct { - meta -} - -func (entity *LinkStateIsContact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LinkStateIsContact - - return json.Marshal((*stub)(entity)) -} - -func (*LinkStateIsContact) GetClass() string { - return ClassLinkState -} - -func (*LinkStateIsContact) GetType() string { - return TypeLinkStateIsContact -} - -func (*LinkStateIsContact) LinkStateType() string { - return TypeLinkStateIsContact -} - // A regular user type UserTypeRegular struct { meta @@ -3052,7 +3187,7 @@ func (*UserTypeRegular) UserTypeType() string { return TypeUserTypeRegular } -// A deleted user or deleted bot. No information on the user besides the user_id is available. It is not possible to perform any active actions on this type of user +// A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user type UserTypeDeleted struct { meta } @@ -3112,7 +3247,7 @@ func (*UserTypeBot) UserTypeType() string { return TypeUserTypeBot } -// No information on the user besides the user_id 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 +// 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 type UserTypeUnknown struct { meta } @@ -3187,6 +3322,31 @@ func (*BotInfo) GetType() string { return TypeBotInfo } +// Represents a location to which a chat is connected +type ChatLocation struct { + meta + // The location + Location *Location `json:"location"` + // Location address; 1-64 characters, as defined by the chat owner + Address string `json:"address"` +} + +func (entity *ChatLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatLocation + + return json.Marshal((*stub)(entity)) +} + +func (*ChatLocation) GetClass() string { + return ClassChatLocation +} + +func (*ChatLocation) GetType() string { + return TypeChatLocation +} + // Represents a user type User struct { meta @@ -3204,15 +3364,15 @@ type User struct { Status UserStatus `json:"status"` // Profile photo of the user; may be null ProfilePhoto *ProfilePhoto `json:"profile_photo"` - // Relationship from the current user to the other user - OutgoingLink LinkState `json:"outgoing_link"` - // Relationship from the other user to the current user - IncomingLink LinkState `json:"incoming_link"` + // The user is a contact of the current user + IsContact bool `json:"is_contact"` + // The user is a contact of the current user and the current user is a contact of the user + IsMutualContact bool `json:"is_mutual_contact"` // True, if the user is verified IsVerified bool `json:"is_verified"` // True, if the user is Telegram support account IsSupport bool `json:"is_support"` - // If non-empty, it contains the reason why access to this user must be restricted. The format of the string is "{type}: {description}". {type} contains the type of the restriction and at least one of the suffixes "-all", "-ios", "-android", or "-wp", which describe the platforms on which access should be restricted. (For example, "terms-ios-android". {description} contains a human-readable description of the restriction, which can be shown to the user) + // If non-empty, it contains a human-readable description of the reason why access to this user must be restricted RestrictionReason string `json:"restriction_reason"` // True, if many users reported this user as a scam IsScam bool `json:"is_scam"` @@ -3249,8 +3409,8 @@ func (user *User) UnmarshalJSON(data []byte) error { PhoneNumber string `json:"phone_number"` Status json.RawMessage `json:"status"` ProfilePhoto *ProfilePhoto `json:"profile_photo"` - OutgoingLink json.RawMessage `json:"outgoing_link"` - IncomingLink json.RawMessage `json:"incoming_link"` + IsContact bool `json:"is_contact"` + IsMutualContact bool `json:"is_mutual_contact"` IsVerified bool `json:"is_verified"` IsSupport bool `json:"is_support"` RestrictionReason string `json:"restriction_reason"` @@ -3271,6 +3431,8 @@ func (user *User) UnmarshalJSON(data []byte) error { user.Username = tmp.Username user.PhoneNumber = tmp.PhoneNumber user.ProfilePhoto = tmp.ProfilePhoto + user.IsContact = tmp.IsContact + user.IsMutualContact = tmp.IsMutualContact user.IsVerified = tmp.IsVerified user.IsSupport = tmp.IsSupport user.RestrictionReason = tmp.RestrictionReason @@ -3281,12 +3443,6 @@ func (user *User) UnmarshalJSON(data []byte) error { fieldStatus, _ := UnmarshalUserStatus(tmp.Status) user.Status = fieldStatus - fieldOutgoingLink, _ := UnmarshalLinkState(tmp.OutgoingLink) - user.OutgoingLink = fieldOutgoingLink - - fieldIncomingLink, _ := UnmarshalLinkState(tmp.IncomingLink) - user.IncomingLink = fieldIncomingLink - fieldType, _ := UnmarshalUserType(tmp.Type) user.Type = fieldType @@ -3302,6 +3458,8 @@ type UserFullInfo struct { CanBeCalled bool `json:"can_be_called"` // True, if the user can't be called due to their privacy settings HasPrivateCalls bool `json:"has_private_calls"` + // True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used + 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 @@ -3405,6 +3563,56 @@ func (*Users) GetType() string { return TypeUsers } +// Contains information about a chat administrator +type ChatAdministrator struct { + meta + // User identifier of the administrator + UserId int32 `json:"user_id"` + // Custom title of the administrator + CustomTitle string `json:"custom_title"` + // True, if the user is the owner of the chat + IsOwner bool `json:"is_owner"` +} + +func (entity *ChatAdministrator) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAdministrator + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAdministrator) GetClass() string { + return ClassChatAdministrator +} + +func (*ChatAdministrator) GetType() string { + return TypeChatAdministrator +} + +// Represents a list of chat administrators +type ChatAdministrators struct { + meta + // A list of chat administrators + Administrators []*ChatAdministrator `json:"administrators"` +} + +func (entity *ChatAdministrators) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAdministrators + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAdministrators) GetClass() string { + return ClassChatAdministrators +} + +func (*ChatAdministrators) GetType() string { + return TypeChatAdministrators +} + // Describes actions that a user is allowed to take in a chat type ChatPermissions struct { meta @@ -3442,9 +3650,11 @@ func (*ChatPermissions) GetType() string { return TypeChatPermissions } -// The user is the creator of a chat and has all the administrator privileges +// The user is the owner of a 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 + CustomTitle string `json:"custom_title"` // True, if the user is a member of the chat IsMember bool `json:"is_member"` } @@ -3472,6 +3682,8 @@ func (*ChatMemberStatusCreator) ChatMemberStatusType() string { // 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 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 change the chat title, photo, and other settings @@ -3488,7 +3700,7 @@ type ChatMemberStatusAdministrator struct { CanRestrictMembers bool `json:"can_restrict_members"` // True, if the administrator can pin messages; applicable to groups 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 him + // 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"` } @@ -3726,7 +3938,7 @@ func (*ChatMembersFilterContacts) ChatMembersFilterType() string { return TypeChatMembersFilterContacts } -// Returns the creator and administrators +// Returns the owner and administrators type ChatMembersFilterAdministrators struct { meta } @@ -3903,7 +4115,7 @@ func (*SupergroupMembersFilterContacts) SupergroupMembersFilterType() string { return TypeSupergroupMembersFilterContacts } -// Returns the creator and administrators +// Returns the owner and administrators type SupergroupMembersFilterAdministrators struct { meta } @@ -4099,7 +4311,7 @@ type BasicGroupFullInfo struct { CreatorUserId int32 `json:"creator_user_id"` // Group members Members []*ChatMember `json:"members"` - // Invite link for this group; available only for the group creator and only after it has been generated at least once + // 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"` } @@ -4128,17 +4340,23 @@ type Supergroup struct { 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 + // Status of the current user in the supergroup or channel; custom title will be always empty Status ChatMemberStatus `json:"status"` // Member count; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was found through SearchPublicChats 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 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 or channel is verified IsVerified bool `json:"is_verified"` - // If non-empty, contains the reason why access to this supergroup or channel must be restricted. Format of the string is "{type}: {description}". {type} Contains the type of the restriction and at least one of the suffixes "-all", "-ios", "-android", or "-wp", which describe the platforms on which access should be restricted. (For example, "terms-ios-android". {description} contains a human-readable description of the restriction, which can be shown to the user) + // 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 IsScam bool `json:"is_scam"` @@ -4167,7 +4385,10 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { Date int32 `json:"date"` Status json.RawMessage `json:"status"` MemberCount int32 `json:"member_count"` + HasLinkedChat bool `json:"has_linked_chat"` + HasLocation bool `json:"has_location"` SignMessages bool `json:"sign_messages"` + IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` IsChannel bool `json:"is_channel"` IsVerified bool `json:"is_verified"` RestrictionReason string `json:"restriction_reason"` @@ -4183,7 +4404,10 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { supergroup.Username = tmp.Username supergroup.Date = tmp.Date supergroup.MemberCount = tmp.MemberCount + supergroup.HasLinkedChat = tmp.HasLinkedChat + supergroup.HasLocation = tmp.HasLocation supergroup.SignMessages = tmp.SignMessages + supergroup.IsSlowModeEnabled = tmp.IsSlowModeEnabled supergroup.IsChannel = tmp.IsChannel supergroup.IsVerified = tmp.IsVerified supergroup.RestrictionReason = tmp.RestrictionReason @@ -4208,18 +4432,28 @@ type SupergroupFullInfo struct { RestrictedCount int32 `json:"restricted_count"` // Number of users banned from chat; 0 if unknown BannedCount int32 `json:"banned_count"` + // Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown + LinkedChatId int64 `json:"linked_chat_id"` + // Delay between consecutive sent messages for non-administrator supergroup members, in seconds + SlowModeDelay int32 `json:"slow_mode_delay"` + // Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero + SlowModeDelayExpiresIn float64 `json:"slow_mode_delay_expires_in"` // True, if members of the chat can be retrieved CanGetMembers bool `json:"can_get_members"` - // True, if the chat can be made public + // True, if the chat username can be changed CanSetUsername bool `json:"can_set_username"` // True, if the supergroup sticker set can be changed CanSetStickerSet bool `json:"can_set_sticker_set"` + // True, if the supergroup location can be changed + CanSetLocation bool `json:"can_set_location"` // True, if the channel statistics is available through getChatStatisticsUrl CanViewStatistics bool `json:"can_view_statistics"` - // True, if new chat members will have access to old messages. In public supergroups and both public and private channels, old messages are always available, so this option affects only private supergroups. The value of this field is only available for chat administrators + // True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators IsAllHistoryAvailable bool `json:"is_all_history_available"` // Identifier of the supergroup sticker set; 0 if none 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"` // Identifier of the basic group from which supergroup was upgraded; 0 if none @@ -4332,9 +4566,9 @@ type SecretChat struct { 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 bytes, which must be used to make a 12x12 square image with a color depth of 4. The first 16 bytes should be used to make a central 8x8 square, while the remaining 20 bytes should be used to construct a 2-pixel-wide border around that square. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers + // Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers KeyHash []byte `json:"key_hash"` - // Secret chat layer; determines features supported by the other client. Video notes are supported if the layer >= 66 + // Secret chat layer; determines features supported by the other client. Video notes are supported if the layer >= 66; nested text entities and underline and strikethrough entities are supported if the layer >= 101 Layer int32 `json:"layer"` } @@ -4475,9 +4709,9 @@ type MessageForwardInfo struct { Origin MessageForwardOrigin `json:"origin"` // Point in time (Unix timestamp) when the message was originally sent Date int32 `json:"date"` - // For messages forwarded to the chat with the current user (saved messages) or to the channel discussion supergroup, the identifier of the chat from which the message was forwarded last time; 0 if unknown + // For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown FromChatId int64 `json:"from_chat_id"` - // For messages forwarded to the chat with the current user (saved messages) or to the channel discussion supergroup, the identifier of the original message from which the new message was forwarded last time; 0 if unknown + // For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown FromMessageId int64 `json:"from_message_id"` } @@ -4589,9 +4823,11 @@ type Message struct { ChatId int64 `json:"chat_id"` // Information about 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 + SchedulingState MessageSchedulingState `json:"scheduling_state"` // True, if the message is outgoing IsOutgoing bool `json:"is_outgoing"` - // True, if the message can be edited. For live location and poll messages this fields shows, whether editMessageLiveLocation or stopPoll can be used with this message by the client + // True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the client CanBeEdited bool `json:"can_be_edited"` // True, if the message can be forwarded CanBeForwarded bool `json:"can_be_forwarded"` @@ -4623,6 +4859,8 @@ type Message struct { Views int32 `json:"views"` // Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums MediaAlbumId JsonInt64 `json:"media_album_id"` + // If non-empty, contains a human-readable description of the reason why access to this message must be restricted + RestrictionReason string `json:"restriction_reason"` // Content of the message Content MessageContent `json:"content"` // Reply markup for the message; may be null @@ -4651,6 +4889,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { SenderUserId int32 `json:"sender_user_id"` ChatId int64 `json:"chat_id"` SendingState json.RawMessage `json:"sending_state"` + SchedulingState json.RawMessage `json:"scheduling_state"` IsOutgoing bool `json:"is_outgoing"` CanBeEdited bool `json:"can_be_edited"` CanBeForwarded bool `json:"can_be_forwarded"` @@ -4668,6 +4907,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { AuthorSignature string `json:"author_signature"` Views int32 `json:"views"` MediaAlbumId JsonInt64 `json:"media_album_id"` + RestrictionReason string `json:"restriction_reason"` Content json.RawMessage `json:"content"` ReplyMarkup json.RawMessage `json:"reply_markup"` } @@ -4697,10 +4937,14 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.AuthorSignature = tmp.AuthorSignature message.Views = tmp.Views message.MediaAlbumId = tmp.MediaAlbumId + message.RestrictionReason = tmp.RestrictionReason fieldSendingState, _ := UnmarshalMessageSendingState(tmp.SendingState) message.SendingState = fieldSendingState + fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) + message.SchedulingState = fieldSchedulingState + fieldContent, _ := UnmarshalMessageContent(tmp.Content) message.Content = fieldContent @@ -5063,6 +5307,56 @@ func (*ChatTypeSecret) ChatTypeType() string { return TypeChatTypeSecret } +// A main list of chats +type ChatListMain struct { + meta +} + +func (entity *ChatListMain) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatListMain + + return json.Marshal((*stub)(entity)) +} + +func (*ChatListMain) GetClass() string { + return ClassChatList +} + +func (*ChatListMain) GetType() string { + return TypeChatListMain +} + +func (*ChatListMain) ChatListType() string { + return TypeChatListMain +} + +// A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives +type ChatListArchive struct { + meta +} + +func (entity *ChatListArchive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatListArchive + + return json.Marshal((*stub)(entity)) +} + +func (*ChatListArchive) GetClass() string { + return ClassChatList +} + +func (*ChatListArchive) GetType() string { + return TypeChatListArchive +} + +func (*ChatListArchive) ChatListType() string { + return TypeChatListArchive +} + // A chat. (Can be a private chat, basic group, supergroup, or secret chat) type Chat struct { meta @@ -5070,6 +5364,8 @@ type Chat struct { Id int64 `json:"id"` // Type of the chat Type ChatType `json:"type"` + // A chat list to which the chat belongs; may be null + ChatList ChatList `json:"chat_list"` // Chat title Title string `json:"title"` // Chat photo; may be null @@ -5086,6 +5382,8 @@ type Chat struct { IsMarkedAsUnread bool `json:"is_marked_as_unread"` // True, if the chat is sponsored by the user's MTProxy server IsSponsored bool `json:"is_sponsored"` + // True, if the chat has scheduled messages + HasScheduledMessages bool `json:"has_scheduled_messages"` // True, if the chat messages can be deleted only for the current user while other users will continue to see the messages CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` // True, if the chat messages can be deleted for all users @@ -5104,13 +5402,15 @@ 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 + ActionBar ChatActionBar `json:"action_bar"` // Identifier of the pinned message in the chat; 0 if none PinnedMessageId int64 `json:"pinned_message_id"` // Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat ReplyMarkupMessageId int64 `json:"reply_markup_message_id"` // A draft of a message in the chat; may be null DraftMessage *DraftMessage `json:"draft_message"` - // Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if a message database is used + // Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if the message database is used ClientData string `json:"client_data"` } @@ -5134,6 +5434,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { var tmp struct { Id int64 `json:"id"` Type json.RawMessage `json:"type"` + ChatList json.RawMessage `json:"chat_list"` Title string `json:"title"` Photo *ChatPhoto `json:"photo"` Permissions *ChatPermissions `json:"permissions"` @@ -5142,6 +5443,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { IsPinned bool `json:"is_pinned"` IsMarkedAsUnread bool `json:"is_marked_as_unread"` IsSponsored bool `json:"is_sponsored"` + HasScheduledMessages bool `json:"has_scheduled_messages"` CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` CanBeReported bool `json:"can_be_reported"` @@ -5151,6 +5453,7 @@ 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"` + ActionBar json.RawMessage `json:"action_bar"` PinnedMessageId int64 `json:"pinned_message_id"` ReplyMarkupMessageId int64 `json:"reply_markup_message_id"` DraftMessage *DraftMessage `json:"draft_message"` @@ -5171,6 +5474,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.IsPinned = tmp.IsPinned chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread chat.IsSponsored = tmp.IsSponsored + chat.HasScheduledMessages = tmp.HasScheduledMessages chat.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf chat.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers chat.CanBeReported = tmp.CanBeReported @@ -5188,6 +5492,12 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { fieldType, _ := UnmarshalChatType(tmp.Type) chat.Type = fieldType + fieldChatList, _ := UnmarshalChatList(tmp.ChatList) + chat.ChatList = fieldChatList + + fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) + chat.ActionBar = fieldActionBar + return nil } @@ -5214,6 +5524,56 @@ func (*Chats) GetType() string { return TypeChats } +// Describes a chat located nearby +type ChatNearby struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Distance to the chat location in meters + Distance int32 `json:"distance"` +} + +func (entity *ChatNearby) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatNearby + + return json.Marshal((*stub)(entity)) +} + +func (*ChatNearby) GetClass() string { + return ClassChatNearby +} + +func (*ChatNearby) GetType() string { + return TypeChatNearby +} + +// Represents a list of chats located nearby +type ChatsNearby struct { + meta + // List of users nearby + UsersNearby []*ChatNearby `json:"users_nearby"` + // List of location-based supergroups nearby + SupergroupsNearby []*ChatNearby `json:"supergroups_nearby"` +} + +func (entity *ChatsNearby) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatsNearby + + return json.Marshal((*stub)(entity)) +} + +func (*ChatsNearby) GetClass() string { + return ClassChatsNearby +} + +func (*ChatsNearby) GetType() string { + return TypeChatsNearby +} + // Contains a chat invite link type ChatInviteLink struct { meta @@ -5252,7 +5612,7 @@ type ChatInviteLinkInfo struct { 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 a channel with a username + // 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"` } @@ -5301,6 +5661,181 @@ func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { return nil } +// The chat is public, because it has username +type PublicChatTypeHasUsername struct { + meta +} + +func (entity *PublicChatTypeHasUsername) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicChatTypeHasUsername + + return json.Marshal((*stub)(entity)) +} + +func (*PublicChatTypeHasUsername) GetClass() string { + return ClassPublicChatType +} + +func (*PublicChatTypeHasUsername) GetType() string { + return TypePublicChatTypeHasUsername +} + +func (*PublicChatTypeHasUsername) PublicChatTypeType() string { + return TypePublicChatTypeHasUsername +} + +// The chat is public, because it is a location-based supergroup +type PublicChatTypeIsLocationBased struct { + meta +} + +func (entity *PublicChatTypeIsLocationBased) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicChatTypeIsLocationBased + + return json.Marshal((*stub)(entity)) +} + +func (*PublicChatTypeIsLocationBased) GetClass() string { + return ClassPublicChatType +} + +func (*PublicChatTypeIsLocationBased) GetType() string { + return TypePublicChatTypeIsLocationBased +} + +func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string { + return TypePublicChatTypeIsLocationBased +} + +// The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam +type ChatActionBarReportSpam struct { + meta +} + +func (entity *ChatActionBarReportSpam) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarReportSpam + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarReportSpam) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarReportSpam) GetType() string { + return TypeChatActionBarReportSpam +} + +func (*ChatActionBarReportSpam) ChatActionBarType() string { + return TypeChatActionBarReportSpam +} + +// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation +type ChatActionBarReportUnrelatedLocation struct { + meta +} + +func (entity *ChatActionBarReportUnrelatedLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarReportUnrelatedLocation + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarReportUnrelatedLocation) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarReportUnrelatedLocation) GetType() string { + return TypeChatActionBarReportUnrelatedLocation +} + +func (*ChatActionBarReportUnrelatedLocation) ChatActionBarType() string { + return TypeChatActionBarReportUnrelatedLocation +} + +// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be added to the contact list using the method addContact, or the other user can be blocked using the method blockUser +type ChatActionBarReportAddBlock struct { + meta +} + +func (entity *ChatActionBarReportAddBlock) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarReportAddBlock + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarReportAddBlock) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarReportAddBlock) GetType() string { + return TypeChatActionBarReportAddBlock +} + +func (*ChatActionBarReportAddBlock) ChatActionBarType() string { + return TypeChatActionBarReportAddBlock +} + +// The chat is a private or secret chat and the other user can be added to the contact list using the method addContact +type ChatActionBarAddContact struct { + meta +} + +func (entity *ChatActionBarAddContact) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarAddContact + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarAddContact) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarAddContact) GetType() string { + return TypeChatActionBarAddContact +} + +func (*ChatActionBarAddContact) ChatActionBarType() string { + return TypeChatActionBarAddContact +} + +// 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 +type ChatActionBarSharePhoneNumber struct { + meta +} + +func (entity *ChatActionBarSharePhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarSharePhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarSharePhoneNumber) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarSharePhoneNumber) GetType() string { + return TypeChatActionBarSharePhoneNumber +} + +func (*ChatActionBarSharePhoneNumber) ChatActionBarType() string { + return TypeChatActionBarSharePhoneNumber +} + // A simple button, with text that should be sent when the button is pressed type KeyboardButtonTypeText struct { meta @@ -5376,6 +5911,35 @@ func (*KeyboardButtonTypeRequestLocation) KeyboardButtonTypeType() string { return TypeKeyboardButtonTypeRequestLocation } +// A button that allows the user to create and send a poll when pressed; available only in private chats +type KeyboardButtonTypeRequestPoll struct { + meta + // If true, only regular polls must be allowed to create + ForceRegular bool `json:"force_regular"` + // If true, only polls in quiz mode must be allowed to create + ForceQuiz bool `json:"force_quiz"` +} + +func (entity *KeyboardButtonTypeRequestPoll) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeRequestPoll + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeRequestPoll) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeRequestPoll) GetType() string { + return TypeKeyboardButtonTypeRequestPoll +} + +func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeRequestPoll +} + // Represents a single button in a bot keyboard type KeyboardButton struct { meta @@ -5450,7 +6014,7 @@ func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string { // A button that opens a specified URL and automatically logs in in current user if they allowed to do that type InlineKeyboardButtonTypeLoginUrl struct { meta - // HTTP URL to open + // An HTTP URL to open Url string `json:"url"` // Unique button identifier Id int32 `json:"id"` @@ -5742,6 +6306,68 @@ func (*ReplyMarkupInlineKeyboard) ReplyMarkupType() string { return TypeReplyMarkupInlineKeyboard } +// An HTTP url needs to be open +type LoginUrlInfoOpen struct { + meta + // The URL to open + Url string `json:"url"` + // True, if there is no need to show an ordinary open URL confirm + SkipConfirm bool `json:"skip_confirm"` +} + +func (entity *LoginUrlInfoOpen) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LoginUrlInfoOpen + + return json.Marshal((*stub)(entity)) +} + +func (*LoginUrlInfoOpen) GetClass() string { + return ClassLoginUrlInfo +} + +func (*LoginUrlInfoOpen) GetType() string { + return TypeLoginUrlInfoOpen +} + +func (*LoginUrlInfoOpen) LoginUrlInfoType() string { + return TypeLoginUrlInfoOpen +} + +// An authorization confirmation dialog needs to be shown to the user +type LoginUrlInfoRequestConfirmation struct { + meta + // An HTTP URL to be opened + Url string `json:"url"` + // A domain of the URL + Domain string `json:"domain"` + // User identifier of a bot linked with the website + BotUserId int32 `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"` +} + +func (entity *LoginUrlInfoRequestConfirmation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LoginUrlInfoRequestConfirmation + + return json.Marshal((*stub)(entity)) +} + +func (*LoginUrlInfoRequestConfirmation) GetClass() string { + return ClassLoginUrlInfo +} + +func (*LoginUrlInfoRequestConfirmation) GetType() string { + return TypeLoginUrlInfoRequestConfirmation +} + +func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string { + return TypeLoginUrlInfoRequestConfirmation +} + // A plain text type RichTextPlain struct { meta @@ -5898,7 +6524,7 @@ func (richTextUnderline *RichTextUnderline) UnmarshalJSON(data []byte) error { return nil } -// A strike-through rich text +// A strikethrough rich text type RichTextStrikethrough struct { meta // Text @@ -5991,6 +6617,8 @@ type RichTextUrl struct { Text RichText `json:"text"` // URL Url string `json:"url"` + // True, if the URL has cached instant view server-side + IsCached bool `json:"is_cached"` } func (entity *RichTextUrl) MarshalJSON() ([]byte, error) { @@ -6015,8 +6643,9 @@ func (*RichTextUrl) RichTextType() string { func (richTextUrl *RichTextUrl) UnmarshalJSON(data []byte) error { var tmp struct { - Text json.RawMessage `json:"text"` - Url string `json:"url"` + Text json.RawMessage `json:"text"` + Url string `json:"url"` + IsCached bool `json:"is_cached"` } err := json.Unmarshal(data, &tmp) @@ -6025,6 +6654,7 @@ func (richTextUrl *RichTextUrl) UnmarshalJSON(data []byte) error { } richTextUrl.Url = tmp.Url + richTextUrl.IsCached = tmp.IsCached fieldText, _ := UnmarshalRichText(tmp.Text) richTextUrl.Text = fieldText @@ -6586,7 +7216,7 @@ func (*PageBlockVerticalAlignmentBottom) PageBlockVerticalAlignmentType() string // Represents a cell of a table type PageBlockTableCell struct { meta - // Cell text + // Cell text; may be null. If the text is null, then the cell should be invisible Text RichText `json:"text"` // True, if it is a header cell IsHeader bool `json:"is_header"` @@ -7378,6 +8008,35 @@ func (*PageBlockVideo) PageBlockType() string { return TypePageBlockVideo } +// A voice note +type PageBlockVoiceNote struct { + meta + // Voice note; may be null + VoiceNote *VoiceNote `json:"voice_note"` + // Voice note caption + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *PageBlockVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockVoiceNote) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockVoiceNote) GetType() string { + return TypePageBlockVoiceNote +} + +func (*PageBlockVoiceNote) PageBlockType() string { + return TypePageBlockVoiceNote +} + // A page cover type PageBlockCover struct { meta @@ -10434,7 +11093,7 @@ func (*MessageText) MessageContentType() string { // An animation message (GIF-style). type MessageAnimation struct { meta - // Message content + // The animation description Animation *Animation `json:"animation"` // Animation caption Caption *FormattedText `json:"caption"` @@ -10465,7 +11124,7 @@ func (*MessageAnimation) MessageContentType() string { // An audio message type MessageAudio struct { meta - // Message content + // The audio description Audio *Audio `json:"audio"` // Audio caption Caption *FormattedText `json:"caption"` @@ -10494,7 +11153,7 @@ func (*MessageAudio) MessageContentType() string { // A document message (general file) type MessageDocument struct { meta - // Message content + // The document description Document *Document `json:"document"` // Document caption Caption *FormattedText `json:"caption"` @@ -10523,7 +11182,7 @@ func (*MessageDocument) MessageContentType() string { // A photo message type MessagePhoto struct { meta - // Message content + // The photo description Photo *Photo `json:"photo"` // Photo caption Caption *FormattedText `json:"caption"` @@ -10579,7 +11238,7 @@ func (*MessageExpiredPhoto) MessageContentType() string { // A sticker message type MessageSticker struct { meta - // Message content + // The sticker description Sticker *Sticker `json:"sticker"` } @@ -10606,7 +11265,7 @@ func (*MessageSticker) MessageContentType() string { // A video message type MessageVideo struct { meta - // Message content + // The video description Video *Video `json:"video"` // Video caption Caption *FormattedText `json:"caption"` @@ -10662,7 +11321,7 @@ func (*MessageExpiredVideo) MessageContentType() string { // A video note message type MessageVideoNote struct { meta - // Message content + // The video note description VideoNote *VideoNote `json:"video_note"` // True, if at least one of the recipients has viewed the video note IsViewed bool `json:"is_viewed"` @@ -10693,7 +11352,7 @@ func (*MessageVideoNote) MessageContentType() string { // A voice note message type MessageVoiceNote struct { meta - // Message content + // The voice note description VoiceNote *VoiceNote `json:"voice_note"` // Voice note caption Caption *FormattedText `json:"caption"` @@ -10724,7 +11383,7 @@ func (*MessageVoiceNote) MessageContentType() string { // A message with a location type MessageLocation struct { meta - // Message content + // The location description Location *Location `json:"location"` // Time relative to the message sent date until which the location can be updated, in seconds LivePeriod int32 `json:"live_period"` @@ -10755,7 +11414,7 @@ func (*MessageLocation) MessageContentType() string { // A message with information about a venue type MessageVenue struct { meta - // Message content + // The venue description Venue *Venue `json:"venue"` } @@ -10782,7 +11441,7 @@ func (*MessageVenue) MessageContentType() string { // A message with a user contact type MessageContact struct { meta - // Message content + // The contact description Contact *Contact `json:"contact"` } @@ -10809,7 +11468,7 @@ func (*MessageContact) MessageContentType() string { // A message with a game type MessageGame struct { meta - // Game + // The game description Game *Game `json:"game"` } @@ -10836,7 +11495,7 @@ func (*MessageGame) MessageContentType() string { // A message with a poll type MessagePoll struct { meta - // Poll + // The poll description Poll *Poll `json:"poll"` } @@ -11713,6 +12372,31 @@ func (*TextEntityTypeEmailAddress) TextEntityTypeType() string { return TypeTextEntityTypeEmailAddress } +// A phone number +type TextEntityTypePhoneNumber struct { + meta +} + +func (entity *TextEntityTypePhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypePhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypePhoneNumber) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypePhoneNumber) GetType() string { + return TypeTextEntityTypePhoneNumber +} + +func (*TextEntityTypePhoneNumber) TextEntityTypeType() string { + return TypeTextEntityTypePhoneNumber +} + // A bold text type TextEntityTypeBold struct { meta @@ -11763,6 +12447,56 @@ func (*TextEntityTypeItalic) TextEntityTypeType() string { return TypeTextEntityTypeItalic } +// An underlined text +type TextEntityTypeUnderline struct { + meta +} + +func (entity *TextEntityTypeUnderline) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeUnderline + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeUnderline) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeUnderline) GetType() string { + return TypeTextEntityTypeUnderline +} + +func (*TextEntityTypeUnderline) TextEntityTypeType() string { + return TypeTextEntityTypeUnderline +} + +// A strikethrough text +type TextEntityTypeStrikethrough struct { + meta +} + +func (entity *TextEntityTypeStrikethrough) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeStrikethrough + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeStrikethrough) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeStrikethrough) GetType() string { + return TypeTextEntityTypeStrikethrough +} + +func (*TextEntityTypeStrikethrough) TextEntityTypeType() string { + return TypeTextEntityTypeStrikethrough +} + // Text that must be formatted as if inside a code HTML tag type TextEntityTypeCode struct { meta @@ -11894,31 +12628,6 @@ func (*TextEntityTypeMentionName) TextEntityTypeType() string { return TypeTextEntityTypeMentionName } -// A phone number -type TextEntityTypePhoneNumber struct { - meta -} - -func (entity *TextEntityTypePhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypePhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypePhoneNumber) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypePhoneNumber) GetType() string { - return TypeTextEntityTypePhoneNumber -} - -func (*TextEntityTypePhoneNumber) TextEntityTypeType() string { - return TypeTextEntityTypePhoneNumber -} - // A thumbnail to be sent along with a file; should be in JPEG or WEBP format for stickers, and less than 200 kB in size type InputThumbnail struct { meta @@ -11967,10 +12676,110 @@ func (inputThumbnail *InputThumbnail) UnmarshalJSON(data []byte) error { return nil } +// The message will be sent at the specified date +type MessageSchedulingStateSendAtDate struct { + meta + // Date the message will be sent. The date must be within 367 days in the future + SendDate int32 `json:"send_date"` +} + +func (entity *MessageSchedulingStateSendAtDate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSchedulingStateSendAtDate + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSchedulingStateSendAtDate) GetClass() string { + return ClassMessageSchedulingState +} + +func (*MessageSchedulingStateSendAtDate) GetType() string { + return TypeMessageSchedulingStateSendAtDate +} + +func (*MessageSchedulingStateSendAtDate) MessageSchedulingStateType() string { + return TypeMessageSchedulingStateSendAtDate +} + +// The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known +type MessageSchedulingStateSendWhenOnline struct { + meta +} + +func (entity *MessageSchedulingStateSendWhenOnline) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSchedulingStateSendWhenOnline + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSchedulingStateSendWhenOnline) GetClass() string { + return ClassMessageSchedulingState +} + +func (*MessageSchedulingStateSendWhenOnline) GetType() string { + return TypeMessageSchedulingStateSendWhenOnline +} + +func (*MessageSchedulingStateSendWhenOnline) MessageSchedulingStateType() string { + return TypeMessageSchedulingStateSendWhenOnline +} + +// Options to be used when a message is send +type SendMessageOptions struct { + meta + // Pass true to disable notification for the message. Must be false if the message is sent to a secret chat + 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 + SchedulingState MessageSchedulingState `json:"scheduling_state"` +} + +func (entity *SendMessageOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SendMessageOptions + + return json.Marshal((*stub)(entity)) +} + +func (*SendMessageOptions) GetClass() string { + return ClassSendMessageOptions +} + +func (*SendMessageOptions) GetType() string { + return TypeSendMessageOptions +} + +func (sendMessageOptions *SendMessageOptions) UnmarshalJSON(data []byte) error { + var tmp struct { + DisableNotification bool `json:"disable_notification"` + FromBackground bool `json:"from_background"` + SchedulingState json.RawMessage `json:"scheduling_state"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + sendMessageOptions.DisableNotification = tmp.DisableNotification + sendMessageOptions.FromBackground = tmp.FromBackground + + fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) + sendMessageOptions.SchedulingState = fieldSchedulingState + + return nil +} + // A text message type InputMessageText struct { meta - // Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Code, Pre, PreCode and TextUrl entities are allowed to be specified manually + // Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually Text *FormattedText `json:"text"` // True, if rich web page previews for URLs in the message text should be disabled DisableWebPagePreview bool `json:"disable_web_page_preview"` @@ -12495,7 +13304,7 @@ type InputMessageLocation struct { meta // Location to be sent Location *Location `json:"location"` - // Period for which the location can be updated, in seconds; should bebetween 60 and 86400 for a live location and 0 otherwise + // Period for which the location can be updated, in seconds; should be between 60 and 86400 for a live location and 0 otherwise LivePeriod int32 `json:"live_period"` } @@ -12649,13 +13458,19 @@ func (*InputMessageInvoice) InputMessageContentType() string { return TypeInputMessageInvoice } -// A message with a poll. Polls can't be sent to private or secret chats +// 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 Question string `json:"question"` // List of poll answer options, 2-10 strings 1-100 characters each Options []string `json:"options"` + // True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels + IsAnonymous bool `json:"is_anonymous"` + // Type of the poll + Type PollType `json:"type"` + // True, if the poll needs to be sent already closed; for bots only + IsClosed bool `json:"is_closed"` } func (entity *InputMessagePoll) MarshalJSON() ([]byte, error) { @@ -12678,6 +13493,31 @@ func (*InputMessagePoll) InputMessageContentType() string { return TypeInputMessagePoll } +func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { + var tmp struct { + Question string `json:"question"` + Options []string `json:"options"` + IsAnonymous bool `json:"is_anonymous"` + Type json.RawMessage `json:"type"` + IsClosed bool `json:"is_closed"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputMessagePoll.Question = tmp.Question + inputMessagePoll.Options = tmp.Options + inputMessagePoll.IsAnonymous = tmp.IsAnonymous + inputMessagePoll.IsClosed = tmp.IsClosed + + fieldType, _ := UnmarshalPollType(tmp.Type) + inputMessagePoll.Type = fieldType + + return nil +} + // A forwarded message type InputMessageForwarded struct { meta @@ -13895,9 +14735,9 @@ type CallProtocol struct { UdpP2p bool `json:"udp_p2p"` // True, if connection through UDP reflectors is supported UdpReflector bool `json:"udp_reflector"` - // Minimum supported API layer; use 65 + // The minimum supported API layer; use 65 MinLayer int32 `json:"min_layer"` - // Maximum supported API layer; use 65 + // The maximum supported API layer; use 65 MaxLayer int32 `json:"max_layer"` } @@ -15159,14 +15999,14 @@ func (inputInlineQueryResultPhoto *InputInlineQueryResultPhoto) UnmarshalJSON(da return nil } -// Represents a link to a WEBP or a TGS sticker +// Represents a link to a WEBP or TGS sticker type InputInlineQueryResultSticker struct { meta // Unique identifier of the query result Id string `json:"id"` // URL of the sticker thumbnail, if it exists ThumbnailUrl string `json:"thumbnail_url"` - // The URL of the WEBP or a TGS sticker (sticker file size must not exceed 5MB) + // The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB) StickerUrl string `json:"sticker_url"` // Width of the sticker StickerWidth int32 `json:"sticker_width"` @@ -16529,6 +17369,64 @@ func (*ChatEventInvitesToggled) ChatEventActionType() string { return TypeChatEventInvitesToggled } +// The linked chat of a supergroup was changed +type ChatEventLinkedChatChanged struct { + meta + // Previous supergroup linked chat identifier + OldLinkedChatId int64 `json:"old_linked_chat_id"` + // New supergroup linked chat identifier + NewLinkedChatId int64 `json:"new_linked_chat_id"` +} + +func (entity *ChatEventLinkedChatChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventLinkedChatChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventLinkedChatChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventLinkedChatChanged) GetType() string { + return TypeChatEventLinkedChatChanged +} + +func (*ChatEventLinkedChatChanged) ChatEventActionType() string { + return TypeChatEventLinkedChatChanged +} + +// The slow_mode_delay setting of a supergroup was changed +type ChatEventSlowModeDelayChanged struct { + meta + // Previous value of slow_mode_delay + OldSlowModeDelay int32 `json:"old_slow_mode_delay"` + // New value of slow_mode_delay + NewSlowModeDelay int32 `json:"new_slow_mode_delay"` +} + +func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventSlowModeDelayChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventSlowModeDelayChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventSlowModeDelayChanged) GetType() string { + return TypeChatEventSlowModeDelayChanged +} + +func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { + return TypeChatEventSlowModeDelayChanged +} + // The sign_messages setting of a channel was toggled type ChatEventSignMessagesToggled struct { meta @@ -16585,6 +17483,35 @@ func (*ChatEventStickerSetChanged) ChatEventActionType() string { return TypeChatEventStickerSetChanged } +// The supergroup location was changed +type ChatEventLocationChanged struct { + meta + // Previous location; may be null + OldLocation *ChatLocation `json:"old_location"` + // New location; may be null + NewLocation *ChatLocation `json:"new_location"` +} + +func (entity *ChatEventLocationChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventLocationChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventLocationChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventLocationChanged) GetType() string { + return TypeChatEventLocationChanged +} + +func (*ChatEventLocationChanged) ChatEventActionType() string { + return TypeChatEventLocationChanged +} + // The is_all_history_available setting of a supergroup was toggled type ChatEventIsAllHistoryAvailableToggled struct { meta @@ -17286,12 +18213,70 @@ func (*PushReceiverId) GetType() string { return TypePushReceiverId } +// Describes a solid fill of a background +type BackgroundFillSolid struct { + meta + // A color of the background in the RGB24 format + Color int32 `json:"color"` +} + +func (entity *BackgroundFillSolid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundFillSolid + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundFillSolid) GetClass() string { + return ClassBackgroundFill +} + +func (*BackgroundFillSolid) GetType() string { + return TypeBackgroundFillSolid +} + +func (*BackgroundFillSolid) BackgroundFillType() string { + return TypeBackgroundFillSolid +} + +// Describes a gradient fill of a background +type BackgroundFillGradient struct { + meta + // A top color of the background in the RGB24 format + 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 + RotationAngle int32 `json:"rotation_angle"` +} + +func (entity *BackgroundFillGradient) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundFillGradient + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundFillGradient) GetClass() string { + return ClassBackgroundFill +} + +func (*BackgroundFillGradient) GetType() string { + return TypeBackgroundFillGradient +} + +func (*BackgroundFillGradient) BackgroundFillType() string { + return TypeBackgroundFillGradient +} + // A wallpaper in JPEG format type BackgroundTypeWallpaper struct { meta // True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12 IsBlurred bool `json:"is_blurred"` - // True, if the background needs to be slightly moved when device is rotated + // True, if the background needs to be slightly moved when device is tilted IsMoving bool `json:"is_moving"` } @@ -17315,15 +18300,15 @@ func (*BackgroundTypeWallpaper) BackgroundTypeType() string { return TypeBackgroundTypeWallpaper } -// A PNG pattern to be combined with the color chosen by the user +// 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 - // True, if the background needs to be slightly moved when device is rotated - IsMoving bool `json:"is_moving"` - // Main color of the background in RGB24 format - Color int32 `json:"color"` - // Intensity of the pattern when it is shown above the main background color, 0-100 + // Description of the background fill + Fill BackgroundFill `json:"fill"` + // Intensity of the pattern when it is shown above the filled background, 0-100 Intensity int32 `json:"intensity"` + // True, if the background needs to be slightly moved when device is tilted + IsMoving bool `json:"is_moving"` } func (entity *BackgroundTypePattern) MarshalJSON() ([]byte, error) { @@ -17346,31 +18331,68 @@ func (*BackgroundTypePattern) BackgroundTypeType() string { return TypeBackgroundTypePattern } -// A solid background -type BackgroundTypeSolid struct { - meta - // A color of the background in RGB24 format - Color int32 `json:"color"` +func (backgroundTypePattern *BackgroundTypePattern) UnmarshalJSON(data []byte) error { + var tmp struct { + Fill json.RawMessage `json:"fill"` + Intensity int32 `json:"intensity"` + IsMoving bool `json:"is_moving"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + backgroundTypePattern.Intensity = tmp.Intensity + backgroundTypePattern.IsMoving = tmp.IsMoving + + fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill) + backgroundTypePattern.Fill = fieldFill + + return nil } -func (entity *BackgroundTypeSolid) MarshalJSON() ([]byte, error) { +// A filled background +type BackgroundTypeFill struct { + meta + // Description of the background fill + Fill BackgroundFill `json:"fill"` +} + +func (entity *BackgroundTypeFill) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub BackgroundTypeSolid + type stub BackgroundTypeFill return json.Marshal((*stub)(entity)) } -func (*BackgroundTypeSolid) GetClass() string { +func (*BackgroundTypeFill) GetClass() string { return ClassBackgroundType } -func (*BackgroundTypeSolid) GetType() string { - return TypeBackgroundTypeSolid +func (*BackgroundTypeFill) GetType() string { + return TypeBackgroundTypeFill } -func (*BackgroundTypeSolid) BackgroundTypeType() string { - return TypeBackgroundTypeSolid +func (*BackgroundTypeFill) BackgroundTypeType() string { + return TypeBackgroundTypeFill +} + +func (backgroundTypeFill *BackgroundTypeFill) UnmarshalJSON(data []byte) error { + var tmp struct { + Fill json.RawMessage `json:"fill"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill) + backgroundTypeFill.Fill = fieldFill + + return nil } // Describes a chat background @@ -17384,7 +18406,7 @@ type Background struct { IsDark bool `json:"is_dark"` // Unique background name Name string `json:"name"` - // Document with the background; may be null. Null only for solid backgrounds + // Document with the background; may be null. Null only for filled backgrounds Document *Document `json:"document"` // Type of the background Type BackgroundType `json:"type"` @@ -17459,7 +18481,7 @@ func (*Backgrounds) GetType() string { // A background from a local file type InputBackgroundLocal struct { meta - // Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file nust be in JPEG format for wallpapers and in PNG format for patterns + // Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file must be in JPEG format for wallpapers and in PNG format for patterns Background InputFile `json:"background"` } @@ -17549,6 +18571,110 @@ func (*Hashtags) GetType() string { return TypeHashtags } +// The session can be used +type CanTransferOwnershipResultOk struct { + meta +} + +func (entity *CanTransferOwnershipResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanTransferOwnershipResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*CanTransferOwnershipResultOk) GetClass() string { + return ClassCanTransferOwnershipResult +} + +func (*CanTransferOwnershipResultOk) GetType() string { + return TypeCanTransferOwnershipResultOk +} + +func (*CanTransferOwnershipResultOk) CanTransferOwnershipResultType() string { + return TypeCanTransferOwnershipResultOk +} + +// The 2-step verification needs to be enabled first +type CanTransferOwnershipResultPasswordNeeded struct { + meta +} + +func (entity *CanTransferOwnershipResultPasswordNeeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanTransferOwnershipResultPasswordNeeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanTransferOwnershipResultPasswordNeeded) GetClass() string { + return ClassCanTransferOwnershipResult +} + +func (*CanTransferOwnershipResultPasswordNeeded) GetType() string { + return TypeCanTransferOwnershipResultPasswordNeeded +} + +func (*CanTransferOwnershipResultPasswordNeeded) CanTransferOwnershipResultType() string { + return TypeCanTransferOwnershipResultPasswordNeeded +} + +// The 2-step verification was enabled recently, user needs to wait +type CanTransferOwnershipResultPasswordTooFresh struct { + meta + // Time left before the session can be used to transfer ownership of a chat, in seconds + RetryAfter int32 `json:"retry_after"` +} + +func (entity *CanTransferOwnershipResultPasswordTooFresh) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanTransferOwnershipResultPasswordTooFresh + + return json.Marshal((*stub)(entity)) +} + +func (*CanTransferOwnershipResultPasswordTooFresh) GetClass() string { + return ClassCanTransferOwnershipResult +} + +func (*CanTransferOwnershipResultPasswordTooFresh) GetType() string { + return TypeCanTransferOwnershipResultPasswordTooFresh +} + +func (*CanTransferOwnershipResultPasswordTooFresh) CanTransferOwnershipResultType() string { + return TypeCanTransferOwnershipResultPasswordTooFresh +} + +// The session was created recently, user needs to wait +type CanTransferOwnershipResultSessionTooFresh struct { + meta + // Time left before the session can be used to transfer ownership of a chat, in seconds + RetryAfter int32 `json:"retry_after"` +} + +func (entity *CanTransferOwnershipResultSessionTooFresh) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanTransferOwnershipResultSessionTooFresh + + return json.Marshal((*stub)(entity)) +} + +func (*CanTransferOwnershipResultSessionTooFresh) GetClass() string { + return ClassCanTransferOwnershipResult +} + +func (*CanTransferOwnershipResultSessionTooFresh) GetType() string { + return TypeCanTransferOwnershipResultSessionTooFresh +} + +func (*CanTransferOwnershipResultSessionTooFresh) CanTransferOwnershipResultType() string { + return TypeCanTransferOwnershipResultSessionTooFresh +} + // The username can be set type CheckChatUsernameResultOk struct { meta @@ -18000,6 +19126,8 @@ type PushMessageContentPoll struct { meta // Poll question Question string `json:"question"` + // True, if the poll is regular and not in quiz mode + IsRegular bool `json:"is_regular"` // True, if the message is a pinned message with the specified content IsPinned bool `json:"is_pinned"` } @@ -18232,7 +19360,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 himself + // True, if the user has returned to the group themself IsReturned bool `json:"is_returned"` } @@ -18315,7 +19443,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 himself + // True, if the user has left the group themself IsLeft bool `json:"is_left"` } @@ -18660,6 +19788,8 @@ type Notification struct { Id int32 `json:"id"` // Notification date Date int32 `json:"date"` + // True, if the notification was initially silent + IsSilent bool `json:"is_silent"` // Notification type Type NotificationType `json:"type"` } @@ -18682,9 +19812,10 @@ func (*Notification) GetType() string { func (notification *Notification) UnmarshalJSON(data []byte) error { var tmp struct { - Id int32 `json:"id"` - Date int32 `json:"date"` - Type json.RawMessage `json:"type"` + Id int32 `json:"id"` + Date int32 `json:"date"` + IsSilent bool `json:"is_silent"` + Type json.RawMessage `json:"type"` } err := json.Unmarshal(data, &tmp) @@ -18694,6 +19825,7 @@ func (notification *Notification) UnmarshalJSON(data []byte) error { notification.Id = tmp.Id notification.Date = tmp.Date + notification.IsSilent = tmp.IsSilent fieldType, _ := UnmarshalNotificationType(tmp.Type) notification.Type = fieldType @@ -19120,7 +20252,7 @@ func (*UserPrivacySettingRuleAllowContacts) UserPrivacySettingRuleType() string // A rule to allow certain specified users to do something type UserPrivacySettingRuleAllowUsers struct { meta - // The user identifiers + // The user identifiers, total number of users in all rules must not exceed 1000 UserIds []int32 `json:"user_ids"` } @@ -19144,6 +20276,33 @@ func (*UserPrivacySettingRuleAllowUsers) UserPrivacySettingRuleType() string { return TypeUserPrivacySettingRuleAllowUsers } +// A rule to allow all members of certain specified basic groups and supergroups to doing something +type UserPrivacySettingRuleAllowChatMembers struct { + meta + // The chat identifiers, total number of chats in all rules must not exceed 20 + ChatIds []int64 `json:"chat_ids"` +} + +func (entity *UserPrivacySettingRuleAllowChatMembers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingRuleAllowChatMembers + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingRuleAllowChatMembers) GetClass() string { + return ClassUserPrivacySettingRule +} + +func (*UserPrivacySettingRuleAllowChatMembers) GetType() string { + return TypeUserPrivacySettingRuleAllowChatMembers +} + +func (*UserPrivacySettingRuleAllowChatMembers) UserPrivacySettingRuleType() string { + return TypeUserPrivacySettingRuleAllowChatMembers +} + // A rule to restrict all users from doing something type UserPrivacySettingRuleRestrictAll struct { meta @@ -19197,7 +20356,7 @@ func (*UserPrivacySettingRuleRestrictContacts) UserPrivacySettingRuleType() stri // A rule to restrict all specified users from doing something type UserPrivacySettingRuleRestrictUsers struct { meta - // The user identifiers + // The user identifiers, total number of users in all rules must not exceed 1000 UserIds []int32 `json:"user_ids"` } @@ -19221,6 +20380,33 @@ func (*UserPrivacySettingRuleRestrictUsers) UserPrivacySettingRuleType() string return TypeUserPrivacySettingRuleRestrictUsers } +// A rule to restrict all members of specified basic groups and supergroups from doing something +type UserPrivacySettingRuleRestrictChatMembers struct { + meta + // The chat identifiers, total number of chats in all rules must not exceed 20 + ChatIds []int64 `json:"chat_ids"` +} + +func (entity *UserPrivacySettingRuleRestrictChatMembers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingRuleRestrictChatMembers + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingRuleRestrictChatMembers) GetClass() string { + return ClassUserPrivacySettingRule +} + +func (*UserPrivacySettingRuleRestrictChatMembers) GetType() string { + return TypeUserPrivacySettingRuleRestrictChatMembers +} + +func (*UserPrivacySettingRuleRestrictChatMembers) UserPrivacySettingRuleType() string { + return TypeUserPrivacySettingRuleRestrictChatMembers +} + // A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed type UserPrivacySettingRules struct { meta @@ -19319,6 +20505,31 @@ func (*UserPrivacySettingShowLinkInForwardedMessages) UserPrivacySettingType() s return TypeUserPrivacySettingShowLinkInForwardedMessages } +// A privacy setting for managing whether the user's phone number is visible +type UserPrivacySettingShowPhoneNumber struct { + meta +} + +func (entity *UserPrivacySettingShowPhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingShowPhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingShowPhoneNumber) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingShowPhoneNumber) GetType() string { + return TypeUserPrivacySettingShowPhoneNumber +} + +func (*UserPrivacySettingShowPhoneNumber) UserPrivacySettingType() string { + return TypeUserPrivacySettingShowPhoneNumber +} + // A privacy setting for managing whether the user can be invited to chats type UserPrivacySettingAllowChatInvites struct { meta @@ -19394,6 +20605,31 @@ func (*UserPrivacySettingAllowPeerToPeerCalls) UserPrivacySettingType() string { return TypeUserPrivacySettingAllowPeerToPeerCalls } +// A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all" +type UserPrivacySettingAllowFindingByPhoneNumber struct { + meta +} + +func (entity *UserPrivacySettingAllowFindingByPhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingAllowFindingByPhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingAllowFindingByPhoneNumber) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingAllowFindingByPhoneNumber) GetType() string { + return TypeUserPrivacySettingAllowFindingByPhoneNumber +} + +func (*UserPrivacySettingAllowFindingByPhoneNumber) UserPrivacySettingType() string { + return TypeUserPrivacySettingAllowFindingByPhoneNumber +} + // Contains information about the period of inactivity after which the current user's account will automatically be deleted type AccountTtl struct { meta @@ -19553,29 +20789,6 @@ func (*ConnectedWebsites) GetType() string { return TypeConnectedWebsites } -// Contains information about the availability of the "Report spam" action for a chat -type ChatReportSpamState struct { - meta - // True, if a prompt with the "Report spam" action should be shown to the user - CanReportSpam bool `json:"can_report_spam"` -} - -func (entity *ChatReportSpamState) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatReportSpamState - - return json.Marshal((*stub)(entity)) -} - -func (*ChatReportSpamState) GetClass() string { - return ClassChatReportSpamState -} - -func (*ChatReportSpamState) GetType() string { - return TypeChatReportSpamState -} - // The chat contains spam messages type ChatReportReasonSpam struct { meta @@ -19701,6 +20914,31 @@ func (*ChatReportReasonCopyright) ChatReportReasonType() string { return TypeChatReportReasonCopyright } +// The location-based chat is unrelated to its stated location +type ChatReportReasonUnrelatedLocation struct { + meta +} + +func (entity *ChatReportReasonUnrelatedLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatReportReasonUnrelatedLocation + + return json.Marshal((*stub)(entity)) +} + +func (*ChatReportReasonUnrelatedLocation) GetClass() string { + return ClassChatReportReason +} + +func (*ChatReportReasonUnrelatedLocation) GetType() string { + return TypeChatReportReasonUnrelatedLocation +} + +func (*ChatReportReasonUnrelatedLocation) ChatReportReasonType() string { + return TypeChatReportReasonUnrelatedLocation +} + // A custom reason provided by the user type ChatReportReasonCustom struct { meta @@ -19728,7 +20966,7 @@ func (*ChatReportReasonCustom) ChatReportReasonType() string { return TypeChatReportReasonCustom } -// Contains a public HTTPS link to a message in a public supergroup or channel with a username +// Contains a public HTTPS link to a message in a supergroup or channel with a username type PublicMessageLink struct { meta // Message link @@ -20632,12 +21870,14 @@ type AutoDownloadSettings struct { meta // True, if the auto-download is enabled IsAutoDownloadEnabled bool `json:"is_auto_download_enabled"` - // Maximum size of a photo file to be auto-downloaded + // The maximum size of a photo file to be auto-downloaded MaxPhotoFileSize int32 `json:"max_photo_file_size"` - // Maximum size of a video file to be auto-downloaded + // The maximum size of a video file to be auto-downloaded MaxVideoFileSize int32 `json:"max_video_file_size"` - // Maximum size of other file types to be auto-downloaded + // The maximum size of other file types to be auto-downloaded MaxOtherFileSize int32 `json:"max_other_file_size"` + // The maximum suggested bitrate for uploaded videos + VideoUploadBitrate int32 `json:"video_upload_bitrate"` // True, if the beginning of videos needs to be preloaded for instant playback PreloadLargeVideos bool `json:"preload_large_videos"` // True, if the next audio track needs to be preloaded while the user is listening to an audio file @@ -20964,6 +22204,31 @@ func (*TopChatCategoryCalls) TopChatCategoryType() string { return TypeTopChatCategoryCalls } +// A category containing frequently used chats used to forward messages +type TopChatCategoryForwardChats struct { + meta +} + +func (entity *TopChatCategoryForwardChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TopChatCategoryForwardChats + + return json.Marshal((*stub)(entity)) +} + +func (*TopChatCategoryForwardChats) GetClass() string { + return ClassTopChatCategory +} + +func (*TopChatCategoryForwardChats) GetType() string { + return TypeTopChatCategoryForwardChats +} + +func (*TopChatCategoryForwardChats) TopChatCategoryType() string { + return TypeTopChatCategoryForwardChats +} + // A URL linking to a user type TMeUrlTypeUser struct { meta @@ -21236,6 +22501,8 @@ func (*DeepLinkInfo) GetType() string { // The text should be parsed in markdown-style type TextParseModeMarkdown struct { meta + // Version of the parser: 0 or 1 - Bot API Markdown parse mode, 2 - Bot API MarkdownV2 parse mode + Version int32 `json:"version"` } func (entity *TextParseModeMarkdown) MarshalJSON() ([]byte, error) { @@ -21861,6 +23128,35 @@ func (*UpdateMessageMentionRead) UpdateType() string { return TypeUpdateMessageMentionRead } +// A message with a live location was viewed. When the update is received, the client is supposed to update the live location +type UpdateMessageLiveLocationViewed struct { + meta + // Identifier of the chat with the live location message + ChatId int64 `json:"chat_id"` + // Identifier of the message with live location + MessageId int64 `json:"message_id"` +} + +func (entity *UpdateMessageLiveLocationViewed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateMessageLiveLocationViewed + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateMessageLiveLocationViewed) GetClass() string { + return ClassUpdate +} + +func (*UpdateMessageLiveLocationViewed) GetType() string { + return TypeUpdateMessageLiveLocationViewed +} + +func (*UpdateMessageLiveLocationViewed) UpdateType() string { + return TypeUpdateMessageLiveLocationViewed +} + // A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the client. The chat field changes will be reported through separate updates type UpdateNewChat struct { meta @@ -21888,6 +23184,54 @@ func (*UpdateNewChat) UpdateType() string { return TypeUpdateNewChat } +// The list to which the chat belongs was changed. This update is guaranteed to be sent only when chat.order == 0 and the current or the new chat list is null +type UpdateChatChatList struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat's chat list; may be null + ChatList ChatList `json:"chat_list"` +} + +func (entity *UpdateChatChatList) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatChatList + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatChatList) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatChatList) GetType() string { + return TypeUpdateChatChatList +} + +func (*UpdateChatChatList) UpdateType() string { + return TypeUpdateChatChatList +} + +func (updateChatChatList *UpdateChatChatList) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + ChatList json.RawMessage `json:"chat_list"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatChatList.ChatId = tmp.ChatId + + fieldChatList, _ := UnmarshalChatList(tmp.ChatList) + updateChatChatList.ChatList = fieldChatList + + return nil +} + // The title of a chat was changed type UpdateChatTitle struct { meta @@ -21975,7 +23319,7 @@ func (*UpdateChatPermissions) UpdateType() string { return TypeUpdateChatPermissions } -// The last message of a chat was changed. If last_message is null then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case +// The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case type UpdateChatLastMessage struct { meta // Chat identifier @@ -22006,7 +23350,7 @@ func (*UpdateChatLastMessage) UpdateType() string { return TypeUpdateChatLastMessage } -// The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned or updateChatDraftMessage might be sent +// The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned, updateChatDraftMessage, or updateChatIsSponsored might be sent type UpdateChatOrder struct { meta // Chat identifier @@ -22126,6 +23470,35 @@ func (*UpdateChatIsSponsored) UpdateType() string { return TypeUpdateChatIsSponsored } +// 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 @@ -22321,6 +23694,54 @@ func (updateScopeNotificationSettings *UpdateScopeNotificationSettings) Unmarsha return nil } +// The chat action bar was changed +type UpdateChatActionBar struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new value of the action bar; may be null + ActionBar ChatActionBar `json:"action_bar"` +} + +func (entity *UpdateChatActionBar) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatActionBar + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatActionBar) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatActionBar) GetType() string { + return TypeUpdateChatActionBar +} + +func (*UpdateChatActionBar) UpdateType() string { + return TypeUpdateChatActionBar +} + +func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + ActionBar json.RawMessage `json:"action_bar"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatActionBar.ChatId = tmp.ChatId + + fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) + updateChatActionBar.ActionBar = fieldActionBar + + return nil +} + // The chat pinned message was changed type UpdateChatPinnedMessage struct { meta @@ -22540,7 +23961,7 @@ func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byt return nil } -// Contains active notifications that was shown on previous application launches. This update is sent only if a message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update +// Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update type UpdateActiveNotifications struct { meta // Lists of active notification groups @@ -22567,7 +23988,7 @@ func (*UpdateActiveNotifications) UpdateType() string { return TypeUpdateActiveNotifications } -// Describes, whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications +// Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications type UpdateHavePendingNotifications struct { meta // True, if there are some delayed notification updates, which will be sent soon @@ -23134,9 +24555,11 @@ func (updateUserPrivacySettingRules *UpdateUserPrivacySettingRules) UnmarshalJSO return nil } -// Number of unread messages has changed. This update is sent only if a message database is used +// Number of unread messages in a chat list has changed. This update is sent only if the message database is used type UpdateUnreadMessageCount struct { meta + // The chat list with changed number of unread messages + ChatList ChatList `json:"chat_list"` // Total number of unread messages UnreadCount int32 `json:"unread_count"` // Total number of unread messages in unmuted chats @@ -23163,9 +24586,34 @@ func (*UpdateUnreadMessageCount) UpdateType() string { return TypeUpdateUnreadMessageCount } -// Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if a message database is used +func (updateUnreadMessageCount *UpdateUnreadMessageCount) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatList json.RawMessage `json:"chat_list"` + UnreadCount int32 `json:"unread_count"` + UnreadUnmutedCount int32 `json:"unread_unmuted_count"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateUnreadMessageCount.UnreadCount = tmp.UnreadCount + updateUnreadMessageCount.UnreadUnmutedCount = tmp.UnreadUnmutedCount + + fieldChatList, _ := UnmarshalChatList(tmp.ChatList) + updateUnreadMessageCount.ChatList = fieldChatList + + return nil +} + +// Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used type UpdateUnreadChatCount struct { meta + // The chat list with changed number of unread messages + ChatList ChatList `json:"chat_list"` + // Approximate total number of chats in the chat list + TotalCount int32 `json:"total_count"` // Total number of unread chats UnreadCount int32 `json:"unread_count"` // Total number of unread unmuted chats @@ -23196,6 +24644,33 @@ func (*UpdateUnreadChatCount) UpdateType() string { return TypeUpdateUnreadChatCount } +func (updateUnreadChatCount *UpdateUnreadChatCount) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatList json.RawMessage `json:"chat_list"` + TotalCount int32 `json:"total_count"` + UnreadCount int32 `json:"unread_count"` + UnreadUnmutedCount int32 `json:"unread_unmuted_count"` + MarkedAsUnreadCount int32 `json:"marked_as_unread_count"` + MarkedAsUnreadUnmutedCount int32 `json:"marked_as_unread_unmuted_count"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateUnreadChatCount.TotalCount = tmp.TotalCount + updateUnreadChatCount.UnreadCount = tmp.UnreadCount + updateUnreadChatCount.UnreadUnmutedCount = tmp.UnreadUnmutedCount + updateUnreadChatCount.MarkedAsUnreadCount = tmp.MarkedAsUnreadCount + updateUnreadChatCount.MarkedAsUnreadUnmutedCount = tmp.MarkedAsUnreadUnmutedCount + + fieldChatList, _ := UnmarshalChatList(tmp.ChatList) + updateUnreadChatCount.ChatList = fieldChatList + + return nil +} + // An option changed its value type UpdateOption struct { meta @@ -23515,6 +24990,33 @@ func (*UpdateTermsOfService) UpdateType() string { return TypeUpdateTermsOfService } +// List of users nearby has changed. The update is sent only 60 seconds after a successful searchChatsNearby request +type UpdateUsersNearby struct { + meta + // The new list of users nearby + UsersNearby []*ChatNearby `json:"users_nearby"` +} + +func (entity *UpdateUsersNearby) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateUsersNearby + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateUsersNearby) GetClass() string { + return ClassUpdate +} + +func (*UpdateUsersNearby) GetType() string { + return TypeUpdateUsersNearby +} + +func (*UpdateUsersNearby) UpdateType() string { + return TypeUpdateUsersNearby +} + // A new incoming inline query; for bots only type UpdateNewInlineQuery struct { meta @@ -23592,7 +25094,7 @@ type UpdateNewCallbackQuery struct { Id JsonInt64 `json:"id"` // Identifier of the user who sent the query SenderUserId int32 `json:"sender_user_id"` - // Identifier of the chat, in which the query was sent + // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` // Identifier of the message, from which the query originated MessageId int64 `json:"message_id"` @@ -23839,7 +25341,7 @@ func (*UpdateNewCustomQuery) UpdateType() string { return TypeUpdateNewCustomQuery } -// Information about a poll was updated; for bots only +// A poll was updated; for bots only type UpdatePoll struct { meta // New data about the poll @@ -23866,6 +25368,37 @@ func (*UpdatePoll) UpdateType() string { return TypeUpdatePoll } +// A user changed the answer to a poll; for bots only +type UpdatePollAnswer struct { + meta + // Unique poll identifier + PollId JsonInt64 `json:"poll_id"` + // The user, who changed the answer to the poll + UserId int32 `json:"user_id"` + // 0-based identifiers of answer options, chosen by the user + OptionIds []int32 `json:"option_ids"` +} + +func (entity *UpdatePollAnswer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdatePollAnswer + + return json.Marshal((*stub)(entity)) +} + +func (*UpdatePollAnswer) GetClass() string { + return ClassUpdate +} + +func (*UpdatePollAnswer) GetType() string { + return TypeUpdatePollAnswer +} + +func (*UpdatePollAnswer) UpdateType() string { + return TypeUpdatePollAnswer +} + // Contains a list of updates type Updates struct { meta @@ -23919,7 +25452,7 @@ type LogStreamFile struct { meta // Path to the file to where the internal TDLib log will be written Path string `json:"path"` - // 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 be auto-rotated MaxFileSize int64 `json:"max_file_size"` } diff --git a/client/unmarshaler.go b/client/unmarshaler.go index be755c0..8488255 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -54,6 +54,9 @@ func UnmarshalAuthorizationState(data json.RawMessage) (AuthorizationState, erro case TypeAuthorizationStateWaitCode: return UnmarshalAuthorizationStateWaitCode(data) + case TypeAuthorizationStateWaitOtherDeviceConfirmation: + return UnmarshalAuthorizationStateWaitOtherDeviceConfirmation(data) + case TypeAuthorizationStateWaitRegistration: return UnmarshalAuthorizationStateWaitRegistration(data) @@ -129,7 +132,7 @@ func UnmarshalMaskPoint(data json.RawMessage) (MaskPoint, error) { } } -func UnmarshalLinkState(data json.RawMessage) (LinkState, error) { +func UnmarshalPollType(data json.RawMessage) (PollType, error) { var meta meta err := json.Unmarshal(data, &meta) @@ -138,14 +141,11 @@ func UnmarshalLinkState(data json.RawMessage) (LinkState, error) { } switch meta.Type { - case TypeLinkStateNone: - return UnmarshalLinkStateNone(data) + case TypePollTypeRegular: + return UnmarshalPollTypeRegular(data) - case TypeLinkStateKnowsPhoneNumber: - return UnmarshalLinkStateKnowsPhoneNumber(data) - - case TypeLinkStateIsContact: - return UnmarshalLinkStateIsContact(data) + case TypePollTypeQuiz: + return UnmarshalPollTypeQuiz(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -392,6 +392,75 @@ func UnmarshalChatType(data json.RawMessage) (ChatType, error) { } } +func UnmarshalChatList(data json.RawMessage) (ChatList, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatListMain: + return UnmarshalChatListMain(data) + + case TypeChatListArchive: + return UnmarshalChatListArchive(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalPublicChatType(data json.RawMessage) (PublicChatType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePublicChatTypeHasUsername: + return UnmarshalPublicChatTypeHasUsername(data) + + case TypePublicChatTypeIsLocationBased: + return UnmarshalPublicChatTypeIsLocationBased(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalChatActionBar(data json.RawMessage) (ChatActionBar, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatActionBarReportSpam: + return UnmarshalChatActionBarReportSpam(data) + + case TypeChatActionBarReportUnrelatedLocation: + return UnmarshalChatActionBarReportUnrelatedLocation(data) + + case TypeChatActionBarReportAddBlock: + return UnmarshalChatActionBarReportAddBlock(data) + + case TypeChatActionBarAddContact: + return UnmarshalChatActionBarAddContact(data) + + case TypeChatActionBarSharePhoneNumber: + return UnmarshalChatActionBarSharePhoneNumber(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, error) { var meta meta @@ -410,6 +479,9 @@ func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, erro case TypeKeyboardButtonTypeRequestLocation: return UnmarshalKeyboardButtonTypeRequestLocation(data) + case TypeKeyboardButtonTypeRequestPoll: + return UnmarshalKeyboardButtonTypeRequestPoll(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -473,6 +545,26 @@ func UnmarshalReplyMarkup(data json.RawMessage) (ReplyMarkup, error) { } } +func UnmarshalLoginUrlInfo(data json.RawMessage) (LoginUrlInfo, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeLoginUrlInfoOpen: + return UnmarshalLoginUrlInfoOpen(data) + + case TypeLoginUrlInfoRequestConfirmation: + return UnmarshalLoginUrlInfoRequestConfirmation(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + func UnmarshalRichText(data json.RawMessage) (RichText, error) { var meta meta @@ -641,6 +733,9 @@ func UnmarshalPageBlock(data json.RawMessage) (PageBlock, error) { case TypePageBlockVideo: return UnmarshalPageBlockVideo(data) + case TypePageBlockVoiceNote: + return UnmarshalPageBlockVoiceNote(data) + case TypePageBlockCover: return UnmarshalPageBlockCover(data) @@ -1104,12 +1199,21 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypeEmailAddress: return UnmarshalTextEntityTypeEmailAddress(data) + case TypeTextEntityTypePhoneNumber: + return UnmarshalTextEntityTypePhoneNumber(data) + case TypeTextEntityTypeBold: return UnmarshalTextEntityTypeBold(data) case TypeTextEntityTypeItalic: return UnmarshalTextEntityTypeItalic(data) + case TypeTextEntityTypeUnderline: + return UnmarshalTextEntityTypeUnderline(data) + + case TypeTextEntityTypeStrikethrough: + return UnmarshalTextEntityTypeStrikethrough(data) + case TypeTextEntityTypeCode: return UnmarshalTextEntityTypeCode(data) @@ -1125,8 +1229,25 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypeMentionName: return UnmarshalTextEntityTypeMentionName(data) - case TypeTextEntityTypePhoneNumber: - return UnmarshalTextEntityTypePhoneNumber(data) + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalMessageSchedulingState(data json.RawMessage) (MessageSchedulingState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageSchedulingStateSendAtDate: + return UnmarshalMessageSchedulingStateSendAtDate(data) + + case TypeMessageSchedulingStateSendWhenOnline: + return UnmarshalMessageSchedulingStateSendWhenOnline(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -1618,12 +1739,21 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventInvitesToggled: return UnmarshalChatEventInvitesToggled(data) + case TypeChatEventLinkedChatChanged: + return UnmarshalChatEventLinkedChatChanged(data) + + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) + case TypeChatEventSignMessagesToggled: return UnmarshalChatEventSignMessagesToggled(data) case TypeChatEventStickerSetChanged: return UnmarshalChatEventStickerSetChanged(data) + case TypeChatEventLocationChanged: + return UnmarshalChatEventLocationChanged(data) + case TypeChatEventIsAllHistoryAvailableToggled: return UnmarshalChatEventIsAllHistoryAvailableToggled(data) @@ -1702,6 +1832,26 @@ func UnmarshalDeviceToken(data json.RawMessage) (DeviceToken, error) { } } +func UnmarshalBackgroundFill(data json.RawMessage) (BackgroundFill, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBackgroundFillSolid: + return UnmarshalBackgroundFillSolid(data) + + case TypeBackgroundFillGradient: + return UnmarshalBackgroundFillGradient(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + func UnmarshalBackgroundType(data json.RawMessage) (BackgroundType, error) { var meta meta @@ -1717,8 +1867,8 @@ func UnmarshalBackgroundType(data json.RawMessage) (BackgroundType, error) { case TypeBackgroundTypePattern: return UnmarshalBackgroundTypePattern(data) - case TypeBackgroundTypeSolid: - return UnmarshalBackgroundTypeSolid(data) + case TypeBackgroundTypeFill: + return UnmarshalBackgroundTypeFill(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -1745,6 +1895,32 @@ func UnmarshalInputBackground(data json.RawMessage) (InputBackground, error) { } } +func UnmarshalCanTransferOwnershipResult(data json.RawMessage) (CanTransferOwnershipResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCanTransferOwnershipResultOk: + return UnmarshalCanTransferOwnershipResultOk(data) + + case TypeCanTransferOwnershipResultPasswordNeeded: + return UnmarshalCanTransferOwnershipResultPasswordNeeded(data) + + case TypeCanTransferOwnershipResultPasswordTooFresh: + return UnmarshalCanTransferOwnershipResultPasswordTooFresh(data) + + case TypeCanTransferOwnershipResultSessionTooFresh: + return UnmarshalCanTransferOwnershipResultSessionTooFresh(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + func UnmarshalCheckChatUsernameResult(data json.RawMessage) (CheckChatUsernameResult, error) { var meta meta @@ -1994,6 +2170,9 @@ func UnmarshalUserPrivacySettingRule(data json.RawMessage) (UserPrivacySettingRu case TypeUserPrivacySettingRuleAllowUsers: return UnmarshalUserPrivacySettingRuleAllowUsers(data) + case TypeUserPrivacySettingRuleAllowChatMembers: + return UnmarshalUserPrivacySettingRuleAllowChatMembers(data) + case TypeUserPrivacySettingRuleRestrictAll: return UnmarshalUserPrivacySettingRuleRestrictAll(data) @@ -2003,6 +2182,9 @@ func UnmarshalUserPrivacySettingRule(data json.RawMessage) (UserPrivacySettingRu case TypeUserPrivacySettingRuleRestrictUsers: return UnmarshalUserPrivacySettingRuleRestrictUsers(data) + case TypeUserPrivacySettingRuleRestrictChatMembers: + return UnmarshalUserPrivacySettingRuleRestrictChatMembers(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2026,6 +2208,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro case TypeUserPrivacySettingShowLinkInForwardedMessages: return UnmarshalUserPrivacySettingShowLinkInForwardedMessages(data) + case TypeUserPrivacySettingShowPhoneNumber: + return UnmarshalUserPrivacySettingShowPhoneNumber(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -2035,6 +2220,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro case TypeUserPrivacySettingAllowPeerToPeerCalls: return UnmarshalUserPrivacySettingAllowPeerToPeerCalls(data) + case TypeUserPrivacySettingAllowFindingByPhoneNumber: + return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2064,6 +2252,9 @@ func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { case TypeChatReportReasonCopyright: return UnmarshalChatReportReasonCopyright(data) + case TypeChatReportReasonUnrelatedLocation: + return UnmarshalChatReportReasonUnrelatedLocation(data) + case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) @@ -2239,6 +2430,9 @@ func UnmarshalTopChatCategory(data json.RawMessage) (TopChatCategory, error) { case TypeTopChatCategoryCalls: return UnmarshalTopChatCategoryCalls(data) + case TypeTopChatCategoryForwardChats: + return UnmarshalTopChatCategoryForwardChats(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2352,9 +2546,15 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(data) + case TypeUpdateMessageLiveLocationViewed: + return UnmarshalUpdateMessageLiveLocationViewed(data) + case TypeUpdateNewChat: return UnmarshalUpdateNewChat(data) + case TypeUpdateChatChatList: + return UnmarshalUpdateChatChatList(data) + case TypeUpdateChatTitle: return UnmarshalUpdateChatTitle(data) @@ -2379,6 +2579,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatIsSponsored: return UnmarshalUpdateChatIsSponsored(data) + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(data) + case TypeUpdateChatDefaultDisableNotification: return UnmarshalUpdateChatDefaultDisableNotification(data) @@ -2397,6 +2600,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateScopeNotificationSettings: return UnmarshalUpdateScopeNotificationSettings(data) + case TypeUpdateChatActionBar: + return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatPinnedMessage: return UnmarshalUpdateChatPinnedMessage(data) @@ -2505,6 +2711,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateTermsOfService: return UnmarshalUpdateTermsOfService(data) + case TypeUpdateUsersNearby: + return UnmarshalUpdateUsersNearby(data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(data) @@ -2532,6 +2741,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdatePoll: return UnmarshalUpdatePoll(data) + case TypeUpdatePollAnswer: + return UnmarshalUpdatePollAnswer(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2696,6 +2908,14 @@ func UnmarshalAuthorizationStateWaitCode(data json.RawMessage) (*AuthorizationSt return &resp, err } +func UnmarshalAuthorizationStateWaitOtherDeviceConfirmation(data json.RawMessage) (*AuthorizationStateWaitOtherDeviceConfirmation, error) { + var resp AuthorizationStateWaitOtherDeviceConfirmation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAuthorizationStateWaitRegistration(data json.RawMessage) (*AuthorizationStateWaitRegistration, error) { var resp AuthorizationStateWaitRegistration @@ -2888,6 +3108,22 @@ func UnmarshalPollOption(data json.RawMessage) (*PollOption, error) { return &resp, err } +func UnmarshalPollTypeRegular(data json.RawMessage) (*PollTypeRegular, error) { + var resp PollTypeRegular + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPollTypeQuiz(data json.RawMessage) (*PollTypeQuiz, error) { + var resp PollTypeQuiz + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAnimation(data json.RawMessage) (*Animation, error) { var resp Animation @@ -3008,30 +3244,6 @@ func UnmarshalChatPhoto(data json.RawMessage) (*ChatPhoto, error) { return &resp, err } -func UnmarshalLinkStateNone(data json.RawMessage) (*LinkStateNone, error) { - var resp LinkStateNone - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLinkStateKnowsPhoneNumber(data json.RawMessage) (*LinkStateKnowsPhoneNumber, error) { - var resp LinkStateKnowsPhoneNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLinkStateIsContact(data json.RawMessage) (*LinkStateIsContact, error) { - var resp LinkStateIsContact - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUserTypeRegular(data json.RawMessage) (*UserTypeRegular, error) { var resp UserTypeRegular @@ -3080,6 +3292,14 @@ func UnmarshalBotInfo(data json.RawMessage) (*BotInfo, error) { return &resp, err } +func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { + var resp ChatLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUser(data json.RawMessage) (*User, error) { var resp User @@ -3120,6 +3340,22 @@ func UnmarshalUsers(data json.RawMessage) (*Users, error) { return &resp, err } +func UnmarshalChatAdministrator(data json.RawMessage) (*ChatAdministrator, error) { + var resp ChatAdministrator + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAdministrators(data json.RawMessage) (*ChatAdministrators, error) { + var resp ChatAdministrators + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { var resp ChatPermissions @@ -3512,6 +3748,22 @@ func UnmarshalChatTypeSecret(data json.RawMessage) (*ChatTypeSecret, error) { return &resp, err } +func UnmarshalChatListMain(data json.RawMessage) (*ChatListMain, error) { + var resp ChatListMain + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatListArchive(data json.RawMessage) (*ChatListArchive, error) { + var resp ChatListArchive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChat(data json.RawMessage) (*Chat, error) { var resp Chat @@ -3528,6 +3780,22 @@ func UnmarshalChats(data json.RawMessage) (*Chats, error) { return &resp, err } +func UnmarshalChatNearby(data json.RawMessage) (*ChatNearby, error) { + var resp ChatNearby + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatsNearby(data json.RawMessage) (*ChatsNearby, error) { + var resp ChatsNearby + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatInviteLink(data json.RawMessage) (*ChatInviteLink, error) { var resp ChatInviteLink @@ -3544,6 +3812,62 @@ func UnmarshalChatInviteLinkInfo(data json.RawMessage) (*ChatInviteLinkInfo, err return &resp, err } +func UnmarshalPublicChatTypeHasUsername(data json.RawMessage) (*PublicChatTypeHasUsername, error) { + var resp PublicChatTypeHasUsername + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPublicChatTypeIsLocationBased(data json.RawMessage) (*PublicChatTypeIsLocationBased, error) { + var resp PublicChatTypeIsLocationBased + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarReportSpam(data json.RawMessage) (*ChatActionBarReportSpam, error) { + var resp ChatActionBarReportSpam + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarReportUnrelatedLocation(data json.RawMessage) (*ChatActionBarReportUnrelatedLocation, error) { + var resp ChatActionBarReportUnrelatedLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarReportAddBlock(data json.RawMessage) (*ChatActionBarReportAddBlock, error) { + var resp ChatActionBarReportAddBlock + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarAddContact(data json.RawMessage) (*ChatActionBarAddContact, error) { + var resp ChatActionBarAddContact + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarSharePhoneNumber(data json.RawMessage) (*ChatActionBarSharePhoneNumber, error) { + var resp ChatActionBarSharePhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButtonTypeText(data json.RawMessage) (*KeyboardButtonTypeText, error) { var resp KeyboardButtonTypeText @@ -3568,6 +3892,14 @@ func UnmarshalKeyboardButtonTypeRequestLocation(data json.RawMessage) (*Keyboard return &resp, err } +func UnmarshalKeyboardButtonTypeRequestPoll(data json.RawMessage) (*KeyboardButtonTypeRequestPoll, error) { + var resp KeyboardButtonTypeRequestPoll + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButton(data json.RawMessage) (*KeyboardButton, error) { var resp KeyboardButton @@ -3664,6 +3996,22 @@ func UnmarshalReplyMarkupInlineKeyboard(data json.RawMessage) (*ReplyMarkupInlin return &resp, err } +func UnmarshalLoginUrlInfoOpen(data json.RawMessage) (*LoginUrlInfoOpen, error) { + var resp LoginUrlInfoOpen + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLoginUrlInfoRequestConfirmation(data json.RawMessage) (*LoginUrlInfoRequestConfirmation, error) { + var resp LoginUrlInfoRequestConfirmation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { var resp RichTextPlain @@ -4008,6 +4356,14 @@ func UnmarshalPageBlockVideo(data json.RawMessage) (*PageBlockVideo, error) { return &resp, err } +func UnmarshalPageBlockVoiceNote(data json.RawMessage) (*PageBlockVoiceNote, error) { + var resp PageBlockVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPageBlockCover(data json.RawMessage) (*PageBlockCover, error) { var resp PageBlockCover @@ -5176,6 +5532,14 @@ func UnmarshalTextEntityTypeEmailAddress(data json.RawMessage) (*TextEntityTypeE return &resp, err } +func UnmarshalTextEntityTypePhoneNumber(data json.RawMessage) (*TextEntityTypePhoneNumber, error) { + var resp TextEntityTypePhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeBold(data json.RawMessage) (*TextEntityTypeBold, error) { var resp TextEntityTypeBold @@ -5192,6 +5556,22 @@ func UnmarshalTextEntityTypeItalic(data json.RawMessage) (*TextEntityTypeItalic, return &resp, err } +func UnmarshalTextEntityTypeUnderline(data json.RawMessage) (*TextEntityTypeUnderline, error) { + var resp TextEntityTypeUnderline + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeStrikethrough(data json.RawMessage) (*TextEntityTypeStrikethrough, error) { + var resp TextEntityTypeStrikethrough + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeCode(data json.RawMessage) (*TextEntityTypeCode, error) { var resp TextEntityTypeCode @@ -5232,16 +5612,32 @@ func UnmarshalTextEntityTypeMentionName(data json.RawMessage) (*TextEntityTypeMe return &resp, err } -func UnmarshalTextEntityTypePhoneNumber(data json.RawMessage) (*TextEntityTypePhoneNumber, error) { - var resp TextEntityTypePhoneNumber +func UnmarshalInputThumbnail(data json.RawMessage) (*InputThumbnail, error) { + var resp InputThumbnail err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalInputThumbnail(data json.RawMessage) (*InputThumbnail, error) { - var resp InputThumbnail +func UnmarshalMessageSchedulingStateSendAtDate(data json.RawMessage) (*MessageSchedulingStateSendAtDate, error) { + var resp MessageSchedulingStateSendAtDate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSchedulingStateSendWhenOnline(data json.RawMessage) (*MessageSchedulingStateSendWhenOnline, error) { + var resp MessageSchedulingStateSendWhenOnline + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSendMessageOptions(data json.RawMessage) (*SendMessageOptions, error) { + var resp SendMessageOptions err := json.Unmarshal(data, &resp) @@ -6288,6 +6684,22 @@ func UnmarshalChatEventInvitesToggled(data json.RawMessage) (*ChatEventInvitesTo return &resp, err } +func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinkedChatChanged, error) { + var resp ChatEventLinkedChatChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { + var resp ChatEventSlowModeDelayChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) { var resp ChatEventSignMessagesToggled @@ -6304,6 +6716,14 @@ func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventSticke return &resp, err } +func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocationChanged, error) { + var resp ChatEventLocationChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*ChatEventIsAllHistoryAvailableToggled, error) { var resp ChatEventIsAllHistoryAvailableToggled @@ -6488,6 +6908,22 @@ func UnmarshalPushReceiverId(data json.RawMessage) (*PushReceiverId, error) { return &resp, err } +func UnmarshalBackgroundFillSolid(data json.RawMessage) (*BackgroundFillSolid, error) { + var resp BackgroundFillSolid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBackgroundFillGradient(data json.RawMessage) (*BackgroundFillGradient, error) { + var resp BackgroundFillGradient + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBackgroundTypeWallpaper(data json.RawMessage) (*BackgroundTypeWallpaper, error) { var resp BackgroundTypeWallpaper @@ -6504,8 +6940,8 @@ func UnmarshalBackgroundTypePattern(data json.RawMessage) (*BackgroundTypePatter return &resp, err } -func UnmarshalBackgroundTypeSolid(data json.RawMessage) (*BackgroundTypeSolid, error) { - var resp BackgroundTypeSolid +func UnmarshalBackgroundTypeFill(data json.RawMessage) (*BackgroundTypeFill, error) { + var resp BackgroundTypeFill err := json.Unmarshal(data, &resp) @@ -6552,6 +6988,38 @@ func UnmarshalHashtags(data json.RawMessage) (*Hashtags, error) { return &resp, err } +func UnmarshalCanTransferOwnershipResultOk(data json.RawMessage) (*CanTransferOwnershipResultOk, error) { + var resp CanTransferOwnershipResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanTransferOwnershipResultPasswordNeeded(data json.RawMessage) (*CanTransferOwnershipResultPasswordNeeded, error) { + var resp CanTransferOwnershipResultPasswordNeeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanTransferOwnershipResultPasswordTooFresh(data json.RawMessage) (*CanTransferOwnershipResultPasswordTooFresh, error) { + var resp CanTransferOwnershipResultPasswordTooFresh + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanTransferOwnershipResultSessionTooFresh(data json.RawMessage) (*CanTransferOwnershipResultSessionTooFresh, error) { + var resp CanTransferOwnershipResultSessionTooFresh + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCheckChatUsernameResultOk(data json.RawMessage) (*CheckChatUsernameResultOk, error) { var resp CheckChatUsernameResultOk @@ -6992,6 +7460,14 @@ func UnmarshalUserPrivacySettingRuleAllowUsers(data json.RawMessage) (*UserPriva return &resp, err } +func UnmarshalUserPrivacySettingRuleAllowChatMembers(data json.RawMessage) (*UserPrivacySettingRuleAllowChatMembers, error) { + var resp UserPrivacySettingRuleAllowChatMembers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingRuleRestrictAll(data json.RawMessage) (*UserPrivacySettingRuleRestrictAll, error) { var resp UserPrivacySettingRuleRestrictAll @@ -7016,6 +7492,14 @@ func UnmarshalUserPrivacySettingRuleRestrictUsers(data json.RawMessage) (*UserPr return &resp, err } +func UnmarshalUserPrivacySettingRuleRestrictChatMembers(data json.RawMessage) (*UserPrivacySettingRuleRestrictChatMembers, error) { + var resp UserPrivacySettingRuleRestrictChatMembers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingRules(data json.RawMessage) (*UserPrivacySettingRules, error) { var resp UserPrivacySettingRules @@ -7048,6 +7532,14 @@ func UnmarshalUserPrivacySettingShowLinkInForwardedMessages(data json.RawMessage return &resp, err } +func UnmarshalUserPrivacySettingShowPhoneNumber(data json.RawMessage) (*UserPrivacySettingShowPhoneNumber, error) { + var resp UserPrivacySettingShowPhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingAllowChatInvites(data json.RawMessage) (*UserPrivacySettingAllowChatInvites, error) { var resp UserPrivacySettingAllowChatInvites @@ -7072,6 +7564,14 @@ func UnmarshalUserPrivacySettingAllowPeerToPeerCalls(data json.RawMessage) (*Use return &resp, err } +func UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data json.RawMessage) (*UserPrivacySettingAllowFindingByPhoneNumber, error) { + var resp UserPrivacySettingAllowFindingByPhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAccountTtl(data json.RawMessage) (*AccountTtl, error) { var resp AccountTtl @@ -7112,14 +7612,6 @@ func UnmarshalConnectedWebsites(data json.RawMessage) (*ConnectedWebsites, error return &resp, err } -func UnmarshalChatReportSpamState(data json.RawMessage) (*ChatReportSpamState, error) { - var resp ChatReportSpamState - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatReportReasonSpam(data json.RawMessage) (*ChatReportReasonSpam, error) { var resp ChatReportReasonSpam @@ -7160,6 +7652,14 @@ func UnmarshalChatReportReasonCopyright(data json.RawMessage) (*ChatReportReason return &resp, err } +func UnmarshalChatReportReasonUnrelatedLocation(data json.RawMessage) (*ChatReportReasonUnrelatedLocation, error) { + var resp ChatReportReasonUnrelatedLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCustom, error) { var resp ChatReportReasonCustom @@ -7528,6 +8028,14 @@ func UnmarshalTopChatCategoryCalls(data json.RawMessage) (*TopChatCategoryCalls, return &resp, err } +func UnmarshalTopChatCategoryForwardChats(data json.RawMessage) (*TopChatCategoryForwardChats, error) { + var resp TopChatCategoryForwardChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTMeUrlTypeUser(data json.RawMessage) (*TMeUrlTypeUser, error) { var resp TMeUrlTypeUser @@ -7752,6 +8260,14 @@ func UnmarshalUpdateMessageMentionRead(data json.RawMessage) (*UpdateMessageMent return &resp, err } +func UnmarshalUpdateMessageLiveLocationViewed(data json.RawMessage) (*UpdateMessageLiveLocationViewed, error) { + var resp UpdateMessageLiveLocationViewed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNewChat(data json.RawMessage) (*UpdateNewChat, error) { var resp UpdateNewChat @@ -7760,6 +8276,14 @@ func UnmarshalUpdateNewChat(data json.RawMessage) (*UpdateNewChat, error) { return &resp, err } +func UnmarshalUpdateChatChatList(data json.RawMessage) (*UpdateChatChatList, error) { + var resp UpdateChatChatList + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatTitle(data json.RawMessage) (*UpdateChatTitle, error) { var resp UpdateChatTitle @@ -7824,6 +8348,14 @@ func UnmarshalUpdateChatIsSponsored(data json.RawMessage) (*UpdateChatIsSponsore 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 @@ -7872,6 +8404,14 @@ func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScop return &resp, err } +func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, error) { + var resp UpdateChatActionBar + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatPinnedMessage(data json.RawMessage) (*UpdateChatPinnedMessage, error) { var resp UpdateChatPinnedMessage @@ -8160,6 +8700,14 @@ func UnmarshalUpdateTermsOfService(data json.RawMessage) (*UpdateTermsOfService, return &resp, err } +func UnmarshalUpdateUsersNearby(data json.RawMessage) (*UpdateUsersNearby, error) { + var resp UpdateUsersNearby + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNewInlineQuery(data json.RawMessage) (*UpdateNewInlineQuery, error) { var resp UpdateNewInlineQuery @@ -8232,6 +8780,14 @@ func UnmarshalUpdatePoll(data json.RawMessage) (*UpdatePoll, error) { return &resp, err } +func UnmarshalUpdatePollAnswer(data json.RawMessage) (*UpdatePollAnswer, error) { + var resp UpdatePollAnswer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdates(data json.RawMessage) (*Updates, error) { var resp Updates @@ -8396,6 +8952,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAuthorizationStateWaitCode: return UnmarshalAuthorizationStateWaitCode(data) + case TypeAuthorizationStateWaitOtherDeviceConfirmation: + return UnmarshalAuthorizationStateWaitOtherDeviceConfirmation(data) + case TypeAuthorizationStateWaitRegistration: return UnmarshalAuthorizationStateWaitRegistration(data) @@ -8468,6 +9027,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePollOption: return UnmarshalPollOption(data) + case TypePollTypeRegular: + return UnmarshalPollTypeRegular(data) + + case TypePollTypeQuiz: + return UnmarshalPollTypeQuiz(data) + case TypeAnimation: return UnmarshalAnimation(data) @@ -8513,15 +9078,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatPhoto: return UnmarshalChatPhoto(data) - case TypeLinkStateNone: - return UnmarshalLinkStateNone(data) - - case TypeLinkStateKnowsPhoneNumber: - return UnmarshalLinkStateKnowsPhoneNumber(data) - - case TypeLinkStateIsContact: - return UnmarshalLinkStateIsContact(data) - case TypeUserTypeRegular: return UnmarshalUserTypeRegular(data) @@ -8540,6 +9096,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBotInfo: return UnmarshalBotInfo(data) + case TypeChatLocation: + return UnmarshalChatLocation(data) + case TypeUser: return UnmarshalUser(data) @@ -8555,6 +9114,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUsers: return UnmarshalUsers(data) + case TypeChatAdministrator: + return UnmarshalChatAdministrator(data) + + case TypeChatAdministrators: + return UnmarshalChatAdministrators(data) + case TypeChatPermissions: return UnmarshalChatPermissions(data) @@ -8702,18 +9267,51 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatTypeSecret: return UnmarshalChatTypeSecret(data) + case TypeChatListMain: + return UnmarshalChatListMain(data) + + case TypeChatListArchive: + return UnmarshalChatListArchive(data) + case TypeChat: return UnmarshalChat(data) case TypeChats: return UnmarshalChats(data) + case TypeChatNearby: + return UnmarshalChatNearby(data) + + case TypeChatsNearby: + return UnmarshalChatsNearby(data) + case TypeChatInviteLink: return UnmarshalChatInviteLink(data) case TypeChatInviteLinkInfo: return UnmarshalChatInviteLinkInfo(data) + case TypePublicChatTypeHasUsername: + return UnmarshalPublicChatTypeHasUsername(data) + + case TypePublicChatTypeIsLocationBased: + return UnmarshalPublicChatTypeIsLocationBased(data) + + case TypeChatActionBarReportSpam: + return UnmarshalChatActionBarReportSpam(data) + + case TypeChatActionBarReportUnrelatedLocation: + return UnmarshalChatActionBarReportUnrelatedLocation(data) + + case TypeChatActionBarReportAddBlock: + return UnmarshalChatActionBarReportAddBlock(data) + + case TypeChatActionBarAddContact: + return UnmarshalChatActionBarAddContact(data) + + case TypeChatActionBarSharePhoneNumber: + return UnmarshalChatActionBarSharePhoneNumber(data) + case TypeKeyboardButtonTypeText: return UnmarshalKeyboardButtonTypeText(data) @@ -8723,6 +9321,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeKeyboardButtonTypeRequestLocation: return UnmarshalKeyboardButtonTypeRequestLocation(data) + case TypeKeyboardButtonTypeRequestPoll: + return UnmarshalKeyboardButtonTypeRequestPoll(data) + case TypeKeyboardButton: return UnmarshalKeyboardButton(data) @@ -8759,6 +9360,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeReplyMarkupInlineKeyboard: return UnmarshalReplyMarkupInlineKeyboard(data) + case TypeLoginUrlInfoOpen: + return UnmarshalLoginUrlInfoOpen(data) + + case TypeLoginUrlInfoRequestConfirmation: + return UnmarshalLoginUrlInfoRequestConfirmation(data) + case TypeRichTextPlain: return UnmarshalRichTextPlain(data) @@ -8888,6 +9495,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePageBlockVideo: return UnmarshalPageBlockVideo(data) + case TypePageBlockVoiceNote: + return UnmarshalPageBlockVoiceNote(data) + case TypePageBlockCover: return UnmarshalPageBlockCover(data) @@ -9326,12 +9936,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypeEmailAddress: return UnmarshalTextEntityTypeEmailAddress(data) + case TypeTextEntityTypePhoneNumber: + return UnmarshalTextEntityTypePhoneNumber(data) + case TypeTextEntityTypeBold: return UnmarshalTextEntityTypeBold(data) case TypeTextEntityTypeItalic: return UnmarshalTextEntityTypeItalic(data) + case TypeTextEntityTypeUnderline: + return UnmarshalTextEntityTypeUnderline(data) + + case TypeTextEntityTypeStrikethrough: + return UnmarshalTextEntityTypeStrikethrough(data) + case TypeTextEntityTypeCode: return UnmarshalTextEntityTypeCode(data) @@ -9347,12 +9966,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypeMentionName: return UnmarshalTextEntityTypeMentionName(data) - case TypeTextEntityTypePhoneNumber: - return UnmarshalTextEntityTypePhoneNumber(data) - case TypeInputThumbnail: return UnmarshalInputThumbnail(data) + case TypeMessageSchedulingStateSendAtDate: + return UnmarshalMessageSchedulingStateSendAtDate(data) + + case TypeMessageSchedulingStateSendWhenOnline: + return UnmarshalMessageSchedulingStateSendWhenOnline(data) + + case TypeSendMessageOptions: + return UnmarshalSendMessageOptions(data) + case TypeInputMessageText: return UnmarshalInputMessageText(data) @@ -9743,12 +10368,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventInvitesToggled: return UnmarshalChatEventInvitesToggled(data) + case TypeChatEventLinkedChatChanged: + return UnmarshalChatEventLinkedChatChanged(data) + + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) + case TypeChatEventSignMessagesToggled: return UnmarshalChatEventSignMessagesToggled(data) case TypeChatEventStickerSetChanged: return UnmarshalChatEventStickerSetChanged(data) + case TypeChatEventLocationChanged: + return UnmarshalChatEventLocationChanged(data) + case TypeChatEventIsAllHistoryAvailableToggled: return UnmarshalChatEventIsAllHistoryAvailableToggled(data) @@ -9818,14 +10452,20 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushReceiverId: return UnmarshalPushReceiverId(data) + case TypeBackgroundFillSolid: + return UnmarshalBackgroundFillSolid(data) + + case TypeBackgroundFillGradient: + return UnmarshalBackgroundFillGradient(data) + case TypeBackgroundTypeWallpaper: return UnmarshalBackgroundTypeWallpaper(data) case TypeBackgroundTypePattern: return UnmarshalBackgroundTypePattern(data) - case TypeBackgroundTypeSolid: - return UnmarshalBackgroundTypeSolid(data) + case TypeBackgroundTypeFill: + return UnmarshalBackgroundTypeFill(data) case TypeBackground: return UnmarshalBackground(data) @@ -9842,6 +10482,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeHashtags: return UnmarshalHashtags(data) + case TypeCanTransferOwnershipResultOk: + return UnmarshalCanTransferOwnershipResultOk(data) + + case TypeCanTransferOwnershipResultPasswordNeeded: + return UnmarshalCanTransferOwnershipResultPasswordNeeded(data) + + case TypeCanTransferOwnershipResultPasswordTooFresh: + return UnmarshalCanTransferOwnershipResultPasswordTooFresh(data) + + case TypeCanTransferOwnershipResultSessionTooFresh: + return UnmarshalCanTransferOwnershipResultSessionTooFresh(data) + case TypeCheckChatUsernameResultOk: return UnmarshalCheckChatUsernameResultOk(data) @@ -10007,6 +10659,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingRuleAllowUsers: return UnmarshalUserPrivacySettingRuleAllowUsers(data) + case TypeUserPrivacySettingRuleAllowChatMembers: + return UnmarshalUserPrivacySettingRuleAllowChatMembers(data) + case TypeUserPrivacySettingRuleRestrictAll: return UnmarshalUserPrivacySettingRuleRestrictAll(data) @@ -10016,6 +10671,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingRuleRestrictUsers: return UnmarshalUserPrivacySettingRuleRestrictUsers(data) + case TypeUserPrivacySettingRuleRestrictChatMembers: + return UnmarshalUserPrivacySettingRuleRestrictChatMembers(data) + case TypeUserPrivacySettingRules: return UnmarshalUserPrivacySettingRules(data) @@ -10028,6 +10686,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingShowLinkInForwardedMessages: return UnmarshalUserPrivacySettingShowLinkInForwardedMessages(data) + case TypeUserPrivacySettingShowPhoneNumber: + return UnmarshalUserPrivacySettingShowPhoneNumber(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -10037,6 +10698,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingAllowPeerToPeerCalls: return UnmarshalUserPrivacySettingAllowPeerToPeerCalls(data) + case TypeUserPrivacySettingAllowFindingByPhoneNumber: + return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) + case TypeAccountTtl: return UnmarshalAccountTtl(data) @@ -10052,9 +10716,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeConnectedWebsites: return UnmarshalConnectedWebsites(data) - case TypeChatReportSpamState: - return UnmarshalChatReportSpamState(data) - case TypeChatReportReasonSpam: return UnmarshalChatReportReasonSpam(data) @@ -10070,6 +10731,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatReportReasonCopyright: return UnmarshalChatReportReasonCopyright(data) + case TypeChatReportReasonUnrelatedLocation: + return UnmarshalChatReportReasonUnrelatedLocation(data) + case TypeChatReportReasonCustom: return UnmarshalChatReportReasonCustom(data) @@ -10208,6 +10872,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTopChatCategoryCalls: return UnmarshalTopChatCategoryCalls(data) + case TypeTopChatCategoryForwardChats: + return UnmarshalTopChatCategoryForwardChats(data) + case TypeTMeUrlTypeUser: return UnmarshalTMeUrlTypeUser(data) @@ -10292,9 +10959,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(data) + case TypeUpdateMessageLiveLocationViewed: + return UnmarshalUpdateMessageLiveLocationViewed(data) + case TypeUpdateNewChat: return UnmarshalUpdateNewChat(data) + case TypeUpdateChatChatList: + return UnmarshalUpdateChatChatList(data) + case TypeUpdateChatTitle: return UnmarshalUpdateChatTitle(data) @@ -10319,6 +10992,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatIsSponsored: return UnmarshalUpdateChatIsSponsored(data) + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(data) + case TypeUpdateChatDefaultDisableNotification: return UnmarshalUpdateChatDefaultDisableNotification(data) @@ -10337,6 +11013,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateScopeNotificationSettings: return UnmarshalUpdateScopeNotificationSettings(data) + case TypeUpdateChatActionBar: + return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatPinnedMessage: return UnmarshalUpdateChatPinnedMessage(data) @@ -10445,6 +11124,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateTermsOfService: return UnmarshalUpdateTermsOfService(data) + case TypeUpdateUsersNearby: + return UnmarshalUpdateUsersNearby(data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(data) @@ -10472,6 +11154,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdatePoll: return UnmarshalUpdatePoll(data) + case TypeUpdatePollAnswer: + return UnmarshalUpdatePollAnswer(data) + case TypeUpdates: return UnmarshalUpdates(data) diff --git a/data/td_api.json b/data/td_api.json index 92705b1..e5d9cc4 100755 --- a/data/td_api.json +++ b/data/td_api.json @@ -259,12 +259,12 @@ { "name": "offset", "type": "int32", - "description": "Offset of the entity in UTF-16 code points" + "description": "Offset of the entity in UTF-16 code units" }, { "name": "length", "type": "int32", - "description": "Length of the entity, in UTF-16 code points" + "description": "Length of the entity, in UTF-16 code units" }, { "name": "type", @@ -298,7 +298,7 @@ { "name": "entities", "type": "vector\u003ctextEntity\u003e", - "description": "Entities contained in the text" + "description": "Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other" } ] }, @@ -315,7 +315,7 @@ { "name": "min_user_age", "type": "int32", - "description": "Minimum age of a user to be able to accept the terms; 0 if any" + "description": "The minimum age of a user to be able to accept the terms; 0 if any" }, { "name": "show_popup", @@ -344,7 +344,7 @@ }, { "name": "authorizationStateWaitPhoneNumber", - "description": "TDLib needs the user's phone number to authorize", + "description": "TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options", "class": "AuthorizationState", "properties": [] }, @@ -360,6 +360,18 @@ } ] }, + { + "name": "authorizationStateWaitOtherDeviceConfirmation", + "description": "The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link", + "class": "AuthorizationState", + "properties": [ + { + "name": "link", + "type": "string", + "description": "A tg:// URL for the QR code. The link will be updated frequently" + } + ] + }, { "name": "authorizationStateWaitRegistration", "description": "The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration", @@ -534,7 +546,12 @@ { "name": "id", "type": "string", - "description": "Remote file identifier; may be empty. Can be used across application restarts or even from other devices for the current user. If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the client with the HTTP URL in the original_path and \"#url#\" as the conversion string. Clients should generate the file by downloading it to the specified location" + "description": "Remote file identifier; may be empty. Can be used across application restarts or even from other devices for the current user. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the client with the HTTP URL in the original_path and \"#url#\" as the conversion string. Clients should generate the file by downloading it to the specified location" + }, + { + "name": "unique_id", + "type": "string", + "description": "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" }, { "name": "is_uploading_active", @@ -599,7 +616,7 @@ }, { "name": "inputFileRemote", - "description": "A file defined by its remote ID", + "description": "A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client", "class": "InputFile", "properties": [ { @@ -775,6 +792,30 @@ } ] }, + { + "name": "pollTypeRegular", + "description": "A regular poll", + "class": "PollType", + "properties": [ + { + "name": "allow_multiple_answers", + "type": "Bool", + "description": "True, if multiple answer options can be chosen simultaneously" + } + ] + }, + { + "name": "pollTypeQuiz", + "description": "A poll in quiz mode, which has exactly one correct answer option and can be answered only once", + "class": "PollType", + "properties": [ + { + "name": "correct_option_id", + "type": "int32", + "description": "0-based identifier of the correct answer option; -1 for a yet unanswered poll" + } + ] + }, { "name": "animation", "description": "Describes an animation file. The animation must be encoded in GIF or MPEG4 format", @@ -824,7 +865,7 @@ }, { "name": "audio", - "description": "Describes an audio file. Audio is usually in MP3 format", + "description": "Describes an audio file. Audio is usually in MP3 or M4A format", "class": "Audio", "properties": [ { @@ -1008,7 +1049,7 @@ { "name": "has_stickers", "type": "Bool", - "description": "True, if stickers were added to the photo" + "description": "True, if stickers were added to the video" }, { "name": "supports_streaming", @@ -1244,6 +1285,21 @@ "type": "int32", "description": "Total number of voters, participating in the poll" }, + { + "name": "recent_voter_user_ids", + "type": "vector\u003cint32\u003e", + "description": "User identifiers of recent voters, if the poll is non-anonymous" + }, + { + "name": "is_anonymous", + "type": "Bool", + "description": "True, if the poll is anonymous" + }, + { + "name": "type", + "type": "PollType", + "description": "Type of the poll" + }, { "name": "is_closed", "type": "Bool", @@ -1290,24 +1346,6 @@ } ] }, - { - "name": "linkStateNone", - "description": "The phone number of user A is not known to user B", - "class": "LinkState", - "properties": [] - }, - { - "name": "linkStateKnowsPhoneNumber", - "description": "The phone number of user A is known but that number has not been saved to the contact list of user B", - "class": "LinkState", - "properties": [] - }, - { - "name": "linkStateIsContact", - "description": "The phone number of user A has been saved to the contact list of user B", - "class": "LinkState", - "properties": [] - }, { "name": "userTypeRegular", "description": "A regular user", @@ -1316,7 +1354,7 @@ }, { "name": "userTypeDeleted", - "description": "A deleted user or deleted bot. No information on the user besides the user_id is available. It is not possible to perform any active actions on this type of user", + "description": "A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user", "class": "UserType", "properties": [] }, @@ -1354,7 +1392,7 @@ }, { "name": "userTypeUnknown", - "description": "No information on the user besides the user_id is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type", + "description": "No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type", "class": "UserType", "properties": [] }, @@ -1392,6 +1430,23 @@ } ] }, + { + "name": "chatLocation", + "description": "Represents a location to which a chat is connected", + "class": "ChatLocation", + "properties": [ + { + "name": "location", + "type": "location", + "description": "The location" + }, + { + "name": "address", + "type": "string", + "description": "Location address; 1-64 characters, as defined by the chat owner" + } + ] + }, { "name": "user", "description": "Represents a user", @@ -1433,14 +1488,14 @@ "description": "Profile photo of the user; may be null" }, { - "name": "outgoing_link", - "type": "LinkState", - "description": "Relationship from the current user to the other user" + "name": "is_contact", + "type": "Bool", + "description": "The user is a contact of the current user" }, { - "name": "incoming_link", - "type": "LinkState", - "description": "Relationship from the other user to the current user" + "name": "is_mutual_contact", + "type": "Bool", + "description": "The user is a contact of the current user and the current user is a contact of the user" }, { "name": "is_verified", @@ -1455,7 +1510,7 @@ { "name": "restriction_reason", "type": "string", - "description": "If non-empty, it contains the reason why access to this user must be restricted. The format of the string is \"{type}: {description}\". {type} contains the type of the restriction and at least one of the suffixes \"-all\", \"-ios\", \"-android\", or \"-wp\", which describe the platforms on which access should be restricted. (For example, \"terms-ios-android\". {description} contains a human-readable description of the restriction, which can be shown to the user)" + "description": "If non-empty, it contains a human-readable description of the reason why access to this user must be restricted" }, { "name": "is_scam", @@ -1499,6 +1554,11 @@ "type": "Bool", "description": "True, if the user can't be called due to their privacy settings" }, + { + "name": "need_phone_number_privacy_exception", + "type": "Bool", + "description": "True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used" + }, { "name": "bio", "type": "string", @@ -1577,6 +1637,40 @@ } ] }, + { + "name": "chatAdministrator", + "description": "Contains information about a chat administrator", + "class": "ChatAdministrator", + "properties": [ + { + "name": "user_id", + "type": "int32", + "description": "User identifier of the administrator" + }, + { + "name": "custom_title", + "type": "string", + "description": "Custom title of the administrator" + }, + { + "name": "is_owner", + "type": "Bool", + "description": "True, if the user is the owner of the chat" + } + ] + }, + { + "name": "chatAdministrators", + "description": "Represents a list of chat administrators", + "class": "ChatAdministrators", + "properties": [ + { + "name": "administrators", + "type": "vector\u003cchatAdministrator\u003e", + "description": "A list of chat administrators" + } + ] + }, { "name": "chatPermissions", "description": "Describes actions that a user is allowed to take in a chat", @@ -1626,9 +1720,14 @@ }, { "name": "chatMemberStatusCreator", - "description": "The user is the creator of a chat and has all the administrator privileges", + "description": "The user is the owner of a chat and has all the administrator privileges", "class": "ChatMemberStatus", "properties": [ + { + "name": "custom_title", + "type": "string", + "description": "A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only" + }, { "name": "is_member", "type": "Bool", @@ -1641,6 +1740,11 @@ "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", "class": "ChatMemberStatus", "properties": [ + { + "name": "custom_title", + "type": "string", + "description": "A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only" + }, { "name": "can_be_edited", "type": "Bool", @@ -1684,7 +1788,7 @@ { "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 him" + "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" } ] }, @@ -1791,7 +1895,7 @@ }, { "name": "chatMembersFilterAdministrators", - "description": "Returns the creator and administrators", + "description": "Returns the owner and administrators", "class": "ChatMembersFilter", "properties": [] }, @@ -1839,7 +1943,7 @@ }, { "name": "supergroupMembersFilterAdministrators", - "description": "Returns the creator and administrators", + "description": "Returns the owner and administrators", "class": "SupergroupMembersFilter", "properties": [] }, @@ -1940,7 +2044,7 @@ { "name": "invite_link", "type": "string", - "description": "Invite link for this group; available only for the group creator and only after it has been generated at least once" + "description": "Invite link for this group; available only after it has been generated at least once and only for the group creator" } ] }, @@ -1967,18 +2071,33 @@ { "name": "status", "type": "ChatMemberStatus", - "description": "Status of the current user in the supergroup or channel" + "description": "Status of the current user in the supergroup or channel; custom title will be always empty" }, { "name": "member_count", "type": "int32", "description": "Member count; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was found through SearchPublicChats" }, + { + "name": "has_linked_chat", + "type": "Bool", + "description": "True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel" + }, + { + "name": "has_location", + "type": "Bool", + "description": "True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup" + }, { "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" }, + { + "name": "is_slow_mode_enabled", + "type": "Bool", + "description": "True, if the slow mode is enabled in the supergroup" + }, { "name": "is_channel", "type": "Bool", @@ -1992,7 +2111,7 @@ { "name": "restriction_reason", "type": "string", - "description": "If non-empty, contains the reason why access to this supergroup or channel must be restricted. Format of the string is \"{type}: {description}\". {type} Contains the type of the restriction and at least one of the suffixes \"-all\", \"-ios\", \"-android\", or \"-wp\", which describe the platforms on which access should be restricted. (For example, \"terms-ios-android\". {description} contains a human-readable description of the restriction, which can be shown to the user)" + "description": "If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted" }, { "name": "is_scam", @@ -2031,6 +2150,21 @@ "type": "int32", "description": "Number of users banned from chat; 0 if unknown" }, + { + "name": "linked_chat_id", + "type": "int53", + "description": "Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown" + }, + { + "name": "slow_mode_delay", + "type": "int32", + "description": "Delay between consecutive sent messages for non-administrator supergroup members, in seconds" + }, + { + "name": "slow_mode_delay_expires_in", + "type": "double", + "description": "Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero" + }, { "name": "can_get_members", "type": "Bool", @@ -2039,13 +2173,18 @@ { "name": "can_set_username", "type": "Bool", - "description": "True, if the chat can be made public" + "description": "True, if the chat username can be changed" }, { "name": "can_set_sticker_set", "type": "Bool", "description": "True, if the supergroup sticker set can be changed" }, + { + "name": "can_set_location", + "type": "Bool", + "description": "True, if the supergroup location can be changed" + }, { "name": "can_view_statistics", "type": "Bool", @@ -2054,13 +2193,18 @@ { "name": "is_all_history_available", "type": "Bool", - "description": "True, if new chat members will have access to old messages. In public supergroups and both public and private channels, old messages are always available, so this option affects only private supergroups. The value of this field is only available for chat administrators" + "description": "True, if new chat members will have access to old messages. In public 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" }, { "name": "sticker_set_id", "type": "int64", "description": "Identifier of the supergroup sticker set; 0 if none" }, + { + "name": "location", + "type": "chatLocation", + "description": "Location to which the supergroup is connected; may be null" + }, { "name": "invite_link", "type": "string", @@ -2129,12 +2273,12 @@ { "name": "key_hash", "type": "bytes", - "description": "Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 bytes, which must be used to make a 12x12 square image with a color depth of 4. The first 16 bytes should be used to make a central 8x8 square, while the remaining 20 bytes should be used to construct a 2-pixel-wide border around that square. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers" + "description": "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" }, { "name": "layer", "type": "int32", - "description": "Secret chat layer; determines features supported by the other client. Video notes are supported if the layer \u003e= 66" + "description": "Secret chat layer; determines features supported by the other client. Video notes are supported if the layer \u003e= 66; nested text entities and underline and strikethrough entities are supported if the layer \u003e= 101" } ] }, @@ -2202,12 +2346,12 @@ { "name": "from_chat_id", "type": "int53", - "description": "For messages forwarded to the chat with the current user (saved messages) or to the channel discussion supergroup, the identifier of the chat from which the message was forwarded last time; 0 if unknown" + "description": "For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown" }, { "name": "from_message_id", "type": "int53", - "description": "For messages forwarded to the chat with the current user (saved messages) or to the channel discussion supergroup, the identifier of the original message from which the new message was forwarded last time; 0 if unknown" + "description": "For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown" } ] }, @@ -2269,6 +2413,11 @@ "type": "MessageSendingState", "description": "Information about 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" + }, { "name": "is_outgoing", "type": "Bool", @@ -2277,7 +2426,7 @@ { "name": "can_be_edited", "type": "Bool", - "description": "True, if the message can be edited. For live location and poll messages this fields shows, whether editMessageLiveLocation or stopPoll can be used with this message by the client" + "description": "True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the client" }, { "name": "can_be_forwarded", @@ -2354,6 +2503,11 @@ "type": "int64", "description": "Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums" }, + { + "name": "restriction_reason", + "type": "string", + "description": "If non-empty, contains a human-readable description of the reason why access to this message must be restricted" + }, { "name": "content", "type": "MessageContent", @@ -2582,6 +2736,18 @@ } ] }, + { + "name": "chatListMain", + "description": "A main list of chats", + "class": "ChatList", + "properties": [] + }, + { + "name": "chatListArchive", + "description": "A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives", + "class": "ChatList", + "properties": [] + }, { "name": "chat", "description": "A chat. (Can be a private chat, basic group, supergroup, or secret chat)", @@ -2597,6 +2763,11 @@ "type": "ChatType", "description": "Type of the chat" }, + { + "name": "chat_list", + "type": "ChatList", + "description": "A chat list to which the chat belongs; may be null" + }, { "name": "title", "type": "string", @@ -2637,6 +2808,11 @@ "type": "Bool", "description": "True, if the chat is sponsored by the user's MTProxy server" }, + { + "name": "has_scheduled_messages", + "type": "Bool", + "description": "True, if the chat has scheduled messages" + }, { "name": "can_be_deleted_only_for_self", "type": "Bool", @@ -2682,6 +2858,11 @@ "type": "chatNotificationSettings", "description": "Notification settings for this chat" }, + { + "name": "action_bar", + "type": "ChatActionBar", + "description": "Describes actions which should be possible to do through a chat action bar; may be null" + }, { "name": "pinned_message_id", "type": "int53", @@ -2700,7 +2881,7 @@ { "name": "client_data", "type": "string", - "description": "Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if a message database is used" + "description": "Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if the message database is used" } ] }, @@ -2716,6 +2897,40 @@ } ] }, + { + "name": "chatNearby", + "description": "Describes a chat located nearby", + "class": "ChatNearby", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "distance", + "type": "int32", + "description": "Distance to the chat location in meters" + } + ] + }, + { + "name": "chatsNearby", + "description": "Represents a list of chats located nearby", + "class": "ChatsNearby", + "properties": [ + { + "name": "users_nearby", + "type": "vector\u003cchatNearby\u003e", + "description": "List of users nearby" + }, + { + "name": "supergroups_nearby", + "type": "vector\u003cchatNearby\u003e", + "description": "List of location-based supergroups nearby" + } + ] + }, { "name": "chatInviteLink", "description": "Contains a chat invite link", @@ -2766,10 +2981,52 @@ { "name": "is_public", "type": "Bool", - "description": "True, if the chat is a public supergroup or a channel with a username" + "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", + "class": "PublicChatType", + "properties": [] + }, + { + "name": "publicChatTypeIsLocationBased", + "description": "The chat is public, because it is a location-based supergroup", + "class": "PublicChatType", + "properties": [] + }, + { + "name": "chatActionBarReportSpam", + "description": "The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam", + "class": "ChatActionBar", + "properties": [] + }, + { + "name": "chatActionBarReportUnrelatedLocation", + "description": "The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation", + "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 added to the contact list using the method addContact, or the other user can be blocked using the method blockUser", + "class": "ChatActionBar", + "properties": [] + }, + { + "name": "chatActionBarAddContact", + "description": "The chat is a private or secret chat and the other user can be added to the contact list using the method addContact", + "class": "ChatActionBar", + "properties": [] + }, + { + "name": "chatActionBarSharePhoneNumber", + "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", + "class": "ChatActionBar", + "properties": [] + }, { "name": "keyboardButtonTypeText", "description": "A simple button, with text that should be sent when the button is pressed", @@ -2788,6 +3045,23 @@ "class": "KeyboardButtonType", "properties": [] }, + { + "name": "keyboardButtonTypeRequestPoll", + "description": "A button that allows the user to create and send a poll when pressed; available only in private chats", + "class": "KeyboardButtonType", + "properties": [ + { + "name": "force_regular", + "type": "Bool", + "description": "If true, only regular polls must be allowed to create" + }, + { + "name": "force_quiz", + "type": "Bool", + "description": "If true, only polls in quiz mode must be allowed to create" + } + ] + }, { "name": "keyboardButton", "description": "Represents a single button in a bot keyboard", @@ -2825,7 +3099,7 @@ { "name": "url", "type": "string", - "description": "HTTP URL to open" + "description": "An HTTP URL to open" }, { "name": "id", @@ -2960,6 +3234,50 @@ } ] }, + { + "name": "loginUrlInfoOpen", + "description": "An HTTP url needs to be open", + "class": "LoginUrlInfo", + "properties": [ + { + "name": "url", + "type": "string", + "description": "The URL to open" + }, + { + "name": "skip_confirm", + "type": "Bool", + "description": "True, if there is no need to show an ordinary open URL confirm" + } + ] + }, + { + "name": "loginUrlInfoRequestConfirmation", + "description": "An authorization confirmation dialog needs to be shown to the user", + "class": "LoginUrlInfo", + "properties": [ + { + "name": "url", + "type": "string", + "description": "An HTTP URL to be opened" + }, + { + "name": "domain", + "type": "string", + "description": "A domain of the URL" + }, + { + "name": "bot_user_id", + "type": "int32", + "description": "User identifier of a bot linked with the website" + }, + { + "name": "request_write_access", + "type": "Bool", + "description": "True, if the user needs to be requested to give the permission to the bot to send them messages" + } + ] + }, { "name": "richTextPlain", "description": "A plain text", @@ -3010,7 +3328,7 @@ }, { "name": "richTextStrikethrough", - "description": "A strike-through rich text", + "description": "A strikethrough rich text", "class": "RichText", "properties": [ { @@ -3046,6 +3364,11 @@ "name": "url", "type": "string", "description": "URL" + }, + { + "name": "is_cached", + "type": "Bool", + "description": "True, if the URL has cached instant view server-side" } ] }, @@ -3248,7 +3571,7 @@ { "name": "text", "type": "RichText", - "description": "Cell text" + "description": "Cell text; may be null. If the text is null, then the cell should be invisible" }, { "name": "is_header", @@ -3584,6 +3907,23 @@ } ] }, + { + "name": "pageBlockVoiceNote", + "description": "A voice note", + "class": "PageBlock", + "properties": [ + { + "name": "voice_note", + "type": "voiceNote", + "description": "Voice note; may be null" + }, + { + "name": "caption", + "type": "pageBlockCaption", + "description": "Voice note caption" + } + ] + }, { "name": "pageBlockCover", "description": "A page cover", @@ -5360,7 +5700,7 @@ { "name": "animation", "type": "animation", - "description": "Message content" + "description": "The animation description" }, { "name": "caption", @@ -5382,7 +5722,7 @@ { "name": "audio", "type": "audio", - "description": "Message content" + "description": "The audio description" }, { "name": "caption", @@ -5399,7 +5739,7 @@ { "name": "document", "type": "document", - "description": "Message content" + "description": "The document description" }, { "name": "caption", @@ -5416,7 +5756,7 @@ { "name": "photo", "type": "photo", - "description": "Message content" + "description": "The photo description" }, { "name": "caption", @@ -5444,7 +5784,7 @@ { "name": "sticker", "type": "sticker", - "description": "Message content" + "description": "The sticker description" } ] }, @@ -5456,7 +5796,7 @@ { "name": "video", "type": "video", - "description": "Message content" + "description": "The video description" }, { "name": "caption", @@ -5484,7 +5824,7 @@ { "name": "video_note", "type": "videoNote", - "description": "Message content" + "description": "The video note description" }, { "name": "is_viewed", @@ -5506,7 +5846,7 @@ { "name": "voice_note", "type": "voiceNote", - "description": "Message content" + "description": "The voice note description" }, { "name": "caption", @@ -5528,7 +5868,7 @@ { "name": "location", "type": "location", - "description": "Message content" + "description": "The location description" }, { "name": "live_period", @@ -5550,7 +5890,7 @@ { "name": "venue", "type": "venue", - "description": "Message content" + "description": "The venue description" } ] }, @@ -5562,7 +5902,7 @@ { "name": "contact", "type": "contact", - "description": "Message content" + "description": "The contact description" } ] }, @@ -5574,7 +5914,7 @@ { "name": "game", "type": "game", - "description": "Game" + "description": "The game description" } ] }, @@ -5586,7 +5926,7 @@ { "name": "poll", "type": "poll", - "description": "Poll" + "description": "The poll description" } ] }, @@ -5999,6 +6339,12 @@ "class": "TextEntityType", "properties": [] }, + { + "name": "textEntityTypePhoneNumber", + "description": "A phone number", + "class": "TextEntityType", + "properties": [] + }, { "name": "textEntityTypeBold", "description": "A bold text", @@ -6011,6 +6357,18 @@ "class": "TextEntityType", "properties": [] }, + { + "name": "textEntityTypeUnderline", + "description": "An underlined text", + "class": "TextEntityType", + "properties": [] + }, + { + "name": "textEntityTypeStrikethrough", + "description": "A strikethrough text", + "class": "TextEntityType", + "properties": [] + }, { "name": "textEntityTypeCode", "description": "Text that must be formatted as if inside a code HTML tag", @@ -6059,12 +6417,6 @@ } ] }, - { - "name": "textEntityTypePhoneNumber", - "description": "A phone number", - "class": "TextEntityType", - "properties": [] - }, { "name": "inputThumbnail", "description": "A thumbnail to be sent along with a file; should be in JPEG or WEBP format for stickers, and less than 200 kB in size", @@ -6087,6 +6439,46 @@ } ] }, + { + "name": "messageSchedulingStateSendAtDate", + "description": "The message will be sent at the specified date", + "class": "MessageSchedulingState", + "properties": [ + { + "name": "send_date", + "type": "int32", + "description": "Date the message will be sent. The date must be within 367 days in the future" + } + ] + }, + { + "name": "messageSchedulingStateSendWhenOnline", + "description": "The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known", + "class": "MessageSchedulingState", + "properties": [] + }, + { + "name": "sendMessageOptions", + "description": "Options to be used when a message is send", + "class": "SendMessageOptions", + "properties": [ + { + "name": "disable_notification", + "type": "Bool", + "description": "Pass true to disable notification for the message. Must be false if the message is sent to a secret chat" + }, + { + "name": "from_background", + "type": "Bool", + "description": "Pass true if the message is sent from the background" + }, + { + "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" + } + ] + }, { "name": "inputMessageText", "description": "A text message", @@ -6095,7 +6487,7 @@ { "name": "text", "type": "formattedText", - "description": "Formatted text to be sent; 1-GetOption(\"message_text_length_max\") characters. Only Bold, Italic, Code, Pre, PreCode and TextUrl entities are allowed to be specified manually" + "description": "Formatted text to be sent; 1-GetOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" }, { "name": "disable_web_page_preview", @@ -6393,7 +6785,7 @@ { "name": "live_period", "type": "int32", - "description": "Period for which the location can be updated, in seconds; should bebetween 60 and 86400 for a live location and 0 otherwise" + "description": "Period for which the location can be updated, in seconds; should be between 60 and 86400 for a live location and 0 otherwise" } ] }, @@ -6502,7 +6894,7 @@ }, { "name": "inputMessagePoll", - "description": "A message with a poll. Polls can't be sent to private or secret chats", + "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", "class": "InputMessageContent", "properties": [ { @@ -6514,6 +6906,21 @@ "name": "options", "type": "vector\u003cstring\u003e", "description": "List of poll answer options, 2-10 strings 1-100 characters each" + }, + { + "name": "is_anonymous", + "type": "Bool", + "description": "True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels" + }, + { + "name": "type", + "type": "PollType", + "description": "Type of the poll" + }, + { + "name": "is_closed", + "type": "Bool", + "description": "True, if the poll needs to be sent already closed; for bots only" } ] }, @@ -7024,12 +7431,12 @@ { "name": "min_layer", "type": "int32", - "description": "Minimum supported API layer; use 65" + "description": "The minimum supported API layer; use 65" }, { "name": "max_layer", "type": "int32", - "description": "Maximum supported API layer; use 65" + "description": "The maximum supported API layer; use 65" } ] }, @@ -7739,7 +8146,7 @@ }, { "name": "inputInlineQueryResultSticker", - "description": "Represents a link to a WEBP or a TGS sticker", + "description": "Represents a link to a WEBP or TGS sticker", "class": "InputInlineQueryResult", "properties": [ { @@ -7755,7 +8162,7 @@ { "name": "sticker_url", "type": "string", - "description": "The URL of the WEBP or a TGS sticker (sticker file size must not exceed 5MB)" + "description": "The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB)" }, { "name": "sticker_width", @@ -8557,6 +8964,40 @@ } ] }, + { + "name": "chatEventLinkedChatChanged", + "description": "The linked chat of a supergroup was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_linked_chat_id", + "type": "int53", + "description": "Previous supergroup linked chat identifier" + }, + { + "name": "new_linked_chat_id", + "type": "int53", + "description": "New supergroup linked chat identifier" + } + ] + }, + { + "name": "chatEventSlowModeDelayChanged", + "description": "The slow_mode_delay setting of a supergroup was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_slow_mode_delay", + "type": "int32", + "description": "Previous value of slow_mode_delay" + }, + { + "name": "new_slow_mode_delay", + "type": "int32", + "description": "New value of slow_mode_delay" + } + ] + }, { "name": "chatEventSignMessagesToggled", "description": "The sign_messages setting of a channel was toggled", @@ -8586,6 +9027,23 @@ } ] }, + { + "name": "chatEventLocationChanged", + "description": "The supergroup location was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_location", + "type": "chatLocation", + "description": "Previous location; may be null" + }, + { + "name": "new_location", + "type": "chatLocation", + "description": "New location; may be null" + } + ] + }, { "name": "chatEventIsAllHistoryAvailableToggled", "description": "The is_all_history_available setting of a supergroup was toggled", @@ -9036,6 +9494,40 @@ } ] }, + { + "name": "backgroundFillSolid", + "description": "Describes a solid fill of a background", + "class": "BackgroundFill", + "properties": [ + { + "name": "color", + "type": "int32", + "description": "A color of the background in the RGB24 format" + } + ] + }, + { + "name": "backgroundFillGradient", + "description": "Describes a gradient fill of a background", + "class": "BackgroundFill", + "properties": [ + { + "name": "top_color", + "type": "int32", + "description": "A top color of the background in the RGB24 format" + }, + { + "name": "bottom_color", + "type": "int32", + "description": "A bottom color of the background in the RGB24 format" + }, + { + "name": "rotation_angle", + "type": "int32", + "description": "Clockwise rotation angle of the gradient, in degrees; 0-359. Should be always divisible by 45" + } + ] + }, { "name": "backgroundTypeWallpaper", "description": "A wallpaper in JPEG format", @@ -9049,41 +9541,41 @@ { "name": "is_moving", "type": "Bool", - "description": "True, if the background needs to be slightly moved when device is rotated" + "description": "True, if the background needs to be slightly moved when device is tilted" } ] }, { "name": "backgroundTypePattern", - "description": "A PNG pattern to be combined with the color chosen by the user", + "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", "class": "BackgroundType", "properties": [ { - "name": "is_moving", - "type": "Bool", - "description": "True, if the background needs to be slightly moved when device is rotated" - }, - { - "name": "color", - "type": "int32", - "description": "Main color of the background in RGB24 format" + "name": "fill", + "type": "BackgroundFill", + "description": "Description of the background fill" }, { "name": "intensity", "type": "int32", - "description": "Intensity of the pattern when it is shown above the main background color, 0-100" + "description": "Intensity of the pattern when it is shown above the filled background, 0-100" + }, + { + "name": "is_moving", + "type": "Bool", + "description": "True, if the background needs to be slightly moved when device is tilted" } ] }, { - "name": "backgroundTypeSolid", - "description": "A solid background", + "name": "backgroundTypeFill", + "description": "A filled background", "class": "BackgroundType", "properties": [ { - "name": "color", - "type": "int32", - "description": "A color of the background in RGB24 format" + "name": "fill", + "type": "BackgroundFill", + "description": "Description of the background fill" } ] }, @@ -9115,7 +9607,7 @@ { "name": "document", "type": "document", - "description": "Document with the background; may be null. Null only for solid backgrounds" + "description": "Document with the background; may be null. Null only for filled backgrounds" }, { "name": "type", @@ -9144,7 +9636,7 @@ { "name": "background", "type": "InputFile", - "description": "Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file nust be in JPEG format for wallpapers and in PNG format for patterns" + "description": "Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file must be in JPEG format for wallpapers and in PNG format for patterns" } ] }, @@ -9172,6 +9664,42 @@ } ] }, + { + "name": "canTransferOwnershipResultOk", + "description": "The session can be used", + "class": "CanTransferOwnershipResult", + "properties": [] + }, + { + "name": "canTransferOwnershipResultPasswordNeeded", + "description": "The 2-step verification needs to be enabled first", + "class": "CanTransferOwnershipResult", + "properties": [] + }, + { + "name": "canTransferOwnershipResultPasswordTooFresh", + "description": "The 2-step verification was enabled recently, user needs to wait", + "class": "CanTransferOwnershipResult", + "properties": [ + { + "name": "retry_after", + "type": "int32", + "description": "Time left before the session can be used to transfer ownership of a chat, in seconds" + } + ] + }, + { + "name": "canTransferOwnershipResultSessionTooFresh", + "description": "The session was created recently, user needs to wait", + "class": "CanTransferOwnershipResult", + "properties": [ + { + "name": "retry_after", + "type": "int32", + "description": "Time left before the session can be used to transfer ownership of a chat, in seconds" + } + ] + }, { "name": "checkChatUsernameResultOk", "description": "The username can be set", @@ -9403,6 +9931,11 @@ "type": "string", "description": "Poll question" }, + { + "name": "is_regular", + "type": "Bool", + "description": "True, if the poll is regular and not in quiz mode" + }, { "name": "is_pinned", "type": "Bool", @@ -9540,7 +10073,7 @@ { "name": "is_returned", "type": "Bool", - "description": "True, if the user has returned to the group himself" + "description": "True, if the user has returned to the group themself" } ] }, @@ -9580,7 +10113,7 @@ { "name": "is_left", "type": "Bool", - "description": "True, if the user has left the group himself" + "description": "True, if the user has left the group themself" } ] }, @@ -9715,6 +10248,11 @@ "type": "int32", "description": "Notification date" }, + { + "name": "is_silent", + "type": "Bool", + "description": "True, if the notification was initially silent" + }, { "name": "type", "type": "NotificationType", @@ -9899,7 +10437,19 @@ { "name": "user_ids", "type": "vector\u003cint32\u003e", - "description": "The user identifiers" + "description": "The user identifiers, total number of users in all rules must not exceed 1000" + } + ] + }, + { + "name": "userPrivacySettingRuleAllowChatMembers", + "description": "A rule to allow all members of certain specified basic groups and supergroups to doing something", + "class": "UserPrivacySettingRule", + "properties": [ + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "The chat identifiers, total number of chats in all rules must not exceed 20" } ] }, @@ -9923,7 +10473,19 @@ { "name": "user_ids", "type": "vector\u003cint32\u003e", - "description": "The user identifiers" + "description": "The user identifiers, total number of users in all rules must not exceed 1000" + } + ] + }, + { + "name": "userPrivacySettingRuleRestrictChatMembers", + "description": "A rule to restrict all members of specified basic groups and supergroups from doing something", + "class": "UserPrivacySettingRule", + "properties": [ + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "The chat identifiers, total number of chats in all rules must not exceed 20" } ] }, @@ -9957,6 +10519,12 @@ "class": "UserPrivacySetting", "properties": [] }, + { + "name": "userPrivacySettingShowPhoneNumber", + "description": "A privacy setting for managing whether the user's phone number is visible", + "class": "UserPrivacySetting", + "properties": [] + }, { "name": "userPrivacySettingAllowChatInvites", "description": "A privacy setting for managing whether the user can be invited to chats", @@ -9975,6 +10543,12 @@ "class": "UserPrivacySetting", "properties": [] }, + { + "name": "userPrivacySettingAllowFindingByPhoneNumber", + "description": "A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to \"Allow contacts\" or \"Allow all\"", + "class": "UserPrivacySetting", + "properties": [] + }, { "name": "accountTtl", "description": "Contains information about the period of inactivity after which the current user's account will automatically be deleted", @@ -10145,18 +10719,6 @@ } ] }, - { - "name": "chatReportSpamState", - "description": "Contains information about the availability of the \"Report spam\" action for a chat", - "class": "ChatReportSpamState", - "properties": [ - { - "name": "can_report_spam", - "type": "Bool", - "description": "True, if a prompt with the \"Report spam\" action should be shown to the user" - } - ] - }, { "name": "chatReportReasonSpam", "description": "The chat contains spam messages", @@ -10187,6 +10749,12 @@ "class": "ChatReportReason", "properties": [] }, + { + "name": "chatReportReasonUnrelatedLocation", + "description": "The location-based chat is unrelated to its stated location", + "class": "ChatReportReason", + "properties": [] + }, { "name": "chatReportReasonCustom", "description": "A custom reason provided by the user", @@ -10201,7 +10769,7 @@ }, { "name": "publicMessageLink", - "description": "Contains a public HTTPS link to a message in a public supergroup or channel with a username", + "description": "Contains a public HTTPS link to a message in a supergroup or channel with a username", "class": "PublicMessageLink", "properties": [ { @@ -10580,17 +11148,22 @@ { "name": "max_photo_file_size", "type": "int32", - "description": "Maximum size of a photo file to be auto-downloaded" + "description": "The maximum size of a photo file to be auto-downloaded" }, { "name": "max_video_file_size", "type": "int32", - "description": "Maximum size of a video file to be auto-downloaded" + "description": "The maximum size of a video file to be auto-downloaded" }, { "name": "max_other_file_size", "type": "int32", - "description": "Maximum size of other file types to be auto-downloaded" + "description": "The maximum size of other file types to be auto-downloaded" + }, + { + "name": "video_upload_bitrate", + "type": "int32", + "description": "The maximum suggested bitrate for uploaded videos" }, { "name": "preload_large_videos", @@ -10697,6 +11270,12 @@ "class": "TopChatCategory", "properties": [] }, + { + "name": "topChatCategoryForwardChats", + "description": "A category containing frequently used chats used to forward messages", + "class": "TopChatCategory", + "properties": [] + }, { "name": "tMeUrlTypeUser", "description": "A URL linking to a user", @@ -10831,7 +11410,13 @@ "name": "textParseModeMarkdown", "description": "The text should be parsed in markdown-style", "class": "TextParseMode", - "properties": [] + "properties": [ + { + "name": "version", + "type": "int32", + "description": "Version of the parser: 0 or 1 - Bot API Markdown parse mode, 2 - Bot API MarkdownV2 parse mode" + } + ] }, { "name": "textParseModeHTML", @@ -11156,6 +11741,23 @@ } ] }, + { + "name": "updateMessageLiveLocationViewed", + "description": "A message with a live location was viewed. When the update is received, the client is supposed to update the live location", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat with the live location message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message with live location" + } + ] + }, { "name": "updateNewChat", "description": "A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the client. The chat field changes will be reported through separate updates", @@ -11168,6 +11770,23 @@ } ] }, + { + "name": "updateChatChatList", + "description": "The list to which the chat belongs was changed. This update is guaranteed to be sent only when chat.order == 0 and the current or the new chat list is null", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "chat_list", + "type": "ChatList", + "description": "The new chat's chat list; may be null" + } + ] + }, { "name": "updateChatTitle", "description": "The title of a chat was changed", @@ -11221,7 +11840,7 @@ }, { "name": "updateChatLastMessage", - "description": "The last message of a chat was changed. If last_message is null then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case", + "description": "The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case", "class": "Update", "properties": [ { @@ -11243,7 +11862,7 @@ }, { "name": "updateChatOrder", - "description": "The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned or updateChatDraftMessage might be sent", + "description": "The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned, updateChatDraftMessage, or updateChatIsSponsored might be sent", "class": "Update", "properties": [ { @@ -11319,6 +11938,23 @@ } ] }, + { + "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", @@ -11426,6 +12062,23 @@ } ] }, + { + "name": "updateChatActionBar", + "description": "The chat action bar was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "action_bar", + "type": "ChatActionBar", + "description": "The new value of the action bar; may be null" + } + ] + }, { "name": "updateChatPinnedMessage", "description": "The chat pinned message was changed", @@ -11565,7 +12218,7 @@ }, { "name": "updateActiveNotifications", - "description": "Contains active notifications that was shown on previous application launches. This update is sent only if a message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update", + "description": "Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update", "class": "Update", "properties": [ { @@ -11577,7 +12230,7 @@ }, { "name": "updateHavePendingNotifications", - "description": "Describes, whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications", + "description": "Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications", "class": "Update", "properties": [ { @@ -11856,9 +12509,14 @@ }, { "name": "updateUnreadMessageCount", - "description": "Number of unread messages has changed. This update is sent only if a message database is used", + "description": "Number of unread messages in a chat list has changed. This update is sent only if the message database is used", "class": "Update", "properties": [ + { + "name": "chat_list", + "type": "ChatList", + "description": "The chat list with changed number of unread messages" + }, { "name": "unread_count", "type": "int32", @@ -11873,9 +12531,19 @@ }, { "name": "updateUnreadChatCount", - "description": "Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if a message database is used", + "description": "Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used", "class": "Update", "properties": [ + { + "name": "chat_list", + "type": "ChatList", + "description": "The chat list with changed number of unread messages" + }, + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of chats in the chat list" + }, { "name": "unread_count", "type": "int32", @@ -12053,6 +12721,18 @@ } ] }, + { + "name": "updateUsersNearby", + "description": "List of users nearby has changed. The update is sent only 60 seconds after a successful searchChatsNearby request", + "class": "Update", + "properties": [ + { + "name": "users_nearby", + "type": "vector\u003cchatNearby\u003e", + "description": "The new list of users nearby" + } + ] + }, { "name": "updateNewInlineQuery", "description": "A new incoming inline query; for bots only", @@ -12135,7 +12815,7 @@ { "name": "chat_id", "type": "int53", - "description": "Identifier of the chat, in which the query was sent" + "description": "Identifier of the chat where the query was sent" }, { "name": "message_id", @@ -12291,7 +12971,7 @@ }, { "name": "updatePoll", - "description": "Information about a poll was updated; for bots only", + "description": "A poll was updated; for bots only", "class": "Update", "properties": [ { @@ -12301,6 +12981,28 @@ } ] }, + { + "name": "updatePollAnswer", + "description": "A user changed the answer to a poll; for bots only", + "class": "Update", + "properties": [ + { + "name": "poll_id", + "type": "int64", + "description": "Unique poll identifier" + }, + { + "name": "user_id", + "type": "int32", + "description": "The user, who changed the answer to the poll" + }, + { + "name": "option_ids", + "type": "vector\u003cint32\u003e", + "description": "0-based identifiers of answer options, chosen by the user" + } + ] + }, { "name": "updates", "description": "Contains a list of updates", @@ -12332,7 +13034,7 @@ { "name": "max_file_size", "type": "int53", - "description": "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 be auto-rotated" } ] }, @@ -12469,12 +13171,12 @@ "description": "Part of the face, relative to which a mask should be placed" }, { - "name": "LinkState", - "description": "Represents the relationship between user A and user B. For incoming_link, user A is the current user; for outgoing_link, user B is the current user" + "name": "PollType", + "description": "Describes the type of a poll" }, { "name": "UserType", - "description": "Represents the type of the user. The following types are possible: regular users, deleted users and bots" + "description": "Represents the type of a user. The following types are possible: regular users, deleted users and bots" }, { "name": "ChatMemberStatus", @@ -12508,6 +13210,18 @@ "name": "ChatType", "description": "Describes the type of a chat" }, + { + "name": "ChatList", + "description": "Describes a list of chats" + }, + { + "name": "PublicChatType", + "description": "Describes a type of public chats" + }, + { + "name": "ChatActionBar", + "description": "Describes actions which should be possible to do through a chat action bar" + }, { "name": "KeyboardButtonType", "description": "Describes a keyboard button type" @@ -12520,6 +13234,10 @@ "name": "ReplyMarkup", "description": "Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots" }, + { + "name": "LoginUrlInfo", + "description": "Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl" + }, { "name": "RichText", "description": "Describes a text object inside an instant-view web page" @@ -12568,6 +13286,10 @@ "name": "TextEntityType", "description": "Represents a part of the text which must be formatted differently" }, + { + "name": "MessageSchedulingState", + "description": "Contains information about the time when a scheduled message will be sent" + }, { "name": "InputMessageContent", "description": "The content of a message to send" @@ -12620,14 +13342,22 @@ "name": "DeviceToken", "description": "Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, you must specify the correct application platform and upload valid server authentication data at https://my.telegram.org" }, + { + "name": "BackgroundFill", + "description": "Describes a fill of a background" + }, { "name": "BackgroundType", - "description": "Describes a type of a background" + "description": "Describes the type of a background" }, { "name": "InputBackground", "description": "Contains information about background to set" }, + { + "name": "CanTransferOwnershipResult", + "description": "Represents result of checking whether the current session can be used to transfer a chat ownership to another user" + }, { "name": "CheckChatUsernameResult", "description": "Represents result of checking whether a username can be set for a chat" @@ -12642,7 +13372,7 @@ }, { "name": "NotificationGroupType", - "description": "Describes type of notifications in the group" + "description": "Describes the type of notifications in a notification group" }, { "name": "OptionValue", @@ -12694,7 +13424,7 @@ }, { "name": "ProxyType", - "description": "Describes the type of the proxy server" + "description": "Describes the type of a proxy server" }, { "name": "Update", @@ -12744,7 +13474,7 @@ }, { "name": "setAuthenticationPhoneNumber", - "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 or authorizationStateWaitPassword", + "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", "class": "Ok", "properties": [ { @@ -12783,6 +13513,20 @@ "is_synchronous": false, "type": 1 }, + { + "name": "requestQrCodeAuthentication", + "description": "Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber", + "class": "Ok", + "properties": [ + { + "name": "other_user_ids", + "type": "vector\u003cint32\u003e", + "description": "List of user identifiers of other users currently using the client" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "registerUser", "description": "Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration", @@ -12876,9 +13620,23 @@ "is_synchronous": false, "type": 1 }, + { + "name": "confirmQrCodeAuthentication", + "description": "Confirms QR code authentication on another device. Returns created session on success", + "class": "Session", + "properties": [ + { + "name": "link", + "type": "string", + "description": "A link from a QR code. The link must be scanned by the in-app camera" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "getCurrentState", - "description": "Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially usefull if TDLib is run in a separate process. This is an offline method. Can be called before authorization", + "description": "Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially useful if TDLib is run in a separate process. This is an offline method. Can be called before authorization", "class": "Updates", "properties": [], "is_synchronous": false, @@ -13110,7 +13868,7 @@ }, { "name": "getSupergroup", - "description": "Returns information about a supergroup or channel by its identifier. This is an offline request if the current user is not a bot", + "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", "class": "Supergroup", "properties": [ { @@ -13124,7 +13882,7 @@ }, { "name": "getSupergroupFullInfo", - "description": "Returns full information about a supergroup or channel by its identifier, cached for up to 1 minute", + "description": "Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute", "class": "SupergroupFullInfo", "properties": [ { @@ -13270,7 +14028,7 @@ }, { "name": "getRemoteFile", - "description": "Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message", + "description": "Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client", "class": "File", "properties": [ { @@ -13289,9 +14047,14 @@ }, { "name": "getChats", - "description": "Returns an ordered list of chats. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). For optimal performance the number of returned chats is chosen by the library", + "description": "Returns an ordered list of chats in a chat list. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). For optimal performance the number of returned chats is chosen by the library", "class": "Chats", "properties": [ + { + "name": "chat_list", + "type": "ChatList", + "description": "The chat list in which to return chats" + }, { "name": "offset_order", "type": "int64", @@ -13352,7 +14115,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of chats to be returned" + "description": "The maximum number of chats to be returned" } ], "is_synchronous": false, @@ -13371,7 +14134,21 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of chats to be returned" + "description": "The maximum number of chats to be returned" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "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", + "class": "ChatsNearby", + "properties": [ + { + "name": "location", + "type": "location", + "description": "Current user location" } ], "is_synchronous": false, @@ -13390,7 +14167,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of chats to be returned; up to 30" + "description": "The maximum number of chats to be returned; up to 30" } ], "is_synchronous": false, @@ -13472,7 +14249,43 @@ }, { "name": "getCreatedPublicChats", - "description": "Returns a list of public chats with username created by the user", + "description": "Returns a list of public chats of the specified type, owned by the user", + "class": "Chats", + "properties": [ + { + "name": "type", + "type": "PublicChatType", + "description": "Type of the public chats to return" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "checkCreatedPublicChatsLimit", + "description": "Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached", + "class": "Ok", + "properties": [ + { + "name": "type", + "type": "PublicChatType", + "description": "Type of the public chats, for which to check the limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getSuitableDiscussionChats", + "description": "Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Basic group chats need to be first upgraded to supergroups before they can be set as a discussion group", + "class": "Chats", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getInactiveSupergroupChats", + "description": "Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error", "class": "Chats", "properties": [], "is_synchronous": false, @@ -13496,7 +14309,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of chats to be returned; up to 100" + "description": "The maximum number of chats to be returned; up to 100" } ], "is_synchronous": false, @@ -13609,6 +14422,11 @@ "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", "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" + }, { "name": "query", "type": "string", @@ -13661,7 +14479,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached" + "description": "The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached" }, { "name": "filter", @@ -13709,7 +14527,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of messages to be returned" + "description": "The maximum number of messages to be returned" } ], "is_synchronous": false, @@ -13766,6 +14584,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getChatScheduledMessages", + "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)", + "class": "Messages", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "removeNotification", "description": "Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user", @@ -13798,7 +14630,7 @@ { "name": "max_notification_id", "type": "int32", - "description": "Maximum identifier of removed notifications" + "description": "The maximum identifier of removed notifications" } ], "is_synchronous": false, @@ -13806,7 +14638,7 @@ }, { "name": "getPublicMessageLink", - "description": "Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with username", + "description": "Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with a username", "class": "PublicMessageLink", "properties": [ { @@ -13877,14 +14709,9 @@ "description": "Identifier of the message to reply to or 0" }, { - "name": "disable_notification", - "type": "Bool", - "description": "Pass true to disable notification for the message. Not supported in secret chats" - }, - { - "name": "from_background", - "type": "Bool", - "description": "Pass true if the message is sent from the background" + "name": "options", + "type": "sendMessageOptions", + "description": "Options to be used to send the message" }, { "name": "reply_markup", @@ -13916,14 +14743,9 @@ "description": "Identifier of a message to reply to or 0" }, { - "name": "disable_notification", - "type": "Bool", - "description": "Pass true to disable notification for the messages. Not supported in secret chats" - }, - { - "name": "from_background", - "type": "Bool", - "description": "Pass true if the messages are sent from the background" + "name": "options", + "type": "sendMessageOptions", + "description": "Options to be used to send the messages" }, { "name": "input_message_contents", @@ -13974,14 +14796,9 @@ "description": "Identifier of a message to reply to or 0" }, { - "name": "disable_notification", - "type": "Bool", - "description": "Pass true to disable notification for the message. Not supported in secret chats" - }, - { - "name": "from_background", - "type": "Bool", - "description": "Pass true if the message is sent from background" + "name": "options", + "type": "sendMessageOptions", + "description": "Options to be used to send the message" }, { "name": "query_id", @@ -14023,14 +14840,9 @@ "description": "Identifiers of the messages to forward" }, { - "name": "disable_notification", - "type": "Bool", - "description": "Pass true to disable notification for the message, doesn't work if messages are forwarded to a secret chat" - }, - { - "name": "from_background", - "type": "Bool", - "description": "Pass true if the messages are sent from the background" + "name": "options", + "type": "sendMessageOptions", + "description": "Options to be used to send the messages" }, { "name": "as_album", @@ -14163,7 +14975,7 @@ }, { "name": "deleteChatMessagesFromUser", - "description": "Deletes all messages sent by the specified user to a chat. Supported only in supergroups; requires can_delete_messages administrator privileges", + "description": "Deletes all messages sent by the specified user to a chat. Supported only for supergroups; requires can_delete_messages administrator privileges", "class": "Ok", "properties": [ { @@ -14435,6 +15247,30 @@ "is_synchronous": false, "type": 3 }, + { + "name": "editMessageSchedulingState", + "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", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "The chat the message belongs to" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "scheduling_state", + "type": "MessageSchedulingState", + "description": "The new message scheduling state. Pass null to send the message immediately" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getTextEntities", "description": "Returns all entities (mentions, hashtags, cashtags, bot commands, URLs, and email addresses) contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously", @@ -14451,7 +15287,7 @@ }, { "name": "parseTextEntities", - "description": "Parses Bold, Italic, Code, Pre, PreCode and TextUrl entities contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously", + "description": "Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously", "class": "FormattedText", "properties": [ { @@ -14569,7 +15405,7 @@ }, { "name": "setPollAnswer", - "description": "Changes user answer to a poll", + "description": "Changes the user answer to a poll. A poll in quiz mode can be answered only once", "class": "Ok", "properties": [ { @@ -14585,7 +15421,41 @@ { "name": "option_ids", "type": "vector\u003cint32\u003e", - "description": "0-based identifiers of options, chosen by the user. Currently user can't choose more than 1 option" + "description": "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" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "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", + "class": "Users", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the poll belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message containing the poll" + }, + { + "name": "option_id", + "type": "int32", + "description": "0-based identifier of the answer option" + }, + { + "name": "offset", + "type": "int32", + "description": "Number of users to skip in the result; must be non-negative" + }, + { + "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" } ], "is_synchronous": false, @@ -14615,6 +15485,59 @@ "is_synchronous": false, "type": 1 }, + { + "name": "getLoginUrlInfo", + "description": "Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button", + "class": "LoginUrlInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message with the button" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier of the message with the button" + }, + { + "name": "button_id", + "type": "int32", + "description": "Button identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getLoginUrl", + "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", + "class": "HttpUrl", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message with the button" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier of the message with the button" + }, + { + "name": "button_id", + "type": "int32", + "description": "Button identifier" + }, + { + "name": "allow_write_access", + "type": "Bool", + "description": "True, if the user allowed the bot to send them messages" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getInlineQueryResults", "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", @@ -14628,7 +15551,7 @@ { "name": "chat_id", "type": "int53", - "description": "Identifier of the chat, where the query was sent" + "description": "Identifier of the chat where the query was sent" }, { "name": "user_location", @@ -15142,6 +16065,11 @@ "name": "description", "type": "string", "description": "Chat description; 0-255 characters" + }, + { + "name": "location", + "type": "chatLocation", + "description": "Chat location if a location-based supergroup is being created" } ], "is_synchronous": false, @@ -15175,6 +16103,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setChatChatList", + "description": "Moves a chat to a different chat list. Current chat list of the chat must ne non-null", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "chat_list", + "type": "ChatList", + "description": "New chat list of the chat" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setChatTitle", "description": "Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The title will not be changed until the request to the server has been completed", @@ -15253,7 +16200,7 @@ }, { "name": "setChatNotificationSettings", - "description": "Changes the notification settings of a chat", + "description": "Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed", "class": "Ok", "properties": [ { @@ -15264,7 +16211,7 @@ { "name": "notification_settings", "type": "chatNotificationSettings", - "description": "New notification settings for the chat" + "description": "New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever" } ], "is_synchronous": false, @@ -15272,7 +16219,7 @@ }, { "name": "toggleChatIsPinned", - "description": "Changes the pinned state of a chat. You can pin up to GetOption(\"pinned_chat_count_max\") non-secret chats and the same number of secret chats", + "description": "Changes the pinned state of a chat. You can pin up to GetOption(\"pinned_chat_count_max\")/GetOption(\"pinned_archived_chat_count_max\") non-secret chats and the same number of secret chats in the main/archive chat list", "class": "Ok", "properties": [ { @@ -15365,6 +16312,63 @@ "is_synchronous": false, "type": 1 }, + { + "name": "setChatDiscussionGroup", + "description": "Changes the discussion group of a channel chat; requires can_change_info rights in the channel if it is specified", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "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)" + }, + { + "name": "discussion_chat_id", + "type": "int53", + "description": "Identifier of a new channel's discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats needs to be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable needs to be used first to change that" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setChatLocation", + "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", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "location", + "type": "chatLocation", + "description": "New location for the chat; must be valid and not null" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setChatSlowModeDelay", + "description": "Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "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" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "pinChatMessage", "description": "Pins a message in a chat; requires can_pin_messages rights", @@ -15476,7 +16480,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; instead, use addChatMember. 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 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", "class": "Ok", "properties": [ { @@ -15498,6 +16502,38 @@ "is_synchronous": false, "type": 1 }, + { + "name": "canTransferOwnership", + "description": "Checks whether the current session can be used to transfer a chat ownership to another user", + "class": "CanTransferOwnershipResult", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "transferChatOwnership", + "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", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "user_id", + "type": "int32", + "description": "Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user" + }, + { + "name": "password", + "type": "string", + "description": "The password of the current user" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getChatMember", "description": "Returns information about a single member of a chat", @@ -15548,8 +16584,8 @@ }, { "name": "getChatAdministrators", - "description": "Returns a list of users who are administrators of the chat", - "class": "Users", + "description": "Returns a list of administrators of the chat with their custom titles", + "class": "ChatAdministrators", "properties": [ { "name": "chat_id", @@ -15639,6 +16675,11 @@ "description": "Changes the order of pinned chats", "class": "Ok", "properties": [ + { + "name": "chat_list", + "type": "ChatList", + "description": "Chat list in which to change the order of pinned chats" + }, { "name": "chat_ids", "type": "vector\u003cint53\u003e", @@ -15784,7 +16825,7 @@ }, { "name": "setFileGenerationProgress", - "description": "Informs TDLib on a file generation prograss", + "description": "Informs TDLib on a file generation progress", "class": "Ok", "properties": [ { @@ -16061,7 +17102,26 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of users to return; up to 100" + "description": "The maximum number of users to return; up to 100" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "addContact", + "description": "Adds a user to the contact list or edits an existing contact by their user identifier", + "class": "Ok", + "properties": [ + { + "name": "contact", + "type": "contact", + "description": "The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored" + }, + { + "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" } ], "is_synchronous": false, @@ -16069,13 +17129,13 @@ }, { "name": "importContacts", - "description": "Adds new contacts or edits existing contacts; contacts' user identifiers are ignored", + "description": "Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored", "class": "ImportedContacts", "properties": [ { "name": "contacts", "type": "vector\u003ccontact\u003e", - "description": "The list of contacts to import or edit, contact's vCard are ignored and are not imported" + "description": "The list of contacts to import or edit; contacts' vCard are ignored and are not imported" } ], "is_synchronous": false, @@ -16102,7 +17162,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of users to be returned" + "description": "The maximum number of users to be returned" } ], "is_synchronous": false, @@ -16152,6 +17212,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "sharePhoneNumber", + "description": "Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber", + "class": "Ok", + "properties": [ + { + "name": "user_id", + "type": "int32", + "description": "Identifier of the user with whom to share the phone number. The user must be a mutual contact" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getUserProfilePhotos", "description": "Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already", @@ -16170,7 +17244,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of photos to be returned; up to 100" + "description": "The maximum number of photos to be returned; up to 100" } ], "is_synchronous": false, @@ -16189,7 +17263,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of stickers to be returned" + "description": "The maximum number of stickers to be returned" } ], "is_synchronous": false, @@ -16208,7 +17282,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of stickers to be returned" + "description": "The maximum number of stickers to be returned" } ], "is_synchronous": false, @@ -16246,7 +17320,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of sticker sets to return" + "description": "The maximum number of sticker sets to return" } ], "is_synchronous": false, @@ -16320,7 +17394,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of sticker sets to return" + "description": "The maximum number of sticker sets to return" } ], "is_synchronous": false, @@ -16527,6 +17601,11 @@ "name": "exact_match", "type": "Bool", "description": "True, if only emojis, which exactly match text needs to be returned" + }, + { + "name": "input_language_code", + "type": "string", + "description": "IETF language tag of the user's input language; may be empty if unknown" } ], "is_synchronous": false, @@ -16603,7 +17682,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of hashtags to be returned" + "description": "The maximum number of hashtags to be returned" } ], "is_synchronous": false, @@ -16834,7 +17913,7 @@ }, { "name": "setSupergroupUsername", - "description": "Changes the username of a supergroup or channel, requires creator privileges in the supergroup or channel", + "description": "Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel", "class": "Ok", "properties": [ { @@ -16963,7 +18042,7 @@ }, { "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 creator privileges in the supergroup or channel. Chats with more than 1000 members can't be deleted using this method", + "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": [ { @@ -16977,7 +18056,7 @@ }, { "name": "closeSecretChat", - "description": "Closes a secret chat, effectively transfering its state to secretChatStateClosed", + "description": "Closes a secret chat, effectively transferring its state to secretChatStateClosed", "class": "Ok", "properties": [ { @@ -16991,7 +18070,7 @@ }, { "name": "getChatEventLog", - "description": "Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only in supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id)", + "description": "Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id)", "class": "ChatEvents", "properties": [ { @@ -17012,7 +18091,7 @@ { "name": "limit", "type": "int32", - "description": "Maximum number of events to return; up to 100" + "description": "The maximum number of events to return; up to 100" }, { "name": "filters", @@ -17216,7 +18295,7 @@ { "name": "background", "type": "InputBackground", - "description": "The input background to use, null for solid backgrounds" + "description": "The input background to use, null for filled backgrounds" }, { "name": "type", @@ -17240,7 +18319,7 @@ { "name": "background_id", "type": "int64", - "description": "The background indentifier" + "description": "The background identifier" } ], "is_synchronous": false, @@ -17559,33 +18638,14 @@ "type": 2 }, { - "name": "getChatReportSpamState", - "description": "Returns information on whether the current chat can be reported as spam", - "class": "ChatReportSpamState", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - } - ], - "is_synchronous": false, - "type": 2 - }, - { - "name": "changeChatReportSpamState", - "description": "Reports to the server whether a chat is a spam chat or not. Can be used only if ChatReportSpamState.can_report_spam is true. After this request, ChatReportSpamState.can_report_spam becomes false forever", + "name": "removeChatActionBar", + "description": "Removes a chat action bar without any other action", "class": "Ok", "properties": [ { "name": "chat_id", "type": "int53", "description": "Chat identifier" - }, - { - "name": "is_spam_chat", - "type": "Bool", - "description": "If true, the chat will be reported as spam; otherwise it will be marked as not spam" } ], "is_synchronous": false, @@ -17593,7 +18653,7 @@ }, { "name": "reportChat", - "description": "Reports a chat to the Telegram moderators. Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by moderators", + "description": "Reports a chat to the Telegram moderators. Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by moderators, or when the report is done from the chat action bar", "class": "Ok", "properties": [ { @@ -17617,7 +18677,7 @@ }, { "name": "getChatStatisticsUrl", - "description": "Returns an HTTP URL with the chat statistics. Currently this method can be used only for channels", + "description": "Returns an HTTP URL with the chat statistics. Currently this method can be used only for channels. Can be used only if SupergroupFullInfo.can_view_statistics == true", "class": "HttpUrl", "properties": [ { @@ -17647,7 +18707,7 @@ { "name": "chat_limit", "type": "int32", - "description": "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 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" } ], "is_synchronous": false, @@ -18608,7 +19668,7 @@ { "name": "verbosity_level", "type": "int32", - "description": "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", @@ -18752,6 +19812,16 @@ "name": "type", "type": "ProxyType", "description": "Proxy type" + }, + { + "name": "dc_id", + "type": "int32", + "description": "Identifier of a datacenter, with which to test connection" + }, + { + "name": "timeout", + "type": "double", + "description": "The maximum overall timeout for the request" } ], "is_synchronous": false, diff --git a/data/td_api.tl b/data/td_api.tl index 1ef5a6b..99ec8b5 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -63,17 +63,18 @@ authenticationCodeInfo phone_number:string type:AuthenticationCodeType next_type emailAddressAuthenticationCodeInfo email_address_pattern:string length:int32 = EmailAddressAuthenticationCodeInfo; -//@description Represents a part of the text that needs to be formatted in some unusual way @offset Offset of the entity in UTF-16 code points @length Length of the entity, in UTF-16 code points @type Type of the entity +//@description Represents a part of the text that needs to be formatted in some unusual way @offset Offset of the entity in UTF-16 code units @length Length of the entity, in UTF-16 code units @type Type of the entity textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; //@description Contains a list of text entities @entities List of text entities textEntities entities:vector = TextEntities; -//@description A text with some entities @text The text @entities Entities contained in the text +//@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. +//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other formattedText text:string entities:vector = FormattedText; -//@description Contains Telegram terms of service @text Text of the terms of service @min_user_age Minimum age of a user to be able to accept the terms; 0 if any @show_popup True, if a blocking popup with terms of service must be shown to the user +//@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if any @show_popup True, if a blocking popup with terms of service must be shown to the user termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfService; @@ -85,12 +86,15 @@ authorizationStateWaitTdlibParameters = AuthorizationState; //@description TDLib needs an encryption key to decrypt the local database @is_encrypted True, if the database is currently encrypted authorizationStateWaitEncryptionKey is_encrypted:Bool = AuthorizationState; -//@description TDLib needs the user's phone number to authorize +//@description TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options authorizationStateWaitPhoneNumber = AuthorizationState; //@description TDLib needs the user's authentication code to authorize @code_info Information about the authorization code that was sent authorizationStateWaitCode code_info:authenticationCodeInfo = AuthorizationState; +//@description The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link @link A tg:// URL for the QR code. The link will be updated frequently +authorizationStateWaitOtherDeviceConfirmation link:string = AuthorizationState; + //@description The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration @terms_of_service Telegram terms of service authorizationStateWaitRegistration terms_of_service:termsOfService = AuthorizationState; @@ -137,12 +141,14 @@ temporaryPasswordState has_password:Bool valid_for:int32 = TemporaryPasswordStat localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_active:Bool is_downloading_completed:Bool download_offset:int32 downloaded_prefix_size:int32 downloaded_size:int32 = LocalFile; //@description Represents a remote file -//@id Remote file identifier; may be empty. Can be used across application restarts or even from other devices for the current user. 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. +//@id Remote file identifier; may be empty. Can be used across application restarts or even from other devices for the current user. Uniquely identifies a file, but a file can have a lot of different valid identifiers. +//-If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. //-If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the client with the HTTP URL in the original_path and "#url#" as the conversion string. Clients should generate the file by downloading it to the specified location +//@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 -remoteFile id:string is_uploading_active:Bool is_uploading_completed:Bool uploaded_size:int32 = RemoteFile; +remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_completed:Bool uploaded_size:int32 = RemoteFile; //@description Represents a file //@id Unique file identifier @@ -158,7 +164,9 @@ file id:int32 size:int32 expected_size:int32 local:localFile remote:remoteFile = //@description A file defined by its unique ID @id Unique file identifier inputFileId id:int32 = InputFile; -//@description A file defined by its remote ID @id Remote file identifier +//@description A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. +//-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client +//@id Remote file identifier inputFileRemote id:string = InputFile; //@description A file defined by a local path @path Local path to the file @@ -203,12 +211,21 @@ maskPosition point:MaskPoint x_shift:double y_shift:double scale:double = MaskPo pollOption text:string voter_count:int32 vote_percentage:int32 is_chosen:Bool is_being_chosen:Bool = PollOption; +//@class PollType @description Describes the type of a poll + +//@description A regular poll @allow_multiple_answers True, if multiple answer options can be chosen simultaneously +pollTypeRegular allow_multiple_answers:Bool = PollType; + +//@description A poll in quiz mode, which has exactly one correct answer option and can be answered only once @correct_option_id 0-based identifier of the correct answer option; -1 for a yet unanswered poll +pollTypeQuiz correct_option_id:int32 = PollType; + + //@description Describes an animation file. The animation must be encoded in GIF or MPEG4 format @duration Duration of the animation, in seconds; as defined by the sender @width Width of the animation @height Height of the animation //@file_name Original name of the file; as defined by the sender @mime_type MIME type of the file, usually "image/gif" or "video/mp4" //@minithumbnail Animation minithumbnail; may be null @thumbnail Animation thumbnail; may be null @animation File containing the animation animation duration:int32 width:int32 height:int32 file_name:string mime_type:string minithumbnail:minithumbnail thumbnail:photoSize animation:file = Animation; -//@description Describes an audio file. Audio is usually in MP3 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 +//@description Describes an audio file. Audio is usually in MP3 or M4A format @duration Duration of the audio, in seconds; as defined by the sender @title Title of the audio; as defined by the sender @performer Performer of the audio; as defined by the sender //@file_name Original name of the file; as defined by the sender @mime_type The MIME type of the file; as defined by the sender @album_cover_minithumbnail The minithumbnail of the album cover; may be null @album_cover_thumbnail The thumbnail of the album cover; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null @audio File containing the audio audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:photoSize audio:file = Audio; @@ -224,7 +241,7 @@ photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector = Ph sticker set_id:int64 width:int32 height:int32 emoji:string is_animated:Bool is_mask:Bool mask_position:maskPosition thumbnail:photoSize 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 photo +//@file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender @has_stickers True, if stickers were added to the video //@supports_streaming True, if the video should be tried to be streamed @minithumbnail Video minithumbnail; may be null @thumbnail Video thumbnail; as defined by the sender; may be null @video File containing the video video duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool supports_streaming:Bool minithumbnail:minithumbnail thumbnail:photoSize video:file = Video; @@ -249,8 +266,10 @@ venue location:location title:string address:string provider:string id:string ty //@param_description Game description @photo Game photo @animation Game animation; may be null game id:int64 short_name:string title:string text:formattedText description:string photo:photo animation:animation = Game; -//@description Describes a poll @id Unique poll identifier @question Poll question, 1-255 characters @options List of poll answer options @total_voter_count Total number of voters, participating in the poll @is_closed True, if the poll is closed -poll id:int64 question:string options:vector total_voter_count:int32 is_closed:Bool = Poll; +//@description Describes a poll @id Unique poll identifier @question Poll question, 1-255 characters @options List of poll answer options +//@total_voter_count Total number of voters, participating in the poll @recent_voter_user_ids User identifiers of recent voters, if the poll is non-anonymous +//@is_anonymous True, if the poll is anonymous @type Type of the poll @is_closed True, if the poll is closed +poll id:int64 question:string options:vector total_voter_count:int32 recent_voter_user_ids:vector is_anonymous:Bool type:PollType is_closed:Bool = Poll; //@description Describes a user profile photo @id Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of userProfilePhotos @@ -261,24 +280,12 @@ profilePhoto id:int64 small:file big:file = ProfilePhoto; chatPhoto small:file big:file = ChatPhoto; -//@class LinkState @description Represents the relationship between user A and user B. For incoming_link, user A is the current user; for outgoing_link, user B is the current user - -//@description The phone number of user A is not known to user B -linkStateNone = LinkState; - -//@description The phone number of user A is known but that number has not been saved to the contact list of user B -linkStateKnowsPhoneNumber = LinkState; - -//@description The phone number of user A has been saved to the contact list of user B -linkStateIsContact = LinkState; - - -//@class UserType @description Represents the type of the user. The following types are possible: regular users, deleted users and bots +//@class UserType @description Represents the type of a user. The following types are possible: regular users, deleted users and bots //@description A regular user userTypeRegular = UserType; -//@description A deleted user or deleted bot. No information on the user besides the user_id is available. It is not possible to perform any active actions on this type of user +//@description A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user userTypeDeleted = UserType; //@description A bot (see https://core.telegram.org/bots) @can_join_groups True, if the bot can be invited to basic group and supergroup chats @@ -286,7 +293,7 @@ userTypeDeleted = UserType; //@is_inline True, if the bot supports inline queries @inline_query_placeholder Placeholder for inline queries (displayed on the client input field) @need_location True, if the location of the user should be sent with every inline query to this bot 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_id is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type +//@description No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type userTypeUnknown = UserType; @@ -297,19 +304,25 @@ botCommand command:string description:string = BotCommand; botInfo description:string commands:vector = BotInfo; +//@description Represents a location to which a chat is connected @location The location @address Location address; 1-64 characters, as defined by the chat owner +chatLocation location:location address:string = ChatLocation; + + //@description Represents a user @id User identifier @first_name First name of the user @last_name Last name of the user @username Username of the user //@phone_number Phone number of the user @status Current online status of the user @profile_photo Profile photo of the user; may be null -//@outgoing_link Relationship from the current user to the other user @incoming_link Relationship from the other user to the current user +//@is_contact The user is a contact of the current user +//@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user //@is_verified True, if the user is verified @is_support True, if the user is Telegram support account -//@restriction_reason If non-empty, it contains the reason why access to this user must be restricted. The format of the string is "{type}: {description}". -//-{type} contains the type of the restriction and at least one of the suffixes "-all", "-ios", "-android", or "-wp", which describe the platforms on which access should be restricted. (For example, "terms-ios-android". {description} contains a human-readable description of the restriction, which can be shown to the user) +//@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted //@is_scam True, if many users reported this user as a scam //@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser @type Type of the user @language_code IETF language tag of the user's language; only available to bots -user id:int32 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto outgoing_link:LinkState incoming_link:LinkState is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool have_access:Bool type:UserType language_code:string = User; +user id:int32 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool have_access:Bool type:UserType language_code:string = User; -//@description Contains full information about a user (except the full list of profile photos) @is_blocked True, if the user is blacklisted by the current user @can_be_called True, if the user can be called @has_private_calls True, if the user can't be called due to their privacy settings +//@description Contains full information about a user (except the full list of profile photos) @is_blocked True, if the user is blacklisted by the current user +//@can_be_called True, if the user can be called @has_private_calls True, if the user can't be called due to their privacy settings +//@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used //@bio A short user bio @share_text For bots, the text that is included with the link when users share the bot @group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user @bot_info If the user is a bot, information about the bot; may be null -userFullInfo is_blocked:Bool can_be_called:Bool has_private_calls:Bool bio:string share_text:string group_in_common_count:int32 bot_info:botInfo = UserFullInfo; +userFullInfo is_blocked:Bool can_be_called:Bool has_private_calls:Bool need_phone_number_privacy_exception:Bool bio:string share_text:string group_in_common_count:int32 bot_info:botInfo = UserFullInfo; //@description Contains full information about a user profile photo @id Unique user profile photo identifier @added_date Point in time (Unix timestamp) when the photo has been added @sizes Available variants of the user photo, in different sizes userProfilePhoto id:int64 added_date:int32 sizes:vector = UserProfilePhoto; @@ -321,6 +334,13 @@ userProfilePhotos total_count:int32 photos:vector = UserProfil 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; + +//@description Represents a list of chat administrators @administrators A list of chat administrators +chatAdministrators administrators:vector = ChatAdministrators; + + //@description Describes actions that a user is allowed to take in a chat //@can_send_messages True, if the user can send text messages, contacts, locations, and venues //@can_send_media_messages True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions @@ -335,10 +355,13 @@ 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 creator of a chat and has all the administrator privileges @is_member True, if the user is a member of the chat -chatMemberStatusCreator is_member:Bool = ChatMemberStatus; +//@description The user is the owner of a chat and has all the administrator privileges +//@custom_title A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only +//@is_member True, if the user is a member of the chat +chatMemberStatusCreator custom_title:string is_member:Bool = ChatMemberStatus; //@description The user is a member of a chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, and ban unprivileged members. In supergroups and channels, there are more detailed options for administrator privileges +//@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only //@can_be_edited True, if the current user can edit the administrator privileges for the called user //@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 @@ -347,8 +370,8 @@ chatMemberStatusCreator is_member:Bool = ChatMemberStatus; //@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_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 him -chatMemberStatusAdministrator can_be_edited:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool = ChatMemberStatus; +//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them +chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool = ChatMemberStatus; //@description The user is a member of a chat, without any additional privileges or restrictions chatMemberStatusMember = ChatMemberStatus; @@ -380,7 +403,7 @@ chatMembers total_count:int32 members:vector = ChatMembers; //@description Returns contacts of the user chatMembersFilterContacts = ChatMembersFilter; -//@description Returns the creator and administrators +//@description Returns the owner and administrators chatMembersFilterAdministrators = ChatMembersFilter; //@description Returns all chat members, including restricted chat members @@ -404,7 +427,7 @@ supergroupMembersFilterRecent = SupergroupMembersFilter; //@description Returns contacts of the user, which are members of the supergroup or channel @query Query to search for supergroupMembersFilterContacts query:string = SupergroupMembersFilter; -//@description Returns the creator and administrators +//@description Returns the owner and administrators supergroupMembersFilterAdministrators = SupergroupMembersFilter; //@description Used to search for supergroup or channel members via a (string) query @query Query to search for @@ -428,7 +451,7 @@ supergroupMembersFilterBots = SupergroupMembersFilter; //@upgraded_to_supergroup_id Identifier of the supergroup to which this group was upgraded; 0 if none basicGroup id:int32 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int32 = BasicGroup; -//@description Contains full information about a basic group @param_description Group description @creator_user_id User identifier of the creator of the group; 0 if unknown @members Group members @invite_link Invite link for this group; available only for the group creator and only after it has been generated at least once +//@description Contains full information about a basic group @param_description Group description @creator_user_id User identifier of the creator of the group; 0 if unknown @members Group members @invite_link Invite link for this group; available only after it has been generated at least once and only for the group creator basicGroupFullInfo description:string creator_user_id:int32 members:vector invite_link:string = BasicGroupFullInfo; @@ -436,15 +459,17 @@ basicGroupFullInfo description:string creator_user_id:int32 members:vector= 66 +//@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 other client. 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; @@ -506,8 +536,8 @@ messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:stri //@description Contains information about a forwarded message //@origin Origin of a forwarded message //@date Point in time (Unix timestamp) when the message was originally sent -//@from_chat_id For messages forwarded to the chat with the current user (saved messages) or to the channel discussion supergroup, the identifier of the chat from which the message was forwarded last time; 0 if unknown -//@from_message_id For messages forwarded to the chat with the current user (saved messages) or to the channel discussion supergroup, the identifier of the original message from which the new message was forwarded last time; 0 if unknown +//@from_chat_id For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown +//@from_message_id For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown messageForwardInfo origin:MessageForwardOrigin date:int32 from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; @@ -526,8 +556,9 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool r //@sender_user_id Identifier of the user who sent the message; 0 if unknown. Currently, it is unknown for channel posts and for channel posts automatically forwarded to discussion group //@chat_id Chat identifier //@sending_state Information about the sending state of the message; may be null +//@scheduling_state Information about the scheduling state of the message; may be null //@is_outgoing True, if the message is outgoing -//@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows, whether editMessageLiveLocation or stopPoll can be used with this message by the client +//@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the client //@can_be_forwarded True, if the message can be forwarded //@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it //@can_be_deleted_for_all_users True, if the message can be deleted for all users @@ -543,9 +574,10 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool r //@author_signature For channel posts, optional author signature //@views Number of times this message was viewed //@media_album_id Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums +//@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null -message id:int53 sender_user_id:int32 chat_id:int53 sending_state:MessageSendingState is_outgoing:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo reply_to_message_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int32 author_signature:string views:int32 media_album_id:int64 content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_user_id:int32 chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo reply_to_message_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int32 author_signature:string views:int32 media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; //@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; @@ -602,9 +634,19 @@ chatTypeSupergroup supergroup_id:int32 is_channel:Bool = ChatType; chatTypeSecret secret_chat_id:int32 user_id:int32 = ChatType; +//@class ChatList @description Describes a list of chats + +//@description A main list of chats +chatListMain = ChatList; + +//@description A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives +chatListArchive = ChatList; + + //@description A chat. (Can be a private chat, basic group, supergroup, or secret chat) //@id Chat unique identifier //@type Type of the chat +//@chat_list A chat list to which the chat belongs; may be null //@title Chat title //@photo Chat photo; may be null //@permissions Actions that non-administrator chat members are allowed to take in the chat @@ -613,6 +655,7 @@ chatTypeSecret secret_chat_id:int32 user_id:int32 = ChatType; //@is_pinned True, if the chat is pinned //@is_marked_as_unread True, if the chat is marked as unread //@is_sponsored True, if the chat is sponsored by the user's MTProxy server +//@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 @@ -622,16 +665,24 @@ chatTypeSecret secret_chat_id:int32 user_id:int32 = ChatType; //@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 //@pinned_message_id Identifier of the pinned message in the chat; 0 if none //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null -//@client_data Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if a message database is used -chat id:int53 type:ChatType title:string photo:chatPhoto permissions:chatPermissions last_message:message order:int64 is_pinned:Bool is_marked_as_unread:Bool is_sponsored: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 pinned_message_id:int53 reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +//@client_data Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if the message database is used +chat id:int53 type:ChatType chat_list:ChatList title:string photo:chatPhoto permissions:chatPermissions last_message:message order:int64 is_pinned:Bool is_marked_as_unread:Bool is_sponsored:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings action_bar:ChatActionBar pinned_message_id:int53 reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats @chat_ids List of chat identifiers chats chat_ids:vector = Chats; +//@description Describes a chat located nearby @chat_id Chat identifier @distance Distance to the chat location in meters +chatNearby chat_id:int53 distance:int32 = ChatNearby; + +//@description Represents a list of chats located nearby @users_nearby List of users nearby @supergroups_nearby List of location-based supergroups nearby +chatsNearby users_nearby:vector supergroups_nearby:vector = ChatsNearby; + + //@description Contains a chat invite link @invite_link Chat invite link chatInviteLink invite_link:string = ChatInviteLink; @@ -642,10 +693,37 @@ chatInviteLink invite_link:string = ChatInviteLink; //@photo Chat photo; may be null //@member_count Number of members //@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 a channel with a username +//@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 type:ChatType title:string photo:chatPhoto 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 +publicChatTypeHasUsername = PublicChatType; + +//@description The chat is public, because it is a location-based supergroup +publicChatTypeIsLocationBased = PublicChatType; + + +//@class ChatActionBar @description Describes actions which should be possible to do through a chat action bar + +//@description The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam +chatActionBarReportSpam = ChatActionBar; + +//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation +chatActionBarReportUnrelatedLocation = ChatActionBar; + +//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be added to the contact list using the method addContact, or the other user can be blocked using the method blockUser +chatActionBarReportAddBlock = ChatActionBar; + +//@description The chat is a private or secret chat and the other user can be added to the contact list using the method addContact +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; + + //@class KeyboardButtonType @description Describes a keyboard button type //@description A simple button, with text that should be sent when the button is pressed @@ -657,6 +735,9 @@ keyboardButtonTypeRequestPhoneNumber = KeyboardButtonType; //@description A button that sends the user's location when pressed; available only in private chats keyboardButtonTypeRequestLocation = KeyboardButtonType; +//@description A button that allows the user to create and send a poll when pressed; available only in private chats @force_regular If true, only regular polls must be allowed to create @force_quiz If true, only polls in quiz mode must be allowed to create +keyboardButtonTypeRequestPoll force_regular:Bool force_quiz:Bool = KeyboardButtonType; + //@description Represents a single button in a bot keyboard @text Text of the button @type Type of the button keyboardButton text:string type:KeyboardButtonType = KeyboardButton; @@ -667,7 +748,7 @@ 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 HTTP URL to open @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages +//@description A button that opens a specified URL and automatically logs in in current user if they allowed to do that @url An HTTP URL to open @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages inlineKeyboardButtonTypeLoginUrl url:string id:int32 forward_text:string = InlineKeyboardButtonType; //@description A button that sends a special callback query to a bot @data Data to be sent to the bot via a callback query @@ -709,6 +790,16 @@ replyMarkupShowKeyboard rows:vector> resize_keyboard:Bool replyMarkupInlineKeyboard rows:vector> = ReplyMarkup; +//@class LoginUrlInfo @description Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl + +//@description An HTTP url needs to be open @url The URL to open @skip_confirm True, if there is no need to show an ordinary open URL confirm +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; + + //@class RichText @description Describes a text object inside an instant-view web page //@description A plain text @text Text @@ -723,14 +814,14 @@ richTextItalic text:RichText = RichText; //@description An underlined rich text @text Text richTextUnderline text:RichText = RichText; -//@description A strike-through rich text @text Text +//@description A strikethrough rich text @text Text richTextStrikethrough text:RichText = RichText; //@description A fixed-width rich text @text Text richTextFixed text:RichText = RichText; -//@description A rich text URL link @text Text @url URL -richTextUrl text:RichText url:string = RichText; +//@description A rich text URL link @text Text @url URL @is_cached True, if the URL has cached instant view server-side +richTextUrl text:RichText url:string is_cached:Bool = RichText; //@description A rich text email link @text Text @email_address Email address richTextEmailAddress text:RichText email_address:string = RichText; @@ -787,7 +878,7 @@ pageBlockVerticalAlignmentMiddle = PageBlockVerticalAlignment; //@description The content should be bottom-aligned pageBlockVerticalAlignmentBottom = PageBlockVerticalAlignment; -//@description Represents a cell of a table @text Cell text @is_header True, if it is a header cell +//@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 //@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; @@ -853,6 +944,9 @@ 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 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 +pageBlockVoiceNote voice_note:voiceNote caption:pageBlockCaption = PageBlock; + //@description A page cover @cover Cover pageBlockCover cover:PageBlock = PageBlock; @@ -892,9 +986,13 @@ pageBlockMap location:location zoom:int32 width:int32 height:int32 caption:pageB webPageInstantView page_blocks:vector version:int32 url:string is_rtl:Bool is_full:Bool = WebPageInstantView; -//@description Describes a web page preview @url Original URL of the link @display_url URL to display +//@description Describes a web page preview +//@url Original URL of the link +//@display_url URL to display //@type Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else -//@site_name Short name of the site (e.g., Google Docs, App Store) @title Title of the content @param_description Description of the content +//@site_name Short name of the site (e.g., Google Docs, App Store) +//@title Title of the content +//@param_description Description of the content //@photo Image representing the content; may be null //@embed_url URL to show in the embedded preview //@embed_type MIME type of the embedded preview, (e.g., text/html or video/mp4) @@ -1222,50 +1320,50 @@ inputPassportElementError type:PassportElementType message:string source:InputPa //@description A text message @text Text of the message @web_page A preview of the web page that's mentioned in the text; may be null messageText text:formattedText web_page:webPage = MessageContent; -//@description An animation message (GIF-style). @animation Message content @caption Animation caption @is_secret True, if the animation thumbnail must be blurred and the animation must be shown only while tapped +//@description An animation message (GIF-style). @animation The animation description @caption Animation caption @is_secret True, if the animation thumbnail must be blurred and the animation must be shown only while tapped messageAnimation animation:animation caption:formattedText is_secret:Bool = MessageContent; -//@description An audio message @audio Message content @caption Audio caption +//@description An audio message @audio The audio description @caption Audio caption messageAudio audio:audio caption:formattedText = MessageContent; -//@description A document message (general file) @document Message content @caption Document caption +//@description A document message (general file) @document The document description @caption Document caption messageDocument document:document caption:formattedText = MessageContent; -//@description A photo message @photo Message content @caption Photo caption @is_secret True, if the photo must be blurred and must be shown only while tapped +//@description A photo message @photo The photo description @caption Photo caption @is_secret True, if the photo must be blurred and must be shown only while tapped messagePhoto photo:photo caption:formattedText is_secret:Bool = MessageContent; //@description An expired photo message (self-destructed after TTL has elapsed) messageExpiredPhoto = MessageContent; -//@description A sticker message @sticker Message content +//@description A sticker message @sticker The sticker description messageSticker sticker:sticker = MessageContent; -//@description A video message @video Message content @caption Video caption @is_secret True, if the video thumbnail must be blurred and the video must be shown only while tapped +//@description A video message @video The video description @caption Video caption @is_secret True, if the video thumbnail must be blurred and the video must be shown only while tapped messageVideo video:video caption:formattedText is_secret:Bool = MessageContent; //@description An expired video message (self-destructed after TTL has elapsed) messageExpiredVideo = MessageContent; -//@description A video note message @video_note Message content @is_viewed True, if at least one of the recipients has viewed the video note @is_secret True, if the video note thumbnail must be blurred and the video note must be shown only while tapped +//@description A video note message @video_note The video note description @is_viewed True, if at least one of the recipients has viewed the video note @is_secret True, if the video note thumbnail must be blurred and the video note must be shown only while tapped messageVideoNote video_note:videoNote is_viewed:Bool is_secret:Bool = MessageContent; -//@description A voice note message @voice_note Message content @caption Voice note caption @is_listened True, if at least one of the recipients has listened to the voice note +//@description A voice note message @voice_note The voice note description @caption Voice note caption @is_listened True, if at least one of the recipients has listened to the voice note messageVoiceNote voice_note:voiceNote caption:formattedText is_listened:Bool = MessageContent; -//@description A message with a location @location Message content @live_period Time relative to the message sent date until which the location can be updated, in seconds +//@description A message with a location @location The location description @live_period Time relative to the message sent date until which the location can be updated, in seconds //@expires_in Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes messageLocation location:location live_period:int32 expires_in:int32 = MessageContent; -//@description A message with information about a venue @venue Message content +//@description A message with information about a venue @venue The venue description messageVenue venue:venue = MessageContent; -//@description A message with a user contact @contact Message content +//@description A message with a user contact @contact The contact description messageContact contact:contact = MessageContent; -//@description A message with a game @game Game +//@description A message with a game @game The game description messageGame game:game = MessageContent; -//@description A message with a poll @poll Poll +//@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 @@ -1365,12 +1463,21 @@ textEntityTypeUrl = TextEntityType; //@description An email address textEntityTypeEmailAddress = TextEntityType; +//@description A phone number +textEntityTypePhoneNumber = TextEntityType; + //@description A bold text textEntityTypeBold = TextEntityType; //@description An italic text textEntityTypeItalic = TextEntityType; +//@description An underlined text +textEntityTypeUnderline = TextEntityType; + +//@description A strikethrough text +textEntityTypeStrikethrough = TextEntityType; + //@description Text that must be formatted as if inside a code HTML tag textEntityTypeCode = TextEntityType; @@ -1386,18 +1493,31 @@ 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; -//@description A phone number -textEntityTypePhoneNumber = TextEntityType; - //@description A thumbnail to be sent along with a file; should be in JPEG or WEBP format for stickers, and less than 200 kB in size @thumbnail Thumbnail file to send. Sending thumbnails by file_id is currently not supported //@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; +//@class MessageSchedulingState @description Contains information about the time when a scheduled message will be sent + +//@description The message will be sent at the specified date @send_date Date the message will be sent. The date must be within 367 days in the future +messageSchedulingStateSendAtDate send_date:int32 = MessageSchedulingState; + +//@description The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known +messageSchedulingStateSendWhenOnline = MessageSchedulingState; + + +//@description Options to be used when a message is send +//@disable_notification Pass true to disable notification for the message. Must be false if the message is sent to a secret chat +//@from_background Pass true if the message is sent from the background +//@scheduling_state Message scheduling state. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled +sendMessageOptions disable_notification:Bool from_background:Bool scheduling_state:MessageSchedulingState = SendMessageOptions; + + //@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, Code, Pre, PreCode and TextUrl entities are allowed to be specified manually +//@description A text message @text Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually //@disable_web_page_preview True, if rich web page previews for URLs in the message text should be disabled @clear_draft True, if a chat message draft should be deleted inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent; @@ -1429,7 +1549,7 @@ inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int //@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 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 bebetween 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; should be between 60 and 86400 for a live location and 0 otherwise inputMessageLocation location:location live_period:int32 = InputMessageContent; //@description A message with information about a venue @venue Venue to send @@ -1445,8 +1565,9 @@ inputMessageGame bot_user_id:int32 game_short_name:string = InputMessageContent; //@payload The invoice payload @provider_token Payment provider token @provider_data JSON-encoded data about the invoice, which will be shared with the payment provider @start_parameter Unique invoice bot start_parameter for the generation of this invoice inputMessageInvoice invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string = InputMessageContent; -//@description A message with a poll. Polls can't be sent to private or secret chats @question Poll question, 1-255 characters @options List of poll answer options, 2-10 strings 1-100 characters each -inputMessagePoll question:string options:vector = InputMessageContent; +//@description A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot @question Poll question, 1-255 characters @options List of poll answer options, 2-10 strings 1-100 characters each +//@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels @type Type of the poll @is_closed True, if the poll needs to be sent already closed; for bots only +inputMessagePoll question:string options:vector is_anonymous:Bool type:PollType is_closed:Bool = InputMessageContent; //@description A 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 @@ -1599,7 +1720,7 @@ callDiscardReasonDisconnected = CallDiscardReason; callDiscardReasonHungUp = CallDiscardReason; -//@description Specifies the supported call protocols @udp_p2p True, if UDP peer-to-peer connections are supported @udp_reflector True, if connection through UDP reflectors is supported @min_layer Minimum supported API layer; use 65 @max_layer Maximum supported API layer; use 65 +//@description Specifies the supported call protocols @udp_p2p True, if UDP peer-to-peer connections are supported @udp_reflector True, if connection through UDP reflectors is supported @min_layer The minimum supported API layer; use 65 @max_layer The maximum supported API layer; use 65 callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 = CallProtocol; //@description Describes the address of UDP reflectors @id Reflector identifier @ip IPv4 reflector address @ipv6 IPv6 reflector address @port Reflector port number @peer_tag Connection peer tag @@ -1730,8 +1851,8 @@ inputInlineQueryResultLocation id:string location:location live_period:int32 tit //@input_message_content The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessagePhoto, 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 a 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 a TGS sticker (sticker file size must not exceed 5MB) @sticker_width Width of the sticker @sticker_height Height of the sticker +//@description Represents a link to a WEBP 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 inputInlineQueryResultSticker id:string thumbnail_url:string sticker_url:string sticker_width:int32 sticker_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; @@ -1874,12 +1995,21 @@ chatEventPhotoChanged old_photo:photo new_photo:photo = ChatEventAction; //@description The can_invite_users permission of a supergroup chat was toggled @can_invite_users New value of can_invite_users permission chatEventInvitesToggled can_invite_users:Bool = ChatEventAction; +//@description The linked chat of a supergroup was changed @old_linked_chat_id Previous supergroup linked chat identifier @new_linked_chat_id New supergroup linked chat identifier +chatEventLinkedChatChanged old_linked_chat_id:int53 new_linked_chat_id:int53 = ChatEventAction; + +//@description The slow_mode_delay setting of a supergroup was changed @old_slow_mode_delay Previous value of slow_mode_delay @new_slow_mode_delay New value of slow_mode_delay +chatEventSlowModeDelayChanged old_slow_mode_delay:int32 new_slow_mode_delay: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 supergroup sticker set was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; +//@description The supergroup location was changed @old_location Previous location; may be null @new_location New location; may be null +chatEventLocationChanged old_location:chatLocation new_location:chatLocation = ChatEventAction; + //@description The is_all_history_available setting of a supergroup was toggled @is_all_history_available New value of is_all_history_available chatEventIsAllHistoryAvailableToggled is_all_history_available:Bool = ChatEventAction; @@ -1978,21 +2108,31 @@ deviceTokenTizenPush reg_id:string = DeviceToken; pushReceiverId id:int64 = PushReceiverId; -//@class BackgroundType @description Describes a type of a background +//@class BackgroundFill @description Describes a fill of a background + +//@description Describes a solid fill of a background @color A color of the background in the RGB24 format +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 +backgroundFillGradient top_color:int32 bottom_color:int32 rotation_angle:int32 = BackgroundFill; + + +//@class BackgroundType @description Describes the type of a background //@description A wallpaper in JPEG format //@is_blurred True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12 -//@is_moving True, if the background needs to be slightly moved when device is rotated +//@is_moving True, if the background needs to be slightly moved when device is tilted backgroundTypeWallpaper is_blurred:Bool is_moving:Bool = BackgroundType; -//@description A PNG pattern to be combined with the color chosen by the user -//@is_moving True, if the background needs to be slightly moved when device is rotated -//@color Main color of the background in RGB24 format -//@intensity Intensity of the pattern when it is shown above the main background color, 0-100 -backgroundTypePattern is_moving:Bool color:int32 intensity:int32 = 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 +//@is_moving True, if the background needs to be slightly moved when device is tilted +backgroundTypePattern fill:BackgroundFill intensity:int32 is_moving:Bool = BackgroundType; -//@description A solid background @color A color of the background in RGB24 format -backgroundTypeSolid color:int32 = BackgroundType; +//@description A filled background @fill Description of the background fill +backgroundTypeFill fill:BackgroundFill = BackgroundType; //@description Describes a chat background @@ -2000,7 +2140,7 @@ backgroundTypeSolid color:int32 = BackgroundType; //@is_default True, if this is one of default backgrounds //@is_dark True, if the background is dark and is recommended to be used with dark theme //@name Unique background name -//@document Document with the background; may be null. Null only for solid backgrounds +//@document Document with the background; may be null. Null only for filled backgrounds //@type Type of the background background id:int64 is_default:Bool is_dark:Bool name:string document:document type:BackgroundType = Background; @@ -2011,7 +2151,7 @@ backgrounds backgrounds:vector = Backgrounds; //@class InputBackground @description Contains information about background to set //@description A background from a local file -//@background Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file nust be in JPEG format for wallpapers and in PNG format for patterns +//@background Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file must be in JPEG format for wallpapers and in PNG format for patterns inputBackgroundLocal background:InputFile = InputBackground; //@description A background from the server @background_id The background identifier @@ -2022,6 +2162,21 @@ inputBackgroundRemote background_id:int64 = InputBackground; hashtags hashtags:vector = Hashtags; +//@class CanTransferOwnershipResult @description Represents result of checking whether the current session can be used to transfer a chat ownership to another user + +//@description The session can be used +canTransferOwnershipResultOk = CanTransferOwnershipResult; + +//@description The 2-step verification needs to be enabled first +canTransferOwnershipResultPasswordNeeded = CanTransferOwnershipResult; + +//@description The 2-step verification was enabled recently, user needs to wait @retry_after Time left before the session can be used to transfer ownership of a chat, in seconds +canTransferOwnershipResultPasswordTooFresh retry_after:int32 = CanTransferOwnershipResult; + +//@description The session was created recently, user needs to wait @retry_after Time left before the session can be used to transfer ownership of a chat, in seconds +canTransferOwnershipResultSessionTooFresh retry_after:int32 = CanTransferOwnershipResult; + + //@class CheckChatUsernameResult @description Represents result of checking whether a username can be set for a chat //@description The username can be set @@ -2075,8 +2230,8 @@ pushMessageContentLocation is_live:Bool is_pinned:Bool = PushMessageContent; //@description A photo message @photo Message content; may be null @caption Photo caption @is_secret True, if the photo is secret @is_pinned True, if the message is a pinned message with the specified content pushMessageContentPhoto photo:photo caption:string is_secret:Bool is_pinned:Bool = PushMessageContent; -//@description A message with a poll @question Poll question @is_pinned True, if the message is a pinned message with the specified content -pushMessageContentPoll question:string is_pinned:Bool = PushMessageContent; +//@description A message with a poll @question Poll question @is_regular True, if the poll is regular and not in quiz mode @is_pinned True, if the message is a pinned message with the specified content +pushMessageContentPoll question:string is_regular:Bool is_pinned:Bool = PushMessageContent; //@description A screenshot of a message in the chat has been taken pushMessageContentScreenshotTaken = PushMessageContent; @@ -2100,7 +2255,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 himself +//@is_returned True, if the user has returned to the group themself pushMessageContentChatAddMembers member_name:string is_current_user:Bool is_returned:Bool = PushMessageContent; //@description A chat photo was edited @@ -2110,7 +2265,7 @@ pushMessageContentChatChangePhoto = PushMessageContent; pushMessageContentChatChangeTitle title: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 himself +//@is_left True, if the user has left the group themself pushMessageContentChatDeleteMember member_name:string is_current_user:Bool is_left:Bool = PushMessageContent; //@description A new member joined the chat by invite link @@ -2140,7 +2295,7 @@ notificationTypeNewCall call_id:int32 = NotificationType; notificationTypeNewPushMessage message_id:int53 sender_user_id:int32 content:PushMessageContent = NotificationType; -//@class NotificationGroupType @description Describes type of notifications in the group +//@class NotificationGroupType @description Describes the type of notifications in a notification group //@description A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with ordinary unread messages notificationGroupTypeMessages = NotificationGroupType; @@ -2155,8 +2310,9 @@ notificationGroupTypeSecretChat = NotificationGroupType; notificationGroupTypeCalls = NotificationGroupType; -//@description Contains information about a notification @id Unique persistent identifier of this notification @date Notification date @type Notification type -notification id:int32 date:int32 type:NotificationType = Notification; +//@description Contains information about a notification @id Unique persistent identifier of this notification @date Notification date +//@is_silent True, if the notification was initially silent @type Notification type +notification id:int32 date:int32 is_silent:Bool type:NotificationType = Notification; //@description Describes a group of notifications @id Unique persistent auto-incremented from 1 identifier of the notification group @type Type of the group //@chat_id Identifier of a chat to which all notifications in the group belong @@ -2211,18 +2367,24 @@ userPrivacySettingRuleAllowAll = UserPrivacySettingRule; //@description A rule to allow all of a user's contacts to do something userPrivacySettingRuleAllowContacts = UserPrivacySettingRule; -//@description A rule to allow certain specified users to do something @user_ids The user identifiers +//@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; +//@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; + //@description A rule to restrict all users from doing something userPrivacySettingRuleRestrictAll = UserPrivacySettingRule; //@description A rule to restrict all contacts of a user from doing something userPrivacySettingRuleRestrictContacts = UserPrivacySettingRule; -//@description A rule to restrict all specified users from doing something @user_ids The user identifiers +//@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; +//@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; + //@description A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed @rules A list of rules userPrivacySettingRules rules:vector = UserPrivacySettingRules; @@ -2237,6 +2399,9 @@ userPrivacySettingShowProfilePhoto = UserPrivacySetting; //@description A privacy setting for managing whether a link to the user's account is included in forwarded messages userPrivacySettingShowLinkInForwardedMessages = UserPrivacySetting; +//@description A privacy setting for managing whether the user's phone number is visible +userPrivacySettingShowPhoneNumber = UserPrivacySetting; + //@description A privacy setting for managing whether the user can be invited to chats userPrivacySettingAllowChatInvites = UserPrivacySetting; @@ -2246,6 +2411,9 @@ userPrivacySettingAllowCalls = UserPrivacySetting; //@description A privacy setting for managing whether peer-to-peer connections can be used for calls userPrivacySettingAllowPeerToPeerCalls = UserPrivacySetting; +//@description A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all" +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 accountTtl days:int32 = AccountTtl; @@ -2282,9 +2450,6 @@ connectedWebsite id:int64 domain_name:string bot_user_id:int32 browser:string pl connectedWebsites websites:vector = ConnectedWebsites; -//@description Contains information about the availability of the "Report spam" action for a chat @can_report_spam True, if a prompt with the "Report spam" action should be shown to the user -chatReportSpamState can_report_spam:Bool = ChatReportSpamState; - //@class ChatReportReason @description Describes the reason why a chat is reported //@description The chat contains spam messages @@ -2302,11 +2467,14 @@ chatReportReasonChildAbuse = ChatReportReason; //@description The chat contains copyrighted content 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 Contains a public HTTPS link to a message in a public supergroup or channel with a username @link Message link @html HTML-code for embedding the message +//@description Contains a public HTTPS link to a message in a supergroup or channel with a username @link Message link @html HTML-code for embedding the message publicMessageLink link:string html:string = PublicMessageLink; //@description Contains information about a link to a message in a chat @@ -2424,13 +2592,14 @@ 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 Maximum size of a photo file to be auto-downloaded -//@max_video_file_size Maximum size of a video file to be auto-downloaded -//@max_other_file_size Maximum size of other file types to be auto-downloaded +//@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 //@preload_large_videos True, if the beginning of videos 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 preload_large_videos:Bool preload_next_audio:Bool use_less_data_for_calls:Bool = AutoDownloadSettings; +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 //@low Preset with lowest settings; supposed to be used by default when roaming @@ -2477,6 +2646,9 @@ topChatCategoryInlineBots = TopChatCategory; //@description A category containing frequently used chats used for calls topChatCategoryCalls = TopChatCategory; +//@description A category containing frequently used chats used to forward messages +topChatCategoryForwardChats = TopChatCategory; + //@class TMeUrlType @description Describes the type of a URL linking to an internal Telegram entity @@ -2516,13 +2688,14 @@ deepLinkInfo text:formattedText need_update_application:Bool = DeepLinkInfo; //@class TextParseMode @description Describes the way the text should be parsed for TextEntities //@description The text should be parsed in markdown-style -textParseModeMarkdown = TextParseMode; +//@version Version of the parser: 0 or 1 - Bot API Markdown parse mode, 2 - Bot API MarkdownV2 parse mode +textParseModeMarkdown version:int32 = TextParseMode; //@description The text should be parsed in HTML-style textParseModeHTML = TextParseMode; -//@class ProxyType @description Describes the type of the proxy server +//@class ProxyType @description Describes the type of a proxy server //@description A SOCKS5 proxy server @username Username for logging in; may be empty @password Password for logging in; may be empty proxyTypeSocks5 username:string password:string = ProxyType; @@ -2579,9 +2752,16 @@ updateMessageContentOpened chat_id:int53 message_id:int53 = Update; //@description A message with an unread mention was read @chat_id Chat identifier @message_id Message identifier @unread_mention_count The new number of unread mention messages left in the chat updateMessageMentionRead chat_id:int53 message_id:int53 unread_mention_count:int32 = Update; +//@description A message with a live location was viewed. When the update is received, the client is supposed to update the live location +//@chat_id Identifier of the chat with the live location message @message_id Identifier of the message with live location +updateMessageLiveLocationViewed chat_id:int53 message_id:int53 = Update; + //@description A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the client. The chat field changes will be reported through separate updates @chat The chat updateNewChat chat:chat = Update; +//@description The list to which the chat belongs was changed. This update is guaranteed to be sent only when chat.order == 0 and the current or the new chat list is null @chat_id Chat identifier @chat_list The new chat's chat list; may be null +updateChatChatList chat_id:int53 chat_list:ChatList = Update; + //@description The title of a chat was changed @chat_id Chat identifier @title The new chat title updateChatTitle chat_id:int53 title:string = Update; @@ -2591,10 +2771,10 @@ updateChatPhoto chat_id:int53 photo:chatPhoto = Update; //@description Chat permissions was changed @chat_id Chat identifier @permissions The new chat permissions updateChatPermissions chat_id:int53 permissions:chatPermissions = Update; -//@description The last message of a chat was changed. If last_message is null then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case @chat_id Chat identifier @last_message The new last message in the chat; may be null @order New value of the chat order +//@description The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case @chat_id Chat identifier @last_message The new last message in the chat; may be null @order New value of the chat order updateChatLastMessage chat_id:int53 last_message:message order:int64 = Update; -//@description The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned or updateChatDraftMessage might be sent @chat_id Chat identifier @order New value of the order +//@description The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned, updateChatDraftMessage, or updateChatIsSponsored might be sent @chat_id Chat identifier @order New value of the order updateChatOrder chat_id:int53 order:int64 = Update; //@description A chat was pinned or unpinned @chat_id Chat identifier @is_pinned New value of is_pinned @order New value of the chat order @@ -2606,6 +2786,9 @@ updateChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Update; //@description A chat's is_sponsored field has changed @chat_id Chat identifier @is_sponsored New value of is_sponsored @order New value of chat order updateChatIsSponsored chat_id:int53 is_sponsored:Bool order:int64 = Update; +//@description A chat'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 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; @@ -2624,6 +2807,9 @@ updateChatNotificationSettings chat_id:int53 notification_settings:chatNotificat //@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 pinned message was changed @chat_id Chat identifier @pinned_message_id The new identifier of the pinned message; 0 if there is no pinned message in the chat updateChatPinnedMessage chat_id:int53 pinned_message_id:int53 = Update; @@ -2650,10 +2836,10 @@ updateNotification notification_group_id:int32 notification:notification = Updat //@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; -//@description Contains active notifications that was shown on previous application launches. This update is sent only if a message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update @groups Lists of active notification groups +//@description Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update @groups Lists of active notification groups updateActiveNotifications groups:vector = Update; -//@description Describes, whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications +//@description Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications //@have_delayed_notifications True, if there are some delayed notification updates, which will be sent soon //@have_unreceived_notifications True, if there can be some yet unreceived notifications, which are being fetched from the server updateHavePendingNotifications have_delayed_notifications:Bool have_unreceived_notifications:Bool = Update; @@ -2714,13 +2900,16 @@ updateCall call:call = Update; //@description Some privacy setting rules have been changed @setting The privacy setting @rules New privacy rules updateUserPrivacySettingRules setting:UserPrivacySetting rules:userPrivacySettingRules = Update; -//@description Number of unread messages has changed. This update is sent only if a message database is used @unread_count Total number of unread messages @unread_unmuted_count Total number of unread messages in unmuted chats -updateUnreadMessageCount unread_count:int32 unread_unmuted_count:int32 = Update; +//@description Number of unread messages in a chat list has changed. This update is sent only if the message database is used @chat_list The chat list with changed number of unread messages +//@unread_count Total number of unread messages @unread_unmuted_count Total number of unread messages in unmuted chats +updateUnreadMessageCount chat_list:ChatList unread_count:int32 unread_unmuted_count:int32 = Update; -//@description Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if a message database is used +//@description Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used +//@chat_list The chat list with changed number of unread messages +//@total_count Approximate total number of chats in the chat list //@unread_count Total number of unread chats @unread_unmuted_count Total number of unread unmuted chats //@marked_as_unread_count Total number of chats marked as unread @marked_as_unread_unmuted_count Total number of unmuted chats marked as unread -updateUnreadChatCount unread_count:int32 unread_unmuted_count:int32 marked_as_unread_count:int32 marked_as_unread_unmuted_count:int32 = Update; +updateUnreadChatCount chat_list:ChatList total_count:int32 unread_count:int32 unread_unmuted_count:int32 marked_as_unread_count:int32 marked_as_unread_unmuted_count:int32 = Update; //@description An option changed its value @name The option name @value The new option value updateOption name:string value:OptionValue = Update; @@ -2752,14 +2941,20 @@ updateConnectionState state:ConnectionState = Update; //@description New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method should be called with the reason "Decline ToS update" @terms_of_service_id Identifier of the terms of service @terms_of_service The new terms of service updateTermsOfService terms_of_service_id:string terms_of_service:termsOfService = Update; -//@description A new incoming inline query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @user_location User location, provided by the client; may be null @query Text of the query @offset Offset of the first entry to return +//@description List of users nearby has changed. The update is sent only 60 seconds after a successful searchChatsNearby request @users_nearby The new list of users nearby +updateUsersNearby users_nearby:vector = Update; + +//@description A new incoming inline query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @user_location User location, provided by the client; may be null +//@query Text of the query @offset Offset of the first entry to return updateNewInlineQuery id:int64 sender_user_id:int32 user_location:location query:string offset:string = Update; -//@description The user has chosen a result of an inline query; for bots only @sender_user_id Identifier of the user who sent the query @user_location User location, provided by the client; may be null @query Text of the query @result_id Identifier of the chosen result @inline_message_id Identifier of the sent inline message, if known +//@description The user has chosen a result of an inline query; for bots only @sender_user_id Identifier of the user who sent the query @user_location User location, provided by the client; may be null +//@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; -//@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, in which 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 +//@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; //@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 @@ -2779,9 +2974,12 @@ updateNewCustomEvent event:string = Update; //@description A new incoming query; for bots only @id The query identifier @data JSON-serialized query data @timeout Query timeout updateNewCustomQuery id:int64 data:string timeout:int32 = Update; -//@description Information about a poll was updated; for bots only @poll New data about the poll +//@description A poll was updated; for bots only @poll New data about the poll 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; + //@description Contains a list of updates @updates List of updates updates updates:vector = Updates; @@ -2792,7 +2990,7 @@ updates updates:vector = Updates; //@description The log is written to stderr or an OS specific log logStreamDefault = LogStream; -//@description The log is written to a file @path Path to the file to where the internal TDLib log will be written @max_file_size Maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated +//@description The log is written to a file @path Path to the file to where the internal TDLib log will be written @max_file_size The maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated logStreamFile path:string max_file_size:int53 = LogStream; //@description The log is written nowhere @@ -2834,7 +3032,7 @@ setTdlibParameters parameters:tdlibParameters = Ok; 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 or authorizationStateWaitPassword +//-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 setAuthenticationPhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = Ok; @@ -2844,6 +3042,9 @@ resendAuthenticationCode = Ok; //@description Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode @code The verification code received via SMS, Telegram message, phone call, or flash call checkAuthenticationCode code:string = Ok; +//@description Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber @other_user_ids List of user identifiers of other users currently using the client +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 registerUser first_name:string last_name:string = Ok; @@ -2870,7 +3071,11 @@ close = Ok; destroy = Ok; -//@description Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially usefull if TDLib is run in a separate process. This is an offline method. Can be called before authorization +//@description Confirms QR code authentication on another device. Returns created session on success @link A link from a QR code. The link must be scanned by the in-app camera +confirmQrCodeAuthentication link:string = Session; + + +//@description Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially useful if TDLib is run in a separate process. This is an offline method. Can be called before authorization getCurrentState = Updates; @@ -2926,10 +3131,10 @@ getBasicGroup basic_group_id:int32 = BasicGroup; //@description Returns full information about a basic group by its identifier @basic_group_id Basic group identifier getBasicGroupFullInfo basic_group_id:int32 = BasicGroupFullInfo; -//@description Returns information about a supergroup or channel by its identifier. This is an offline request if the current user is not a bot @supergroup_id Supergroup or channel identifier +//@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; -//@description Returns full information about a supergroup or channel by its identifier, cached for up to 1 minute @supergroup_id Supergroup or channel identifier +//@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; //@description Returns information about a secret chat by its identifier. This is an offline request @secret_chat_id Secret chat identifier @@ -2956,13 +3161,17 @@ getMessages chat_id:int53 message_ids:vector = Messages; //@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 @remote_file_id Remote identifier of the file to get @file_type File type, if known +//@description Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. +//-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client +//@remote_file_id Remote identifier of the file to get @file_type File type, if known getRemoteFile remote_file_id:string file_type:FileType = File; -//@description Returns an ordered list of chats. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). -//-For optimal performance the number of returned chats is chosen by the library @offset_order Chat order to return chats from @offset_chat_id Chat identifier to return chats from +//@description Returns an ordered list of chats in a chat list. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). +//-For optimal performance the number of returned chats is chosen by the library +//@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 offset_order:int64 offset_chat_id:int53 limit:int32 = Chats; +getChats chat_list:ChatList offset_order:int64 offset_chat_id:int53 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; @@ -2970,13 +3179,16 @@ searchPublicChat username:string = Chat; //@description Searches public chats by looking for specified query in their username and title. Currently only private chats, supergroups and channels can be public. Returns a meaningful number of results. Returns nothing if the length of the searched username prefix is less than 5. Excludes private chats with contacts and chats from the chat list from the results @query Query to search for searchPublicChats query:string = Chats; -//@description Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the chat list @query Query to search for. If the query is empty, returns up to 20 recently found chats @limit 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 chat list @query Query to search for. If the query is empty, returns up to 20 recently found chats @limit The maximum number of chats to be returned searchChats query:string limit:int32 = Chats; -//@description Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the chat list @query Query to search for @limit Maximum number of chats to be returned +//@description Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the 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 frequently used chats. Supported only if the chat info database is enabled @category Category of chats to be returned @limit Maximum number of chats to be returned; up to 30 +//@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 +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 getTopChats category:TopChatCategory limit:int32 = Chats; //@description Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled @category Category of frequently used chats @chat_id Chat identifier @@ -2994,11 +3206,20 @@ 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 checkChatUsername chat_id:int53 username:string = CheckChatUsernameResult; -//@description Returns a list of public chats with username created by the user -getCreatedPublicChats = Chats; +//@description Returns a list of public chats of the specified type, owned by the user @type Type of the public chats to return +getCreatedPublicChats type:PublicChatType = Chats; + +//@description Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached @type Type of the public chats, for which to check the limit +checkCreatedPublicChatsLimit type:PublicChatType = Ok; + +//@description Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Basic group chats need to be first upgraded to supergroups before they can be set as a discussion group +getSuitableDiscussionChats = Chats; + +//@description Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error +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 Maximum number of chats to be returned; up to 100 +//@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; @@ -3028,17 +3249,18 @@ searchChatMessages chat_id:int53 query:string sender_user_id:int32 from_message_ //@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 //@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_chat_id The chat identifier of the last found message, or 0 for the first request //@offset_message_id The message identifier of the last found message, or 0 for the first request //@limit The maximum number of messages to be returned, up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached -searchMessages query:string offset_date:int32 offset_chat_id:int53 offset_message_id:int53 limit:int32 = Messages; +searchMessages chat_list:ChatList query:string offset_date:int32 offset_chat_id:int53 offset_message_id:int53 limit:int32 = Messages; //@description Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance the number of returned messages is chosen by the library //@chat_id Identifier of the chat in which to search. Specify 0 to search in all secret chats @query Query to search for. If empty, searchChatMessages should be used instead //@from_search_id The identifier from the result of a previous request, use 0 to get results from the last message -//@limit Maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached +//@limit The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached //@filter A filter for the content of messages in the search results searchSecretMessages chat_id:int53 query:string from_search_id:int64 limit:int32 filter:SearchMessagesFilter = FoundMessages; @@ -3047,7 +3269,7 @@ searchSecretMessages chat_id:int53 query:string from_search_id:int64 limit:int32 //@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 searchCallMessages from_message_id:int53 limit:int32 only_missed:Bool = Messages; -//@description Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user @chat_id Chat identifier @limit Maximum number of messages to be returned +//@description Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user @chat_id Chat identifier @limit The maximum number of messages to be returned searchChatRecentLocationMessages chat_id:int53 limit:int32 = Messages; //@description Returns all active live locations that should be updated by the client. The list is persistent across application restarts only if the message database is used @@ -3059,15 +3281,18 @@ getChatMessageByDate chat_id:int53 date:int32 = Message; //@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 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; -//@description Removes a group of active notifications. Needs to be called only if the notification group is removed by the current user @notification_group_id Notification group identifier @max_notification_id Maximum identifier of removed notifications +//@description Removes a group of active notifications. Needs to be called only if the notification group is removed by the current user @notification_group_id Notification group identifier @max_notification_id The maximum identifier of removed notifications removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = Ok; -//@description Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with username +//@description Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with a username //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message //@for_album Pass true if a link for a whole media album should be returned @@ -3082,33 +3307,36 @@ getMessageLink chat_id:int53 message_id:int53 = HttpUrl; getMessageLinkInfo url:string = MessageLinkInfo; -//@description Sends a message. Returns the sent message @chat_id Target chat @reply_to_message_id Identifier of the message to reply to or 0 -//@disable_notification Pass true to disable notification for the message. Not supported in secret chats @from_background Pass true if the message is sent from the background +//@description Sends a message. Returns the sent message +//@chat_id Target chat @reply_to_message_id Identifier of the message to reply to or 0 +//@options Options to be used to send the message //@reply_markup Markup for replying to the message; for bots only @input_message_content The content of the message to be sent -sendMessage chat_id:int53 reply_to_message_id:int53 disable_notification:Bool from_background:Bool reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; +sendMessage chat_id:int53 reply_to_message_id:int53 options:sendMessageOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; -//@description Sends messages grouped together into an album. Currently only photo and video messages can be grouped into an album. Returns sent messages @chat_id Target chat @reply_to_message_id Identifier of a message to reply to or 0 -//@disable_notification Pass true to disable notification for the messages. Not supported in secret chats @from_background Pass true if the messages are sent from the background +//@description Sends messages grouped together into an album. Currently only photo and video messages can be grouped into an album. Returns sent messages +//@chat_id Target chat @reply_to_message_id Identifier of a message to reply to or 0 +//@options Options to be used to send the messages //@input_message_contents Contents of messages to be sent -sendMessageAlbum chat_id:int53 reply_to_message_id:int53 disable_notification:Bool from_background:Bool input_message_contents:vector = Messages; +sendMessageAlbum chat_id:int53 reply_to_message_id:int53 options:sendMessageOptions input_message_contents:vector = Messages; //@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message //@bot_user_id Identifier of the bot @chat_id Identifier of the target chat @parameter A hidden parameter sent to the bot for deep linking purposes (https://core.telegram.org/bots#deep-linking) sendBotStartMessage bot_user_id:int32 chat_id:int53 parameter:string = Message; -//@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message @chat_id Target chat @reply_to_message_id Identifier of a message to reply to or 0 -//@disable_notification Pass true to disable notification for the message. Not supported in secret chats @from_background Pass true if the message is sent from background +//@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message +//@chat_id Target chat @reply_to_message_id Identifier of a message to reply to or 0 +//@options Options to be used to send the message //@query_id Identifier of the inline query @result_id Identifier of the inline result //@hide_via_bot If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and GetOption("venue_search_bot_username") -sendInlineQueryResultMessage chat_id:int53 reply_to_message_id:int53 disable_notification:Bool from_background:Bool query_id:int64 result_id:string hide_via_bot:Bool = Message; +sendInlineQueryResultMessage chat_id:int53 reply_to_message_id:int53 options:sendMessageOptions 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 -//@disable_notification Pass true to disable notification for the message, doesn't work if messages are forwarded to a secret chat @from_background Pass true if the messages are sent from the background +//@options Options to be used to send the messages //@as_album True, if the messages should be grouped into an album after forwarding. For this to work, no more than 10 messages may be forwarded, and all of them must be photo or video messages //@send_copy True, if content of the messages needs to be copied without links to the original messages. Always true if the messages are forwarded to a secret chat //@remove_caption True, if media captions of message copies needs to be removed. Ignored if send_copy is false -forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector disable_notification:Bool from_background:Bool as_album:Bool send_copy:Bool remove_caption:Bool = Messages; +forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector options:sendMessageOptions as_album:Bool send_copy:Bool remove_caption:Bool = Messages; //@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. //-If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message @@ -3128,7 +3356,7 @@ addLocalMessage chat_id:int53 sender_user_id:int32 reply_to_message_id:int53 dis //@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of the messages to be deleted @revoke Pass true to try to delete messages for all chat members. Always true for supergroups, channels and secret chats deleteMessages chat_id:int53 message_ids:vector revoke:Bool = Ok; -//@description Deletes all messages sent by the specified user to a chat. Supported only in supergroups; requires can_delete_messages administrator privileges @chat_id Chat identifier @user_id User identifier +//@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; @@ -3168,11 +3396,14 @@ editInlineMessageCaption inline_message_id:string reply_markup:ReplyMarkup capti //@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 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 +editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; + //@description Returns all entities (mentions, hashtags, cashtags, bot commands, URLs, and email addresses) contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously @text The text in which to look for entites getTextEntities text:string = TextEntities; -//@description Parses Bold, Italic, Code, Pre, PreCode and TextUrl entities contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously @text The text which should be parsed @parse_mode Text parse mode +//@description Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously @text The text which should be parsed @parse_mode Text parse mode parseTextEntities text:string parse_mode:TextParseMode = FormattedText; //@description Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously @file_name The name of the file or path to the file @@ -3195,17 +3426,36 @@ getJsonValue json:string = JsonValue; getJsonString json_value:JsonValue = Text; -//@description Changes user answer to a poll @chat_id Identifier of the chat to which the poll belongs @message_id Identifier of the message containing the poll -//@option_ids 0-based identifiers of options, chosen by the user. Currently user can't choose more than 1 option +//@description Changes the user answer to a poll. A poll in quiz mode can be answered only once +//@chat_id Identifier of the chat to which the poll belongs @message_id Identifier of the message containing the poll +//@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 +//@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 +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 stopPoll chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = 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; + +//@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; + + //@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 +//@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 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 @@ -3285,8 +3535,8 @@ 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; -//@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 -createNewSupergroupChat title:string is_channel:Bool description: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 secret chat. Returns the newly created chat @user_id Identifier of the target user createNewSecretChat user_id:int32 = Chat; @@ -3295,6 +3545,9 @@ createNewSecretChat user_id:int32 = Chat; upgradeBasicGroupChatToSupergroupChat chat_id:int53 = Chat; +//@description Moves a chat to a different chat list. Current chat list of the chat must ne non-null @chat_id Chat identifier @chat_list New chat list of the chat +setChatChatList chat_id:int53 chat_list:ChatList = Ok; + //@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The title will not be changed until the request to the server has been completed //@chat_id Chat identifier @title New title of the chat; 1-128 characters setChatTitle chat_id:int53 title:string = Ok; @@ -3310,10 +3563,11 @@ setChatPermissions chat_id:int53 permissions:chatPermissions = Ok; //@description Changes the draft message in a chat @chat_id Chat identifier @draft_message New draft message; may be null setChatDraftMessage chat_id:int53 draft_message:draftMessage = Ok; -//@description Changes the notification settings of a chat @chat_id Chat identifier @notification_settings New notification settings for the chat +//@description Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed +//@chat_id Chat identifier @notification_settings New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever setChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Ok; -//@description Changes the pinned state of a chat. You can pin up to GetOption("pinned_chat_count_max") non-secret chats and the same number of secret chats @chat_id Chat identifier @is_pinned New value of is_pinned +//@description Changes the pinned state of a chat. You can pin up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") non-secret chats and the same number of secret chats in the main/archive chat list @chat_id Chat identifier @is_pinned New value of is_pinned toggleChatIsPinned chat_id:int53 is_pinned:Bool = Ok; //@description Changes the marked as unread state of a chat @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread @@ -3328,12 +3582,23 @@ setChatClientData chat_id:int53 client_data:string = Ok; //@description Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info rights @chat_id Identifier of the chat @param_description New chat description; 0-255 characters setChatDescription chat_id:int53 description:string = Ok; +//@description Changes the discussion group of a channel chat; requires can_change_info rights in the channel if it is specified @chat_id Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup) @discussion_chat_id Identifier of a new channel's discussion group. Use 0 to remove the discussion group. +//-Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats needs to be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable needs to be used first to change that +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 +setChatSlowModeDelay chat_id:int53 slow_mode_delay:int32 = Ok; + //@description Pins a message in a chat; requires can_pin_messages rights @chat_id Identifier of the chat @message_id Identifier of the new pinned message @disable_notification True, if there should be no notification about the pinned message pinChatMessage chat_id:int53 message_id:int53 disable_notification:Bool = Ok; //@description Removes the pinned message from a chat; requires can_pin_messages rights in the group or channel @chat_id Identifier of the chat unpinChatMessage chat_id:int53 = Ok; + //@description 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 joinChat chat_id:int53 = Ok; @@ -3348,18 +3613,25 @@ addChatMember chat_id:int53 user_id:int32 forward_limit:int32 = Ok; //@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 Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for adding new members to the chat; instead, use addChatMember. 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 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 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; + //@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 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 searchChatMembers chat_id:int53 query:string limit:int32 filter:ChatMembersFilter = ChatMembers; -//@description Returns a list of users who are administrators of the chat @chat_id Chat identifier -getChatAdministrators chat_id:int53 = Users; +//@description Returns a list of administrators of the chat with their custom titles @chat_id Chat identifier +getChatAdministrators chat_id:int53 = ChatAdministrators; //@description Clears draft messages in all chats @exclude_secret_chats If true, local draft messages in secret chats will not be cleared @@ -3379,8 +3651,8 @@ setScopeNotificationSettings scope:NotificationSettingsScope notification_settin resetAllNotificationSettings = Ok; -//@description Changes the order of pinned chats @chat_ids The new list of pinned chats -setPinnedChats chat_ids:vector = Ok; +//@description Changes the order of pinned chats @chat_list Chat list in which to change the order of pinned chats @chat_ids The new list of pinned chats +setPinnedChats chat_list:ChatList chat_ids:vector = Ok; //@description Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates @@ -3409,7 +3681,7 @@ cancelUploadFile file_id:int32 = Ok; //@generation_id The identifier of the generation process @offset The offset from which to write the data to the file @data The data to write writeGeneratedFilePart generation_id:int64 offset:int32 data:bytes = Ok; -//@description Informs TDLib on a file generation prograss +//@description Informs TDLib on a file generation progress //@generation_id The identifier of the generation process //@expected_size Expected size of the generated file, in bytes; 0 if unknown //@local_prefix_size The number of bytes already generated @@ -3464,17 +3736,21 @@ blockUser user_id:int32 = Ok; //@description Removes a user from the blacklist @user_id User identifier unblockUser user_id:int32 = Ok; -//@description Returns users that were blocked by the current user @offset Number of users to skip in the result; must be non-negative @limit Maximum number of users to return; up to 100 +//@description Returns users that were blocked by the current user @offset Number of users to skip in the result; must be non-negative @limit The maximum number of users to return; up to 100 getBlockedUsers offset:int32 limit:int32 = Users; -//@description Adds new contacts or edits existing contacts; contacts' user identifiers are ignored @contacts The list of contacts to import or edit, contact's vCard are ignored and are not imported +//@description Adds a user to the contact list or edits an existing contact by their user identifier @contact The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored +//@share_phone_number True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field UserFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number +addContact contact:contact share_phone_number:Bool = Ok; + +//@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @contacts The list of contacts to import or edit; contacts' vCard are ignored and are not imported importContacts contacts:vector = ImportedContacts; //@description Returns all user contacts getContacts = Users; -//@description Searches for the specified query in the first names, last names and usernames of the known user contacts @query Query to search for; may be empty to return all contacts @limit Maximum number of users to be returned +//@description Searches for the specified query in the first names, last names and usernames of the known user contacts @query Query to search for; may be empty to return all contacts @limit The maximum number of users to be returned searchContacts query:string limit:int32 = Users; //@description Removes users from the contact list @user_ids Identifiers of users to be deleted @@ -3491,20 +3767,24 @@ changeImportedContacts contacts:vector = ImportedContacts; clearImportedContacts = 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 Maximum number of photos to be returned; up to 100 +//@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; + + +//@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 = UserProfilePhotos; -//@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 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 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 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 Maximum number of stickers to be returned +//@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 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 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 getArchivedStickerSets is_masks:Bool offset_sticker_set_id:int64 limit:int32 = StickerSets; //@description Returns a list of trending sticker sets @@ -3519,7 +3799,7 @@ getStickerSet set_id:int64 = StickerSet; //@description Searches for a sticker set by its name @name Name of the sticker set searchStickerSet name:string = StickerSet; -//@description Searches for installed sticker sets by looking for specified query in their title and name @is_masks Pass true to return mask sticker sets; pass false to return ordinary sticker sets @query Query to search for @limit Maximum number of sticker sets to return +//@description Searches for installed sticker sets by looking for specified query in their title and name @is_masks Pass true to return mask sticker sets; pass false to return ordinary sticker sets @query Query to search for @limit The maximum number of sticker sets to return searchInstalledStickerSets is_masks:Bool query:string limit:int32 = StickerSets; //@description Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results @query Query to search for @@ -3560,8 +3840,8 @@ removeFavoriteSticker sticker:InputFile = Ok; //@description Returns emoji corresponding to a sticker. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object @sticker Sticker file identifier getStickerEmojis sticker:InputFile = Emojis; -//@description Searches for emojis by keywords. Supported only if the file database is enabled @text Text to search for @exact_match True, if only emojis, which exactly match text needs to be returned -searchEmojis text:string exact_match:Bool = 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_code IETF language tag of the user's input language; may be empty if unknown +searchEmojis text:string exact_match:Bool input_language_code:string = Emojis; //@description Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation @language_code Language code for which the emoji replacements will be suggested getEmojiSuggestionsUrl language_code:string = HttpUrl; @@ -3582,7 +3862,7 @@ removeSavedAnimation animation:InputFile = Ok; getRecentInlineBots = Users; -//@description Searches for recently used hashtags by their prefix @prefix Hashtag prefix to search for @limit Maximum number of hashtags to be returned +//@description Searches for recently used hashtags by their prefix @prefix Hashtag prefix to search for @limit The maximum number of hashtags to be returned searchHashtags prefix:string limit:int32 = Hashtags; //@description Removes a hashtag from the list of recently used hashtags @hashtag Hashtag to delete @@ -3642,7 +3922,7 @@ disconnectWebsite website_id:int64 = Ok; disconnectAllWebsites = Ok; -//@description Changes the username of a supergroup or channel, requires creator 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 +//@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; //@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 @@ -3661,16 +3941,16 @@ reportSupergroupSpam supergroup_id:int32 user_id:int32 message_ids:vector //@filter The type of users to return. By default, supergroupMembersRecent @offset Number of users to skip @limit The maximum number of users be returned; up to 200 getSupergroupMembers supergroup_id:int32 filter:SupergroupMembersFilter offset:int32 limit:int32 = ChatMembers; -//@description Deletes a supergroup or channel along with all messages in the corresponding chat. This will release the supergroup or channel username and remove all members; requires creator 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 +//@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 Closes a secret chat, effectively transfering its state to secretChatStateClosed @secret_chat_id Secret chat identifier +//@description Closes a secret chat, effectively transferring its state to secretChatStateClosed @secret_chat_id Secret chat identifier 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 in 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 Maximum number of events to return; up to 100 +//@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; @@ -3712,12 +3992,12 @@ 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 solid 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 //@for_dark_theme True, if the background is chosen for dark theme setBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; -//@description Removes background from the list of installed backgrounds @background_id The background indentifier +//@description Removes background from the list of installed backgrounds @background_id The background identifier removeBackground background_id:int64 = Ok; //@description Resets list of installed backgrounds to its default value @@ -3793,21 +4073,18 @@ getAccountTtl = AccountTtl; deleteAccount reason:string = Ok; -//@description Returns information on whether the current chat can be reported as spam @chat_id Chat identifier -getChatReportSpamState chat_id:int53 = ChatReportSpamState; +//@description Removes a chat action bar without any other action @chat_id Chat identifier +removeChatActionBar chat_id:int53 = Ok; -//@description Reports to the server whether a chat is a spam chat or not. Can be used only if ChatReportSpamState.can_report_spam is true. After this request, ChatReportSpamState.can_report_spam becomes false forever @chat_id Chat identifier @is_spam_chat If true, the chat will be reported as spam; otherwise it will be marked as not spam -changeChatReportSpamState chat_id:int53 is_spam_chat:Bool = Ok; - -//@description Reports a chat to the Telegram moderators. Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by moderators @chat_id Chat identifier @reason The reason for reporting the chat @message_ids Identifiers of reported messages, if any +//@description Reports a chat to the Telegram moderators. Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by moderators, or when the report is done from the chat action bar @chat_id Chat identifier @reason The reason for reporting the chat @message_ids Identifiers of reported messages, if any reportChat chat_id:int53 reason:ChatReportReason message_ids:vector = Ok; -//@description Returns an HTTP URL with the chat statistics. Currently this method can be used only for channels @chat_id Chat identifier @parameters Parameters from "tg://statsrefresh?params=******" link @is_dark Pass true if a URL with the dark theme must be returned +//@description Returns an HTTP URL with the chat statistics. Currently this method can be used only for channels. Can be used only if SupergroupFullInfo.can_view_statistics == true @chat_id Chat identifier @parameters Parameters from "tg://statsrefresh?params=******" link @is_dark Pass true if a URL with the dark theme must be returned getChatStatisticsUrl chat_id:int53 parameters:string is_dark:Bool = HttpUrl; -//@description Returns storage usage statistics. Can be called before authorization @chat_limit 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 should be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0 getStorageStatistics chat_limit:int32 = StorageStatistics; //@description Quickly returns approximate storage usage statistics. Can be called before authorization @@ -4017,7 +4294,7 @@ setLogTagVerbosityLevel tag:string new_verbosity_level:int32 = Ok; getLogTagVerbosityLevel tag:string = LogVerbosityLevel; //@description Adds a message to TDLib internal log. This is an offline method. Can be called before authorization. Can be called synchronously -//@verbosity_level 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; @@ -4040,7 +4317,8 @@ testSquareInt x:int32 = TestInt; //@description Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization testNetwork = Ok; //@description Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization @server Proxy server IP address @port Proxy server port @type Proxy type -testProxy server:string port:int32 type:ProxyType = Ok; +//@dc_id Identifier of a datacenter, with which to test connection @timeout The maximum overall timeout for the request +testProxy server:string port:int32 type:ProxyType dc_id:int32 timeout:double = Ok; //@description Forces an updates.getDifference call to the Telegram servers; for testing only testGetDifference = Ok; //@description Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization