Update to TDLib 1.8.13

This commit is contained in:
c0re100 2023-03-26 17:37:06 +08:00
parent 47887c89e1
commit e722882047
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 40670 additions and 40496 deletions

View file

@ -316,6 +316,25 @@ func (client *Client) RegisterUser(req *RegisterUserRequest) (*Ok, error) {
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
// Resets the login email address. May return an error with a message "TASK_ALREADY_EXISTS" if reset is still pending. Works only when the current authorization state is authorizationStateWaitEmailCode and authorization_state.can_reset_email_address == true
func (client *Client) ResetAuthenticationEmailAddress() (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "resetAuthenticationEmailAddress",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type CheckAuthenticationPasswordRequest struct { type CheckAuthenticationPasswordRequest struct {
// The 2-step verification password to check // The 2-step verification password to check
Password string `json:"password"` Password string `json:"password"`
@ -661,7 +680,7 @@ type SetLoginEmailAddressRequest struct {
NewLoginEmailAddress string `json:"new_login_email_address"` NewLoginEmailAddress string `json:"new_login_email_address"`
} }
// Changes the login email address of the user. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly // Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly
func (client *Client) SetLoginEmailAddress(req *SetLoginEmailAddressRequest) (*EmailAddressAuthenticationCodeInfo, error) { func (client *Client) SetLoginEmailAddress(req *SetLoginEmailAddressRequest) (*EmailAddressAuthenticationCodeInfo, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -4413,8 +4432,7 @@ func GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) {
// deprecated // deprecated
// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously // Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously
func (client *Client) GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { func (client *Client) GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) {
return GetTextEntities(req) return GetTextEntities(req)}
}
type ParseTextEntitiesRequest struct { type ParseTextEntitiesRequest struct {
// The text to parse // The text to parse
@ -4448,8 +4466,7 @@ func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) {
// deprecated // deprecated
// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously // Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously
func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) {
return ParseTextEntities(req) return ParseTextEntities(req)}
}
type ParseMarkdownRequest struct { type ParseMarkdownRequest struct {
// The text to parse. For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" // The text to parse. For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**"
@ -4480,8 +4497,7 @@ func ParseMarkdown(req *ParseMarkdownRequest) (*FormattedText, error) {
// deprecated // deprecated
// Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously // Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously
func (client *Client) ParseMarkdown(req *ParseMarkdownRequest) (*FormattedText, error) { func (client *Client) ParseMarkdown(req *ParseMarkdownRequest) (*FormattedText, error) {
return ParseMarkdown(req) return ParseMarkdown(req)}
}
type GetMarkdownTextRequest struct { type GetMarkdownTextRequest struct {
// The text // The text
@ -4512,8 +4528,7 @@ func GetMarkdownText(req *GetMarkdownTextRequest) (*FormattedText, error) {
// deprecated // deprecated
// Replaces text entities with Markdown formatting in a human-friendly format. Entities that can't be represented in Markdown unambiguously are kept as is. Can be called synchronously // Replaces text entities with Markdown formatting in a human-friendly format. Entities that can't be represented in Markdown unambiguously are kept as is. Can be called synchronously
func (client *Client) GetMarkdownText(req *GetMarkdownTextRequest) (*FormattedText, error) { func (client *Client) GetMarkdownText(req *GetMarkdownTextRequest) (*FormattedText, error) {
return GetMarkdownText(req) return GetMarkdownText(req)}
}
type GetFileMimeTypeRequest struct { type GetFileMimeTypeRequest struct {
// The name of the file or path to the file // The name of the file or path to the file
@ -4544,8 +4559,7 @@ func GetFileMimeType(req *GetFileMimeTypeRequest) (*Text, error) {
// deprecated // deprecated
// Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously // Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously
func (client *Client) GetFileMimeType(req *GetFileMimeTypeRequest) (*Text, error) { func (client *Client) GetFileMimeType(req *GetFileMimeTypeRequest) (*Text, error) {
return GetFileMimeType(req) return GetFileMimeType(req)}
}
type GetFileExtensionRequest struct { type GetFileExtensionRequest struct {
// The MIME type of the file // The MIME type of the file
@ -4576,8 +4590,7 @@ func GetFileExtension(req *GetFileExtensionRequest) (*Text, error) {
// deprecated // deprecated
// Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously // Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously
func (client *Client) GetFileExtension(req *GetFileExtensionRequest) (*Text, error) { func (client *Client) GetFileExtension(req *GetFileExtensionRequest) (*Text, error) {
return GetFileExtension(req) return GetFileExtension(req)}
}
type CleanFileNameRequest struct { type CleanFileNameRequest struct {
// File name or path to the file // File name or path to the file
@ -4608,8 +4621,7 @@ func CleanFileName(req *CleanFileNameRequest) (*Text, error) {
// deprecated // deprecated
// Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. Can be called synchronously // Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. Can be called synchronously
func (client *Client) CleanFileName(req *CleanFileNameRequest) (*Text, error) { func (client *Client) CleanFileName(req *CleanFileNameRequest) (*Text, error) {
return CleanFileName(req) return CleanFileName(req)}
}
type GetLanguagePackStringRequest struct { type GetLanguagePackStringRequest struct {
// Path to the language pack database in which strings are stored // Path to the language pack database in which strings are stored
@ -4661,8 +4673,7 @@ func GetLanguagePackString(req *GetLanguagePackStringRequest) (LanguagePackStrin
// deprecated // deprecated
// Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. Can be called synchronously // Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. Can be called synchronously
func (client *Client) GetLanguagePackString(req *GetLanguagePackStringRequest) (LanguagePackStringValue, error) { func (client *Client) GetLanguagePackString(req *GetLanguagePackStringRequest) (LanguagePackStringValue, error) {
return GetLanguagePackString(req) return GetLanguagePackString(req)}
}
type GetJsonValueRequest struct { type GetJsonValueRequest struct {
// The JSON-serialized string // The JSON-serialized string
@ -4714,8 +4725,7 @@ func GetJsonValue(req *GetJsonValueRequest) (JsonValue, error) {
// deprecated // deprecated
// Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously // Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously
func (client *Client) GetJsonValue(req *GetJsonValueRequest) (JsonValue, error) { func (client *Client) GetJsonValue(req *GetJsonValueRequest) (JsonValue, error) {
return GetJsonValue(req) return GetJsonValue(req)}
}
type GetJsonStringRequest struct { type GetJsonStringRequest struct {
// The JsonValue object // The JsonValue object
@ -4746,8 +4756,7 @@ func GetJsonString(req *GetJsonStringRequest) (*Text, error) {
// deprecated // deprecated
// Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously // Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously
func (client *Client) GetJsonString(req *GetJsonStringRequest) (*Text, error) { func (client *Client) GetJsonString(req *GetJsonStringRequest) (*Text, error) {
return GetJsonString(req) return GetJsonString(req)}
}
type GetThemeParametersJsonStringRequest struct { type GetThemeParametersJsonStringRequest struct {
// Theme parameters to convert to JSON // Theme parameters to convert to JSON
@ -4778,8 +4787,7 @@ func GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Te
// deprecated // deprecated
// Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously // Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously
func (client *Client) GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Text, error) { func (client *Client) GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Text, error) {
return GetThemeParametersJsonString(req) return GetThemeParametersJsonString(req)}
}
type SetPollAnswerRequest struct { type SetPollAnswerRequest struct {
// Identifier of the chat to which the poll belongs // Identifier of the chat to which the poll belongs
@ -5281,7 +5289,7 @@ func (client *Client) SendWebAppData(req *SendWebAppDataRequest) (*Ok, error) {
} }
type OpenWebAppRequest struct { type OpenWebAppRequest struct {
// Identifier of the chat in which the Web App is opened // Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
// Identifier of the bot, providing the Web App // Identifier of the bot, providing the Web App
BotUserId int64 `json:"bot_user_id"` BotUserId int64 `json:"bot_user_id"`
@ -5768,9 +5776,9 @@ type ViewMessagesRequest struct {
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
// The identifiers of the messages being viewed // The identifiers of the messages being viewed
MessageIds []int64 `json:"message_ids"` MessageIds []int64 `json:"message_ids"`
// Source of the message view // Source of the message view; pass null to guess the source based on chat open state
Source MessageSource `json:"source"` Source MessageSource `json:"source"`
// Pass true to mark as read the specified messages even the chat is closed; pass null to guess the source based on chat open state // Pass true to mark as read the specified messages even the chat is closed
ForceRead bool `json:"force_read"` ForceRead bool `json:"force_read"`
} }
@ -6679,8 +6687,7 @@ func GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Te
// deprecated // deprecated
// Returns default icon name for a filter. Can be called synchronously // Returns default icon name for a filter. Can be called synchronously
func (client *Client) GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Text, error) { func (client *Client) GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Text, error) {
return GetChatFilterDefaultIconName(req) return GetChatFilterDefaultIconName(req)}
}
type SetChatTitleRequest struct { type SetChatTitleRequest struct {
// Chat identifier // Chat identifier
@ -13810,8 +13817,7 @@ func GetPushReceiverId(req *GetPushReceiverIdRequest) (*PushReceiverId, error) {
// deprecated // deprecated
// Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. Can be called synchronously // Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. Can be called synchronously
func (client *Client) GetPushReceiverId(req *GetPushReceiverIdRequest) (*PushReceiverId, error) { func (client *Client) GetPushReceiverId(req *GetPushReceiverIdRequest) (*PushReceiverId, error) {
return GetPushReceiverId(req) return GetPushReceiverId(req)}
}
type GetRecentlyVisitedTMeUrlsRequest struct { type GetRecentlyVisitedTMeUrlsRequest struct {
// Google Play referrer to identify the user // Google Play referrer to identify the user
@ -13938,8 +13944,7 @@ func GetOption(req *GetOptionRequest) (OptionValue, error) {
// deprecated // deprecated
// Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options "version" and "commit_hash" // Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options "version" and "commit_hash"
func (client *Client) GetOption(req *GetOptionRequest) (OptionValue, error) { func (client *Client) GetOption(req *GetOptionRequest) (OptionValue, error) {
return GetOption(req) return GetOption(req)}
}
type SetOptionRequest struct { type SetOptionRequest struct {
// The name of the option // The name of the option
@ -16181,8 +16186,7 @@ func GetPhoneNumberInfoSync(req *GetPhoneNumberInfoSyncRequest) (*PhoneNumberInf
// deprecated // deprecated
// Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after changing localization to the specified language if properly localized country information is expected. Can be called synchronously // Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after changing localization to the specified language if properly localized country information is expected. Can be called synchronously
func (client *Client) GetPhoneNumberInfoSync(req *GetPhoneNumberInfoSyncRequest) (*PhoneNumberInfo, error) { func (client *Client) GetPhoneNumberInfoSync(req *GetPhoneNumberInfoSyncRequest) (*PhoneNumberInfo, error) {
return GetPhoneNumberInfoSync(req) return GetPhoneNumberInfoSync(req)}
}
type GetDeepLinkInfoRequest struct { type GetDeepLinkInfoRequest struct {
// The link // The link
@ -16255,7 +16259,7 @@ type AddApplicationChangelogRequest struct {
PreviousApplicationVersion string `json:"previous_application_version"` PreviousApplicationVersion string `json:"previous_application_version"`
} }
// Adds server-provided application changelog as messages to the chat 777000 (Telegram); for official applications only // Adds server-provided application changelog as messages to the chat 777000 (Telegram); for official applications only. Returns a 404 error if nothing changed
func (client *Client) AddApplicationChangelog(req *AddApplicationChangelogRequest) (*Ok, error) { func (client *Client) AddApplicationChangelog(req *AddApplicationChangelogRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -16571,8 +16575,7 @@ func SetLogStream(req *SetLogStreamRequest) (*Ok, error) {
// deprecated // deprecated
// Sets new log stream for internal logging of TDLib. Can be called synchronously // Sets new log stream for internal logging of TDLib. Can be called synchronously
func (client *Client) SetLogStream(req *SetLogStreamRequest) (*Ok, error) { func (client *Client) SetLogStream(req *SetLogStreamRequest) (*Ok, error) {
return SetLogStream(req) return SetLogStream(req)}
}
// Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously // Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously
func GetLogStream() (LogStream, error) { func GetLogStream() (LogStream, error) {
@ -16608,8 +16611,7 @@ func GetLogStream() (LogStream, error) {
// deprecated // deprecated
// Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously // Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously
func (client *Client) GetLogStream() (LogStream, error) { func (client *Client) GetLogStream() (LogStream, error) {
return GetLogStream() return GetLogStream()}
}
type SetLogVerbosityLevelRequest struct { type SetLogVerbosityLevelRequest struct {
// New value of the verbosity level for logging. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings, value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1023 can be used to enable even more logging // New value of the verbosity level for logging. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings, value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1023 can be used to enable even more logging
@ -16640,8 +16642,7 @@ func SetLogVerbosityLevel(req *SetLogVerbosityLevelRequest) (*Ok, error) {
// deprecated // deprecated
// Sets the verbosity level of the internal logging of TDLib. Can be called synchronously // Sets the verbosity level of the internal logging of TDLib. Can be called synchronously
func (client *Client) SetLogVerbosityLevel(req *SetLogVerbosityLevelRequest) (*Ok, error) { func (client *Client) SetLogVerbosityLevel(req *SetLogVerbosityLevelRequest) (*Ok, error) {
return SetLogVerbosityLevel(req) return SetLogVerbosityLevel(req)}
}
// Returns current verbosity level of the internal logging of TDLib. Can be called synchronously // Returns current verbosity level of the internal logging of TDLib. Can be called synchronously
func GetLogVerbosityLevel() (*LogVerbosityLevel, error) { func GetLogVerbosityLevel() (*LogVerbosityLevel, error) {
@ -16665,8 +16666,7 @@ func GetLogVerbosityLevel() (*LogVerbosityLevel, error) {
// deprecated // deprecated
// Returns current verbosity level of the internal logging of TDLib. Can be called synchronously // Returns current verbosity level of the internal logging of TDLib. Can be called synchronously
func (client *Client) GetLogVerbosityLevel() (*LogVerbosityLevel, error) { func (client *Client) GetLogVerbosityLevel() (*LogVerbosityLevel, error) {
return GetLogVerbosityLevel() return GetLogVerbosityLevel()}
}
// Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously // Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously
func GetLogTags() (*LogTags, error) { func GetLogTags() (*LogTags, error) {
@ -16690,8 +16690,7 @@ func GetLogTags() (*LogTags, error) {
// deprecated // deprecated
// Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously // Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously
func (client *Client) GetLogTags() (*LogTags, error) { func (client *Client) GetLogTags() (*LogTags, error) {
return GetLogTags() return GetLogTags()}
}
type SetLogTagVerbosityLevelRequest struct { type SetLogTagVerbosityLevelRequest struct {
// Logging tag to change verbosity level // Logging tag to change verbosity level
@ -16725,8 +16724,7 @@ func SetLogTagVerbosityLevel(req *SetLogTagVerbosityLevelRequest) (*Ok, error) {
// deprecated // deprecated
// Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously // Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously
func (client *Client) SetLogTagVerbosityLevel(req *SetLogTagVerbosityLevelRequest) (*Ok, error) { func (client *Client) SetLogTagVerbosityLevel(req *SetLogTagVerbosityLevelRequest) (*Ok, error) {
return SetLogTagVerbosityLevel(req) return SetLogTagVerbosityLevel(req)}
}
type GetLogTagVerbosityLevelRequest struct { type GetLogTagVerbosityLevelRequest struct {
// Logging tag to change verbosity level // Logging tag to change verbosity level
@ -16757,8 +16755,7 @@ func GetLogTagVerbosityLevel(req *GetLogTagVerbosityLevelRequest) (*LogVerbosity
// deprecated // deprecated
// Returns current verbosity level for a specified TDLib internal log tag. Can be called synchronously // Returns current verbosity level for a specified TDLib internal log tag. Can be called synchronously
func (client *Client) GetLogTagVerbosityLevel(req *GetLogTagVerbosityLevelRequest) (*LogVerbosityLevel, error) { func (client *Client) GetLogTagVerbosityLevel(req *GetLogTagVerbosityLevelRequest) (*LogVerbosityLevel, error) {
return GetLogTagVerbosityLevel(req) return GetLogTagVerbosityLevel(req)}
}
type AddLogMessageRequest struct { type AddLogMessageRequest struct {
// The minimum verbosity level needed for the message to be logged; 0-1023 // The minimum verbosity level needed for the message to be logged; 0-1023
@ -16792,8 +16789,7 @@ func AddLogMessage(req *AddLogMessageRequest) (*Ok, error) {
// deprecated // deprecated
// Adds a message to TDLib internal log. Can be called synchronously // Adds a message to TDLib internal log. Can be called synchronously
func (client *Client) AddLogMessage(req *AddLogMessageRequest) (*Ok, error) { func (client *Client) AddLogMessage(req *AddLogMessageRequest) (*Ok, error) {
return AddLogMessage(req) return AddLogMessage(req)}
}
type GetUserSupportInfoRequest struct { type GetUserSupportInfoRequest struct {
// User identifier // User identifier
@ -16850,6 +16846,25 @@ func (client *Client) SetUserSupportInfo(req *SetUserSupportInfoRequest) (*UserS
return UnmarshalUserSupportInfo(result.Data) return UnmarshalUserSupportInfo(result.Data)
} }
// Returns localized name of the Telegram support user; for Telegram support only
func (client *Client) GetSupportName() (*Text, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getSupportName",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalText(result.Data)
}
// Does nothing; for testing only. This is an offline method. Can be called before authorization // Does nothing; for testing only. This is an offline method. Can be called before authorization
func (client *Client) TestCallEmpty() (*Ok, error) { func (client *Client) TestCallEmpty() (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
@ -17502,5 +17517,4 @@ func TestReturnError(req *TestReturnErrorRequest) (*Error, error) {
// deprecated // deprecated
// Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously // Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously
func (client *Client) TestReturnError(req *TestReturnErrorRequest) (*Error, error) { func (client *Client) TestReturnError(req *TestReturnErrorRequest) (*Error, error) {
return TestReturnError(req) return TestReturnError(req)}
}

File diff suppressed because it is too large Load diff

View file

@ -96,6 +96,40 @@ func UnmarshalListOfEmailAddressAuthentication(dataList []json.RawMessage) ([]Em
return list, nil return list, nil
} }
func UnmarshalEmailAddressResetState(data json.RawMessage) (EmailAddressResetState, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeEmailAddressResetStateAvailable:
return UnmarshalEmailAddressResetStateAvailable(data)
case TypeEmailAddressResetStatePending:
return UnmarshalEmailAddressResetStatePending(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfEmailAddressResetState(dataList []json.RawMessage) ([]EmailAddressResetState, error) {
list := []EmailAddressResetState{}
for _, data := range dataList {
entity, err := UnmarshalEmailAddressResetState(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalAuthorizationState(data json.RawMessage) (AuthorizationState, error) { func UnmarshalAuthorizationState(data json.RawMessage) (AuthorizationState, error) {
var meta meta var meta meta
@ -5857,6 +5891,22 @@ func UnmarshalEmailAddressAuthenticationGoogleId(data json.RawMessage) (*EmailAd
return &resp, err return &resp, err
} }
func UnmarshalEmailAddressResetStateAvailable(data json.RawMessage) (*EmailAddressResetStateAvailable, error) {
var resp EmailAddressResetStateAvailable
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalEmailAddressResetStatePending(data json.RawMessage) (*EmailAddressResetStatePending, error) {
var resp EmailAddressResetStatePending
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalTextEntity(data json.RawMessage) (*TextEntity, error) { func UnmarshalTextEntity(data json.RawMessage) (*TextEntity, error) {
var resp TextEntity var resp TextEntity
@ -15207,6 +15257,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeEmailAddressAuthenticationGoogleId: case TypeEmailAddressAuthenticationGoogleId:
return UnmarshalEmailAddressAuthenticationGoogleId(data) return UnmarshalEmailAddressAuthenticationGoogleId(data)
case TypeEmailAddressResetStateAvailable:
return UnmarshalEmailAddressResetStateAvailable(data)
case TypeEmailAddressResetStatePending:
return UnmarshalEmailAddressResetStatePending(data)
case TypeTextEntity: case TypeTextEntity:
return UnmarshalTextEntity(data) return UnmarshalTextEntity(data)

View file

@ -28,7 +28,7 @@ ok = Ok;
//@length Length of the code //@length Length of the code
authenticationCodeTypeTelegramMessage length:int32 = AuthenticationCodeType; authenticationCodeTypeTelegramMessage length:int32 = AuthenticationCodeType;
//@description An authentication code is delivered via an SMS message to the specified phone number //@description An authentication code is delivered via an SMS message to the specified phone number; applications may not receive this type of code
//@length Length of the code //@length Length of the code
authenticationCodeTypeSms length:int32 = AuthenticationCodeType; authenticationCodeTypeSms length:int32 = AuthenticationCodeType;
@ -56,7 +56,7 @@ authenticationCodeTypeFragment url:string length:int32 = AuthenticationCodeType;
authenticationCodeTypeFirebaseAndroid nonce:bytes length:int32 = AuthenticationCodeType; authenticationCodeTypeFirebaseAndroid nonce:bytes length:int32 = AuthenticationCodeType;
//@description An authentication code is delivered via Firebase Authentication to the official iOS application //@description An authentication code is delivered via Firebase Authentication to the official iOS application
//@receipt Receipt of successful applikation token validation to compare with receipt from push notification //@receipt Receipt of successful application token validation to compare with receipt from push notification
//@push_timeout Time after the next authentication method is supposed to be used if verification push notification isn't received, in seconds //@push_timeout Time after the next authentication method is supposed to be used if verification push notification isn't received, in seconds
//@length Length of the code //@length Length of the code
authenticationCodeTypeFirebaseIos receipt:string push_timeout:int32 length:int32 = AuthenticationCodeType; authenticationCodeTypeFirebaseIos receipt:string push_timeout:int32 length:int32 = AuthenticationCodeType;
@ -87,6 +87,17 @@ emailAddressAuthenticationAppleId token:string = EmailAddressAuthentication;
emailAddressAuthenticationGoogleId token:string = EmailAddressAuthentication; emailAddressAuthenticationGoogleId token:string = EmailAddressAuthentication;
//@class EmailAddressResetState @description Describes reset state of a email address
//@description Email address can be reset after the given period. Call resetAuthenticationEmailAddress to reset it and allow the user to authorize with a code sent to the user's phone number
//@wait_period Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium
emailAddressResetStateAvailable wait_period:int32 = EmailAddressResetState;
//@description Email address reset has already been requested. Call resetAuthenticationEmailAddress to check whether immediate reset is possible
//@reset_in Left time before the email address will be reset, in seconds. updateAuthorizationState is not sent when this field changes
emailAddressResetStatePending reset_in:int32 = EmailAddressResetState;
//@description Represents a part of the text that needs to be formatted in some unusual way @offset Offset of the entity, in UTF-16 code units @length Length of the entity, in UTF-16 code units @type Type of the entity //@description Represents a part of the text that needs to be formatted in some unusual way @offset Offset of the entity, in UTF-16 code units @length Length of the entity, in UTF-16 code units @type Type of the entity
textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntity offset:int32 length:int32 type:TextEntityType = TextEntity;
@ -119,8 +130,8 @@ authorizationStateWaitEmailAddress allow_apple_id:Bool allow_google_id:Bool = Au
//@allow_apple_id True, if authorization through Apple ID is allowed //@allow_apple_id True, if authorization through Apple ID is allowed
//@allow_google_id True, if authorization through Google ID is allowed //@allow_google_id True, if authorization through Google ID is allowed
//@code_info Information about the sent authentication code //@code_info Information about the sent authentication code
//@next_phone_number_authorization_date Point in time (Unix timestamp) when the user will be able to authorize with a code sent to the user's phone number; 0 if unknown //@email_address_reset_state Reset state of the email address; may be null if the email address can't be reset
authorizationStateWaitEmailCode allow_apple_id:Bool allow_google_id:Bool code_info:emailAddressAuthenticationCodeInfo next_phone_number_authorization_date:int32 = AuthorizationState; authorizationStateWaitEmailCode allow_apple_id:Bool allow_google_id:Bool code_info:emailAddressAuthenticationCodeInfo email_address_reset_state:EmailAddressResetState = AuthorizationState;
//@description TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code @code_info Information about the authorization code that was sent //@description TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code @code_info Information about the authorization code that was sent
authorizationStateWaitCode code_info:authenticationCodeInfo = AuthorizationState; authorizationStateWaitCode code_info:authenticationCodeInfo = AuthorizationState;
@ -5527,7 +5538,7 @@ updateSelectedBackground for_dark_theme:Bool background:background = Update;
//@description The list of available chat themes has changed @chat_themes The new list of chat themes //@description The list of available chat themes has changed @chat_themes The new list of chat themes
updateChatThemes chat_themes:vector<chatTheme> = Update; updateChatThemes chat_themes:vector<chatTheme> = Update;
//@description Some language pack strings have been updated @localization_target Localization target to which the language pack belongs @language_pack_id Identifier of the updated language pack @strings List of changed language pack strings //@description Some language pack strings have been updated @localization_target Localization target to which the language pack belongs @language_pack_id Identifier of the updated language pack @strings List of changed language pack strings; empty if all strings have changed
updateLanguagePackStrings localization_target:string language_pack_id:string strings:vector<languagePackString> = Update; updateLanguagePackStrings localization_target:string language_pack_id:string strings:vector<languagePackString> = Update;
//@description The connection state has changed. This update must be used only to show a human-readable description of the connection state @state The new connection state //@description The connection state has changed. This update must be used only to show a human-readable description of the connection state @state The new connection state
@ -5751,6 +5762,10 @@ requestQrCodeAuthentication other_user_ids:vector<int53> = Ok;
//@last_name The last name of the user; 0-64 characters //@last_name The last name of the user; 0-64 characters
registerUser first_name:string last_name:string = Ok; registerUser first_name:string last_name:string = Ok;
//@description Resets the login email address. May return an error with a message "TASK_ALREADY_EXISTS" if reset is still pending.
//-Works only when the current authorization state is authorizationStateWaitEmailCode and authorization_state.can_reset_email_address == true
resetAuthenticationEmailAddress = Ok;
//@description Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword @password The 2-step verification password to check //@description Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword @password The 2-step verification password to check
checkAuthenticationPassword password:string = Ok; checkAuthenticationPassword password:string = Ok;
@ -5807,8 +5822,8 @@ getPasswordState = PasswordState;
//@new_recovery_email_address New recovery email address; may be empty //@new_recovery_email_address New recovery email address; may be empty
setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState; setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState;
//@description Changes the login email address of the user. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. //@description Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty.
//-To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly //-The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly
//@new_login_email_address New login email address //@new_login_email_address New login email address
setLoginEmailAddress new_login_email_address:string = EmailAddressAuthenticationCodeInfo; setLoginEmailAddress new_login_email_address:string = EmailAddressAuthenticationCodeInfo;
@ -6585,7 +6600,7 @@ sendWebAppData bot_user_id:int53 button_text:string data:string = Ok;
//@description Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. //@description Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button.
//-For each bot, a confirmation alert about data sent to the bot must be shown once //-For each bot, a confirmation alert about data sent to the bot must be shown once
//@chat_id Identifier of the chat in which the Web App is opened //@chat_id Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats
//@bot_user_id Identifier of the bot, providing the Web App //@bot_user_id Identifier of the bot, providing the Web App
//@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise //@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise
//@theme Preferred Web App theme; pass null to use the default theme //@theme Preferred Web App theme; pass null to use the default theme
@ -6669,8 +6684,8 @@ closeChat chat_id:int53 = Ok;
//-Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels) //-Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels)
//@chat_id Chat identifier //@chat_id Chat identifier
//@message_ids The identifiers of the messages being viewed //@message_ids The identifiers of the messages being viewed
//@source Source of the message view //@source Source of the message view; pass null to guess the source based on chat open state
//@force_read Pass true to mark as read the specified messages even the chat is closed; pass null to guess the source based on chat open state //@force_read Pass true to mark as read the specified messages even the chat is closed
viewMessages chat_id:int53 message_ids:vector<int53> source:MessageSource force_read:Bool = Ok; viewMessages chat_id:int53 message_ids:vector<int53> source:MessageSource force_read:Bool = Ok;
//@description Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message). //@description Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message).
@ -8208,7 +8223,7 @@ getDeepLinkInfo link:string = DeepLinkInfo;
//@description Returns application config, provided by the server. Can be called before authorization //@description Returns application config, provided by the server. Can be called before authorization
getApplicationConfig = JsonValue; getApplicationConfig = JsonValue;
//@description Adds server-provided application changelog as messages to the chat 777000 (Telegram); for official applications only @previous_application_version The previous application version //@description Adds server-provided application changelog as messages to the chat 777000 (Telegram); for official applications only. Returns a 404 error if nothing changed @previous_application_version The previous application version
addApplicationChangelog previous_application_version:string = Ok; addApplicationChangelog previous_application_version:string = Ok;
//@description Saves application log event on the server. Can be called before authorization @type Event type @chat_id Optional chat identifier, associated with the event @data The log event data //@description Saves application log event on the server. Can be called before authorization @type Event type @chat_id Optional chat identifier, associated with the event @data The log event data
@ -8289,6 +8304,9 @@ getUserSupportInfo user_id:int53 = UserSupportInfo;
//@description Sets support information for the given user; for Telegram support only @user_id User identifier @message New information message //@description Sets support information for the given user; for Telegram support only @user_id User identifier @message New information message
setUserSupportInfo user_id:int53 message:formattedText = UserSupportInfo; setUserSupportInfo user_id:int53 message:formattedText = UserSupportInfo;
//@description Returns localized name of the Telegram support user; for Telegram support only
getSupportName = Text;
//@description Does nothing; for testing only. This is an offline method. Can be called before authorization //@description Does nothing; for testing only. This is an offline method. Can be called before authorization
testCallEmpty = Ok; testCallEmpty = Ok;