From bc2f985e6268345c70d7e2298604bb2bdecb2b0d Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Sat, 11 Nov 2023 12:31:19 -0500 Subject: [PATCH] update tdlib 3870c29b158b75ca5e48e0eebd6b5c3a7994a000 --- Makefile | 2 +- client/authorization.go | 101 +- client/function.go | 6786 +++++++++++++-- client/type.go | 17662 +++++++++++++++++++++++++++++++++----- client/unmarshaler.go | 7080 ++++++++++++++- data/td_api.json | 12938 +++++++++++++++++++++++++--- data/td_api.tl | 5713 +++++++++--- tlparser/parser.go | 29 +- 8 files changed, 44492 insertions(+), 5819 deletions(-) diff --git a/Makefile b/Makefile index 8d6428e..cff0e7d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := v1.8.0 +TAG := 3870c29b158b75ca5e48e0eebd6b5c3a7994a000 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/authorization.go b/client/authorization.go index 05aaded..8ee6fdd 100644 --- a/client/authorization.go +++ b/client/authorization.go @@ -8,6 +8,42 @@ import ( var ErrNotSupportedAuthorizationState = errors.New("not supported state") +// Contains parameters for TDLib initialization +type TdlibParameters struct { + // Pass true to use Telegram test environment instead of the production environment + UseTestDc bool `json:"use_test_dc"` + // The path to the directory for the persistent database; if empty, the current working directory will be used + DatabaseDirectory string `json:"database_directory"` + // The path to the directory for storing files; if empty, database_directory will be used + FilesDirectory string `json:"files_directory"` + // Encryption key for the database. If the encryption key is invalid, then an error with code 401 will be returned + DatabaseEncryptionKey []byte `json:"database_encryption_key"` + // Pass true to keep information about downloaded and uploaded files between application restarts + UseFileDatabase bool `json:"use_file_database"` + // Pass true to keep cache of users, basic groups, supergroups, channels and secret chats between restarts. Implies use_file_database + UseChatInfoDatabase bool `json:"use_chat_info_database"` + // Pass true to keep cache of chats and messages between restarts. Implies use_chat_info_database + UseMessageDatabase bool `json:"use_message_database"` + // Pass true to enable support for secret chats + UseSecretChats bool `json:"use_secret_chats"` + // Application identifier for Telegram API access, which can be obtained at https://my.telegram.org + ApiId int32 `json:"api_id"` + // Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org + ApiHash string `json:"api_hash"` + // IETF language tag of the user's operating system language; must be non-empty + SystemLanguageCode string `json:"system_language_code"` + // Model of the device the application is being run on; must be non-empty + DeviceModel string `json:"device_model"` + // Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib + SystemVersion string `json:"system_version"` + // Application version; must be non-empty + ApplicationVersion string `json:"application_version"` + // Pass true to automatically delete old files in background + EnableStorageOptimizer bool `json:"enable_storage_optimizer"` + // Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name + IgnoreFileNames bool `json:"ignore_file_names"` +} + type AuthorizationStateHandler interface { Handle(client *Client, state AuthorizationState) error Close() @@ -65,15 +101,27 @@ func (stateHandler *clientAuthorizer) Handle(client *Client, state Authorization switch state.AuthorizationStateType() { case TypeAuthorizationStateWaitTdlibParameters: + p := <-stateHandler.TdlibParameters _, err := client.SetTdlibParameters(&SetTdlibParametersRequest{ - Parameters: <-stateHandler.TdlibParameters, + UseTestDc: p.UseTestDc, + DatabaseDirectory: p.DatabaseDirectory, + FilesDirectory: p.FilesDirectory, + DatabaseEncryptionKey: p.DatabaseEncryptionKey, + UseFileDatabase: p.UseFileDatabase, + UseChatInfoDatabase: p.UseChatInfoDatabase, + UseMessageDatabase: p.UseMessageDatabase, + UseSecretChats: p.UseSecretChats, + ApiId: p.ApiId, + ApiHash: p.ApiHash, + SystemLanguageCode: p.SystemLanguageCode, + DeviceModel: p.DeviceModel, + SystemVersion: p.SystemVersion, + ApplicationVersion: p.ApplicationVersion, + EnableStorageOptimizer: p.EnableStorageOptimizer, + IgnoreFileNames: p.IgnoreFileNames, }) return err - case TypeAuthorizationStateWaitEncryptionKey: - _, err := client.CheckDatabaseEncryptionKey(&CheckDatabaseEncryptionKeyRequest{}) - return err - case TypeAuthorizationStateWaitPhoneNumber: _, err := client.SetAuthenticationPhoneNumber(&SetAuthenticationPhoneNumberRequest{ PhoneNumber: <-stateHandler.PhoneNumber, @@ -85,12 +133,21 @@ func (stateHandler *clientAuthorizer) Handle(client *Client, state Authorization }) return err + case TypeAuthorizationStateWaitEmailAddress: + return ErrNotSupportedAuthorizationState + + case TypeAuthorizationStateWaitEmailCode: + return ErrNotSupportedAuthorizationState + case TypeAuthorizationStateWaitCode: _, err := client.CheckAuthenticationCode(&CheckAuthenticationCodeRequest{ Code: <-stateHandler.Code, }) return err + case TypeAuthorizationStateWaitOtherDeviceConfirmation: + return ErrNotSupportedAuthorizationState + case TypeAuthorizationStateWaitRegistration: return ErrNotSupportedAuthorizationState @@ -140,6 +197,12 @@ func CliInteractor(clientAuthorizer *clientAuthorizer) { clientAuthorizer.PhoneNumber <- phoneNumber + case TypeAuthorizationStateWaitEmailAddress: + return + + case TypeAuthorizationStateWaitEmailCode: + return + case TypeAuthorizationStateWaitCode: var code string @@ -148,6 +211,12 @@ func CliInteractor(clientAuthorizer *clientAuthorizer) { clientAuthorizer.Code <- code + case TypeAuthorizationStateWaitOtherDeviceConfirmation: + return + + case TypeAuthorizationStateWaitRegistration: + return + case TypeAuthorizationStateWaitPassword: fmt.Println("Enter password: ") var password string @@ -185,15 +254,27 @@ func (stateHandler *botAuthorizer) Handle(client *Client, state AuthorizationSta switch state.AuthorizationStateType() { case TypeAuthorizationStateWaitTdlibParameters: + p := <-stateHandler.TdlibParameters _, err := client.SetTdlibParameters(&SetTdlibParametersRequest{ - Parameters: <-stateHandler.TdlibParameters, + UseTestDc: p.UseTestDc, + DatabaseDirectory: p.DatabaseDirectory, + FilesDirectory: p.FilesDirectory, + DatabaseEncryptionKey: p.DatabaseEncryptionKey, + UseFileDatabase: p.UseFileDatabase, + UseChatInfoDatabase: p.UseChatInfoDatabase, + UseMessageDatabase: p.UseMessageDatabase, + UseSecretChats: p.UseSecretChats, + ApiId: p.ApiId, + ApiHash: p.ApiHash, + SystemLanguageCode: p.SystemLanguageCode, + DeviceModel: p.DeviceModel, + SystemVersion: p.SystemVersion, + ApplicationVersion: p.ApplicationVersion, + EnableStorageOptimizer: p.EnableStorageOptimizer, + IgnoreFileNames: p.IgnoreFileNames, }) return err - case TypeAuthorizationStateWaitEncryptionKey: - _, err := client.CheckDatabaseEncryptionKey(&CheckDatabaseEncryptionKeyRequest{}) - return err - case TypeAuthorizationStateWaitPhoneNumber: _, err := client.CheckAuthenticationBotToken(&CheckAuthenticationBotTokenRequest{ Token: <-stateHandler.Token, diff --git a/client/function.go b/client/function.go index e8961d8..606405f 100755 --- a/client/function.go +++ b/client/function.go @@ -26,12 +26,15 @@ func (client *Client) GetAuthorizationState() (AuthorizationState, error) { case TypeAuthorizationStateWaitTdlibParameters: return UnmarshalAuthorizationStateWaitTdlibParameters(result.Data) - case TypeAuthorizationStateWaitEncryptionKey: - return UnmarshalAuthorizationStateWaitEncryptionKey(result.Data) - case TypeAuthorizationStateWaitPhoneNumber: return UnmarshalAuthorizationStateWaitPhoneNumber(result.Data) + case TypeAuthorizationStateWaitEmailAddress: + return UnmarshalAuthorizationStateWaitEmailAddress(result.Data) + + case TypeAuthorizationStateWaitEmailCode: + return UnmarshalAuthorizationStateWaitEmailCode(result.Data) + case TypeAuthorizationStateWaitCode: return UnmarshalAuthorizationStateWaitCode(result.Data) @@ -62,8 +65,38 @@ func (client *Client) GetAuthorizationState() (AuthorizationState, error) { } type SetTdlibParametersRequest struct { - // Parameters for TDLib initialization - Parameters *TdlibParameters `json:"parameters"` + // Pass true to use Telegram test environment instead of the production environment + UseTestDc bool `json:"use_test_dc"` + // The path to the directory for the persistent database; if empty, the current working directory will be used + DatabaseDirectory string `json:"database_directory"` + // The path to the directory for storing files; if empty, database_directory will be used + FilesDirectory string `json:"files_directory"` + // Encryption key for the database. If the encryption key is invalid, then an error with code 401 will be returned + DatabaseEncryptionKey []byte `json:"database_encryption_key"` + // Pass true to keep information about downloaded and uploaded files between application restarts + UseFileDatabase bool `json:"use_file_database"` + // Pass true to keep cache of users, basic groups, supergroups, channels and secret chats between restarts. Implies use_file_database + UseChatInfoDatabase bool `json:"use_chat_info_database"` + // Pass true to keep cache of chats and messages between restarts. Implies use_chat_info_database + UseMessageDatabase bool `json:"use_message_database"` + // Pass true to enable support for secret chats + UseSecretChats bool `json:"use_secret_chats"` + // Application identifier for Telegram API access, which can be obtained at https://my.telegram.org + ApiId int32 `json:"api_id"` + // Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org + ApiHash string `json:"api_hash"` + // IETF language tag of the user's operating system language; must be non-empty + SystemLanguageCode string `json:"system_language_code"` + // Model of the device the application is being run on; must be non-empty + DeviceModel string `json:"device_model"` + // Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib + SystemVersion string `json:"system_version"` + // Application version; must be non-empty + ApplicationVersion string `json:"application_version"` + // Pass true to automatically delete old files in background + EnableStorageOptimizer bool `json:"enable_storage_optimizer"` + // Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name + IgnoreFileNames bool `json:"ignore_file_names"` } // Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters @@ -73,33 +106,22 @@ func (client *Client) SetTdlibParameters(req *SetTdlibParametersRequest) (*Ok, e Type: "setTdlibParameters", }, Data: map[string]interface{}{ - "parameters": req.Parameters, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type CheckDatabaseEncryptionKeyRequest struct { - // Encryption key to check or set up - EncryptionKey []byte `json:"encryption_key"` -} - -// Checks the database encryption key for correctness. Works only when the current authorization state is authorizationStateWaitEncryptionKey -func (client *Client) CheckDatabaseEncryptionKey(req *CheckDatabaseEncryptionKeyRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "checkDatabaseEncryptionKey", - }, - Data: map[string]interface{}{ - "encryption_key": req.EncryptionKey, + "use_test_dc": req.UseTestDc, + "database_directory": req.DatabaseDirectory, + "files_directory": req.FilesDirectory, + "database_encryption_key": req.DatabaseEncryptionKey, + "use_file_database": req.UseFileDatabase, + "use_chat_info_database": req.UseChatInfoDatabase, + "use_message_database": req.UseMessageDatabase, + "use_secret_chats": req.UseSecretChats, + "api_id": req.ApiId, + "api_hash": req.ApiHash, + "system_language_code": req.SystemLanguageCode, + "device_model": req.DeviceModel, + "system_version": req.SystemVersion, + "application_version": req.ApplicationVersion, + "enable_storage_optimizer": req.EnableStorageOptimizer, + "ignore_file_names": req.IgnoreFileNames, }, }) if err != nil { @@ -120,7 +142,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, authorizationStateWaitRegistration, 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 authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword func (client *Client) SetAuthenticationPhoneNumber(req *SetAuthenticationPhoneNumberRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -142,7 +164,33 @@ func (client *Client) SetAuthenticationPhoneNumber(req *SetAuthenticationPhoneNu return UnmarshalOk(result.Data) } -// Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed +type SetAuthenticationEmailAddressRequest struct { + // The email address of the user + EmailAddress string `json:"email_address"` +} + +// Sets the email address of the user and sends an authentication code to the email address. Works only when the current authorization state is authorizationStateWaitEmailAddress +func (client *Client) SetAuthenticationEmailAddress(req *SetAuthenticationEmailAddressRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setAuthenticationEmailAddress", + }, + Data: map[string]interface{}{ + "email_address": req.EmailAddress, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed, or when the current authorization state is authorizationStateWaitEmailCode func (client *Client) ResendAuthenticationCode() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -161,6 +209,32 @@ func (client *Client) ResendAuthenticationCode() (*Ok, error) { return UnmarshalOk(result.Data) } +type CheckAuthenticationEmailCodeRequest struct { + // Email address authentication to check + Code EmailAddressAuthentication `json:"code"` +} + +// Checks the authentication of a email address. Works only when the current authorization state is authorizationStateWaitEmailCode +func (client *Client) CheckAuthenticationEmailCode(req *CheckAuthenticationEmailCodeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkAuthenticationEmailCode", + }, + Data: map[string]interface{}{ + "code": req.Code, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CheckAuthenticationCodeRequest struct { // Authentication code to check Code string `json:"code"` @@ -192,7 +266,7 @@ type RequestQrCodeAuthenticationRequest struct { OtherUserIds []int64 `json:"other_user_ids"` } -// Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword +// Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword func (client *Client) RequestQrCodeAuthentication(req *RequestQrCodeAuthenticationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -242,12 +316,31 @@ func (client *Client) RegisterUser(req *RegisterUserRequest) (*Ok, error) { 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 { - // The password to check + // The 2-step verification password to check Password string `json:"password"` } -// Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword +// Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword func (client *Client) CheckAuthenticationPassword(req *CheckAuthenticationPasswordRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -268,7 +361,7 @@ func (client *Client) CheckAuthenticationPassword(req *CheckAuthenticationPasswo return UnmarshalOk(result.Data) } -// Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword +// Requests to send a 2-step verification password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword func (client *Client) RequestAuthenticationPasswordRecovery() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -292,7 +385,7 @@ type CheckAuthenticationPasswordRecoveryCodeRequest struct { RecoveryCode string `json:"recovery_code"` } -// Checks whether a password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword +// Checks whether a 2-step verification password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword func (client *Client) CheckAuthenticationPasswordRecoveryCode(req *CheckAuthenticationPasswordRecoveryCodeRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -316,13 +409,13 @@ func (client *Client) CheckAuthenticationPasswordRecoveryCode(req *CheckAuthenti type RecoverAuthenticationPasswordRequest struct { // Recovery code to check RecoveryCode string `json:"recovery_code"` - // New password of the user; may be empty to remove the password + // New 2-step verification password of the user; may be empty to remove the password NewPassword string `json:"new_password"` // New password hint; may be empty NewHint string `json:"new_hint"` } -// Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword +// Recovers the 2-step verification password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword func (client *Client) RecoverAuthenticationPassword(req *RecoverAuthenticationPasswordRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -345,6 +438,32 @@ func (client *Client) RecoverAuthenticationPassword(req *RecoverAuthenticationPa return UnmarshalOk(result.Data) } +type SendAuthenticationFirebaseSmsRequest struct { + // SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application + Token string `json:"token"` +} + +// Sends Firebase Authentication SMS to the phone number of the user. Works only when the current authorization state is authorizationStateWaitCode and the server returned code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos +func (client *Client) SendAuthenticationFirebaseSms(req *SendAuthenticationFirebaseSmsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendAuthenticationFirebaseSms", + }, + Data: map[string]interface{}{ + "token": req.Token, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CheckAuthenticationBotTokenRequest struct { // The bot token Token string `json:"token"` @@ -454,7 +573,7 @@ func (client *Client) ConfirmQrCodeAuthentication(req *ConfirmQrCodeAuthenticati return UnmarshalSession(result.Data) } -// Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization +// Returns all updates needed to restore current TDLib state, i.e. all actual updateAuthorizationState/updateUser/updateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization func (client *Client) GetCurrentState() (*Updates, error) { result, err := client.Send(Request{ meta: meta{ @@ -519,19 +638,19 @@ func (client *Client) GetPasswordState() (*PasswordState, error) { } type SetPasswordRequest struct { - // Previous password of the user + // Previous 2-step verification password of the user OldPassword string `json:"old_password"` - // New password of the user; may be empty to remove the password + // New 2-step verification password of the user; may be empty to remove the password NewPassword string `json:"new_password"` // New password hint; may be empty NewHint string `json:"new_hint"` - // Pass true if the recovery email address must be changed + // Pass true to change also the recovery email address SetRecoveryEmailAddress bool `json:"set_recovery_email_address"` // New recovery email address; may be empty NewRecoveryEmailAddress string `json:"new_recovery_email_address"` } -// Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed +// Changes the 2-step verification password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed func (client *Client) SetPassword(req *SetPasswordRequest) (*PasswordState, error) { result, err := client.Send(Request{ meta: meta{ @@ -556,8 +675,79 @@ func (client *Client) SetPassword(req *SetPasswordRequest) (*PasswordState, erro return UnmarshalPasswordState(result.Data) } +type SetLoginEmailAddressRequest struct { + // New login email address + NewLoginEmailAddress string `json:"new_login_email_address"` +} + +// Changes the login email address of the user. The 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) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setLoginEmailAddress", + }, + Data: map[string]interface{}{ + "new_login_email_address": req.NewLoginEmailAddress, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmailAddressAuthenticationCodeInfo(result.Data) +} + +// Resends the login email address verification code +func (client *Client) ResendLoginEmailAddressCode() (*EmailAddressAuthenticationCodeInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "resendLoginEmailAddressCode", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmailAddressAuthenticationCodeInfo(result.Data) +} + +type CheckLoginEmailAddressCodeRequest struct { + // Email address authentication to check + Code EmailAddressAuthentication `json:"code"` +} + +// Checks the login email address authentication +func (client *Client) CheckLoginEmailAddressCode(req *CheckLoginEmailAddressCodeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkLoginEmailAddressCode", + }, + Data: map[string]interface{}{ + "code": req.Code, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetRecoveryEmailAddressRequest struct { - // The password for the current user + // The 2-step verification password for the current user Password string `json:"password"` } @@ -583,7 +773,7 @@ func (client *Client) GetRecoveryEmailAddress(req *GetRecoveryEmailAddressReques } type SetRecoveryEmailAddressRequest struct { - // Password of the current user + // The 2-step verification password of the current user Password string `json:"password"` // New recovery email address NewRecoveryEmailAddress string `json:"new_recovery_email_address"` @@ -704,7 +894,7 @@ func (client *Client) CheckPasswordRecoveryCode(req *CheckPasswordRecoveryCodeRe type RecoverPasswordRequest struct { // Recovery code to check RecoveryCode string `json:"recovery_code"` - // New password of the user; may be empty to remove the password + // New 2-step verification password of the user; may be empty to remove the password NewPassword string `json:"new_password"` // New password hint; may be empty NewHint string `json:"new_hint"` @@ -784,7 +974,7 @@ func (client *Client) CancelPasswordReset() (*Ok, error) { } type CreateTemporaryPasswordRequest struct { - // Persistent user password + // The 2-step verification password of the current user Password string `json:"password"` // Time during which the temporary password will be valid, in seconds; must be between 60 and 86400 ValidFor int32 `json:"valid_for"` @@ -1037,7 +1227,7 @@ type GetChatRequest struct { ChatId int64 `json:"chat_id"` } -// Returns information about a chat by its identifier, this is an offline request if the current user is not a bot +// Returns information about a chat by its identifier; this is an offline request if the current user is not a bot func (client *Client) GetChat(req *GetChatRequest) (*Chat, error) { result, err := client.Send(Request{ meta: meta{ @@ -1094,7 +1284,7 @@ type GetMessageLocallyRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a message, if it is available locally without sending network request. This is an offline request +// Returns information about a message, if it is available without sending network request. This is an offline request func (client *Client) GetMessageLocally(req *GetMessageLocallyRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1123,7 +1313,7 @@ type GetRepliedMessageRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, and the invoice message for messages of the types messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively +// Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without replied message respectively func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1269,7 +1459,7 @@ type GetMessageViewersRequest struct { } // Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true -func (client *Client) GetMessageViewers(req *GetMessageViewersRequest) (*Users, error) { +func (client *Client) GetMessageViewers(req *GetMessageViewersRequest) (*MessageViewers, error) { result, err := client.Send(Request{ meta: meta{ Type: "getMessageViewers", @@ -1287,7 +1477,7 @@ func (client *Client) GetMessageViewers(req *GetMessageViewersRequest) (*Users, return nil, buildResponseError(result.Data) } - return UnmarshalUsers(result.Data) + return UnmarshalMessageViewers(result.Data) } type GetFileRequest struct { @@ -1323,7 +1513,7 @@ type GetRemoteFileRequest struct { FileType FileType `json:"file_type"` } -// Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application +// Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application func (client *Client) GetRemoteFile(req *GetRemoteFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -1408,7 +1598,7 @@ type SearchPublicChatRequest struct { Username string `json:"username"` } -// Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned +// Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise, an error is returned func (client *Client) SearchPublicChat(req *SearchPublicChatRequest) (*Chat, error) { result, err := client.Send(Request{ meta: meta{ @@ -1462,7 +1652,7 @@ type SearchChatsRequest struct { Limit int32 `json:"limit"` } -// Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list +// Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list func (client *Client) SearchChats(req *SearchChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1546,7 +1736,7 @@ type GetTopChatsRequest struct { Limit int32 `json:"limit"` } -// Returns a list of frequently used chats. Supported only if the chat info database is enabled +// Returns a list of frequently used chats func (client *Client) GetTopChats(req *GetTopChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1597,6 +1787,35 @@ func (client *Client) RemoveTopChat(req *RemoveTopChatRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SearchRecentlyFoundChatsRequest struct { + // Query to search for + Query string `json:"query"` + // The maximum number of chats to be returned + Limit int32 `json:"limit"` +} + +// Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request +func (client *Client) SearchRecentlyFoundChats(req *SearchRecentlyFoundChatsRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchRecentlyFoundChats", + }, + Data: map[string]interface{}{ + "query": req.Query, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + type AddRecentlyFoundChatRequest struct { // Identifier of the chat to add ChatId int64 `json:"chat_id"` @@ -1673,7 +1892,7 @@ type GetRecentlyOpenedChatsRequest struct { Limit int32 `json:"limit"` } -// Returns recently opened chats, this is an offline request. Returns chats in the order of last opening +// Returns recently opened chats; this is an offline request. Returns chats in the order of last opening func (client *Client) GetRecentlyOpenedChats(req *GetRecentlyOpenedChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1695,7 +1914,7 @@ func (client *Client) GetRecentlyOpenedChats(req *GetRecentlyOpenedChatsRequest) } type CheckChatUsernameRequest struct { - // Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created + // Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created ChatId int64 `json:"chat_id"` // Username to be checked Username string `json:"username"` @@ -1730,8 +1949,11 @@ func (client *Client) CheckChatUsername(req *CheckChatUsernameRequest) (CheckCha case TypeCheckChatUsernameResultUsernameOccupied: return UnmarshalCheckChatUsernameResultUsernameOccupied(result.Data) - case TypeCheckChatUsernameResultPublicChatsTooMuch: - return UnmarshalCheckChatUsernameResultPublicChatsTooMuch(result.Data) + case TypeCheckChatUsernameResultUsernamePurchasable: + return UnmarshalCheckChatUsernameResultUsernamePurchasable(result.Data) + + case TypeCheckChatUsernameResultPublicChatsTooMany: + return UnmarshalCheckChatUsernameResultPublicChatsTooMany(result.Data) case TypeCheckChatUsernameResultPublicGroupsUnavailable: return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(result.Data) @@ -1772,7 +1994,7 @@ type CheckCreatedPublicChatsLimitRequest struct { Type PublicChatType `json:"type"` } -// Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached +// Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached. The limit can be increased with Telegram Premium func (client *Client) CheckCreatedPublicChatsLimit(req *CheckCreatedPublicChatsLimitRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -1812,7 +2034,7 @@ func (client *Client) GetSuitableDiscussionChats() (*Chats, error) { return UnmarshalChats(result.Data) } -// Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error +// Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium func (client *Client) GetInactiveSupergroupChats() (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1872,7 +2094,7 @@ type GetChatHistoryRequest struct { Offset int32 `json:"offset"` // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // If true, returns only messages that are available locally without sending network requests + // Pass true to get only messages that are available without sending network requests OnlyLocal bool `json:"only_local"` } @@ -1942,7 +2164,7 @@ func (client *Client) GetMessageThreadHistory(req *GetMessageThreadHistoryReques type DeleteChatHistoryRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Pass true if the chat needs to be removed from the chat list + // Pass true to remove the chat from all chat lists RemoveFromChatList bool `json:"remove_from_chat_list"` // Pass true to delete chat history for all users Revoke bool `json:"revoke"` @@ -1976,7 +2198,7 @@ type DeleteChatRequest struct { ChatId int64 `json:"chat_id"` } -// Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method +// Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the usernames and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat func (client *Client) DeleteChat(req *DeleteChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -2016,8 +2238,8 @@ type SearchChatMessagesRequest struct { MessageThreadId int64 `json:"message_thread_id"` } -// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Messages, error) { +// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation +func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*FoundChatMessages, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchChatMessages", @@ -2041,7 +2263,7 @@ func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Messa return nil, buildResponseError(result.Data) } - return UnmarshalMessages(result.Data) + return UnmarshalFoundChatMessages(result.Data) } type SearchMessagesRequest struct { @@ -2049,15 +2271,11 @@ type SearchMessagesRequest struct { ChatList ChatList `json:"chat_list"` // Query to search for Query string `json:"query"` - // The date of the message starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last message - OffsetDate int32 `json:"offset_date"` - // The chat identifier of the last found message, or 0 for the first request - OffsetChatId int64 `json:"offset_chat_id"` - // The message identifier of the last found message, or 0 for the first request - OffsetMessageId int64 `json:"offset_message_id"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function + // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // If not 0, the minimum date of the messages to return MinDate int32 `json:"min_date"` @@ -2066,21 +2284,19 @@ type SearchMessagesRequest struct { } // Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -func (client *Client) SearchMessages(req *SearchMessagesRequest) (*Messages, error) { +func (client *Client) SearchMessages(req *SearchMessagesRequest) (*FoundMessages, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchMessages", }, Data: map[string]interface{}{ - "chat_list": req.ChatList, - "query": req.Query, - "offset_date": req.OffsetDate, - "offset_chat_id": req.OffsetChatId, - "offset_message_id": req.OffsetMessageId, - "limit": req.Limit, - "filter": req.Filter, - "min_date": req.MinDate, - "max_date": req.MaxDate, + "chat_list": req.ChatList, + "query": req.Query, + "offset": req.Offset, + "limit": req.Limit, + "filter": req.Filter, + "min_date": req.MinDate, + "max_date": req.MaxDate, }, }) if err != nil { @@ -2091,7 +2307,7 @@ func (client *Client) SearchMessages(req *SearchMessagesRequest) (*Messages, err return nil, buildResponseError(result.Data) } - return UnmarshalMessages(result.Data) + return UnmarshalFoundMessages(result.Data) } type SearchSecretMessagesRequest struct { @@ -2099,7 +2315,7 @@ type SearchSecretMessagesRequest struct { ChatId int64 `json:"chat_id"` // Query to search for. If empty, searchChatMessages must be used instead Query string `json:"query"` - // Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` @@ -2133,24 +2349,24 @@ func (client *Client) SearchSecretMessages(req *SearchSecretMessagesRequest) (*F } type SearchCallMessagesRequest struct { - // Identifier of the message from which to search; use 0 to get results from the last message - FromMessageId int64 `json:"from_message_id"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // If true, returns only messages with missed/declined calls + // Pass true to search only for messages with missed/declined calls OnlyMissed bool `json:"only_missed"` } -// Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib -func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*Messages, error) { +// Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib +func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*FoundMessages, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchCallMessages", }, Data: map[string]interface{}{ - "from_message_id": req.FromMessageId, - "limit": req.Limit, - "only_missed": req.OnlyMissed, + "offset": req.Offset, + "limit": req.Limit, + "only_missed": req.OnlyMissed, }, }) if err != nil { @@ -2161,7 +2377,36 @@ func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*Messa return nil, buildResponseError(result.Data) } - return UnmarshalMessages(result.Data) + return UnmarshalFoundMessages(result.Data) +} + +type SearchOutgoingDocumentMessagesRequest struct { + // Query to search for in document file name and message caption + Query string `json:"query"` + // The maximum number of messages to be returned; up to 100 + Limit int32 `json:"limit"` +} + +// Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order +func (client *Client) SearchOutgoingDocumentMessages(req *SearchOutgoingDocumentMessagesRequest) (*FoundMessages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchOutgoingDocumentMessages", + }, + Data: map[string]interface{}{ + "query": req.Query, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundMessages(result.Data) } type DeleteAllCallMessagesRequest struct { @@ -2270,7 +2515,7 @@ func (client *Client) GetChatMessageByDate(req *GetChatMessageByDateRequest) (*M type GetChatSparseMessagePositionsRequest struct { // Identifier of the chat in which to return information about message positions ChatId int64 `json:"chat_id"` - // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about message positions FromMessageId int64 `json:"from_message_id"` @@ -2305,7 +2550,7 @@ func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePos type GetChatMessageCalendarRequest struct { // Identifier of the chat in which to return information about messages ChatId int64 `json:"chat_id"` - // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about messages; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` @@ -2339,7 +2584,7 @@ type GetChatMessageCountRequest struct { ChatId int64 `json:"chat_id"` // Filter for message content; searchMessagesFilterEmpty is unsupported in this function Filter SearchMessagesFilter `json:"filter"` - // If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown + // Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally ReturnLocal bool `json:"return_local"` } @@ -2366,6 +2611,41 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou return UnmarshalCount(result.Data) } +type GetChatMessagePositionRequest struct { + // Identifier of the chat in which to find message position + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function + Filter SearchMessagesFilter `json:"filter"` + // If not 0, only messages in the specified thread will be considered; supergroups only + MessageThreadId int64 `json:"message_thread_id"` +} + +// Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats +func (client *Client) GetChatMessagePosition(req *GetChatMessagePositionRequest) (*Count, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatMessagePosition", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "filter": req.Filter, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCount(result.Data) +} + type GetChatScheduledMessagesRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -2392,51 +2672,16 @@ func (client *Client) GetChatScheduledMessages(req *GetChatScheduledMessagesRequ return UnmarshalMessages(result.Data) } -type GetMessagePublicForwardsRequest struct { - // Chat identifier of the message - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` - // Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results - Offset string `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit - Limit int32 `json:"limit"` -} - -// Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib -func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*FoundMessages, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getMessagePublicForwards", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalFoundMessages(result.Data) -} - -type GetChatSponsoredMessageRequest struct { +type GetChatSponsoredMessagesRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` } -// Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat -func (client *Client) GetChatSponsoredMessage(req *GetChatSponsoredMessageRequest) (*SponsoredMessage, error) { +// Returns sponsored messages to be shown in a chat; for channel chats only +func (client *Client) GetChatSponsoredMessages(req *GetChatSponsoredMessagesRequest) (*SponsoredMessages, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getChatSponsoredMessage", + Type: "getChatSponsoredMessages", }, Data: map[string]interface{}{ "chat_id": req.ChatId, @@ -2450,7 +2695,36 @@ func (client *Client) GetChatSponsoredMessage(req *GetChatSponsoredMessageReques return nil, buildResponseError(result.Data) } - return UnmarshalSponsoredMessage(result.Data) + return UnmarshalSponsoredMessages(result.Data) +} + +type ClickChatSponsoredMessageRequest struct { + // Chat identifier of the sponsored message + ChatId int64 `json:"chat_id"` + // Identifier of the sponsored message + MessageId int64 `json:"message_id"` +} + +// Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message +func (client *Client) ClickChatSponsoredMessage(req *ClickChatSponsoredMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clickChatSponsoredMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) } type RemoveNotificationRequest struct { @@ -2516,12 +2790,12 @@ type GetMessageLinkRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview + // If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its web page preview MediaTimestamp int32 `json:"media_timestamp"` // Pass true to create a link for the whole media album ForAlbum bool `json:"for_album"` - // Pass true to create a link to the message as a channel post comment, or from a message thread - ForComment bool `json:"for_comment"` + // Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic + InMessageThread bool `json:"in_message_thread"` } // Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request @@ -2531,11 +2805,11 @@ func (client *Client) GetMessageLink(req *GetMessageLinkRequest) (*MessageLink, Type: "getMessageLink", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "media_timestamp": req.MediaTimestamp, - "for_album": req.ForAlbum, - "for_comment": req.ForComment, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "media_timestamp": req.MediaTimestamp, + "for_album": req.ForAlbum, + "in_message_thread": req.InMessageThread, }, }) if err != nil { @@ -2607,13 +2881,135 @@ func (client *Client) GetMessageLinkInfo(req *GetMessageLinkInfoRequest) (*Messa return UnmarshalMessageLinkInfo(result.Data) } +type TranslateTextRequest struct { + // Text to translate + Text *FormattedText `json:"text"` + // Language code of the language to which the message is translated. Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" + ToLanguageCode string `json:"to_language_code"` +} + +// Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved +func (client *Client) TranslateText(req *TranslateTextRequest) (*FormattedText, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "translateText", + }, + Data: map[string]interface{}{ + "text": req.Text, + "to_language_code": req.ToLanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFormattedText(result.Data) +} + +type TranslateMessageTextRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Language code of the language to which the message is translated. Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" + ToLanguageCode string `json:"to_language_code"` +} + +// Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved +func (client *Client) TranslateMessageText(req *TranslateMessageTextRequest) (*FormattedText, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "translateMessageText", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "to_language_code": req.ToLanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFormattedText(result.Data) +} + +type RecognizeSpeechRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +// Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized +func (client *Client) RecognizeSpeech(req *RecognizeSpeechRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "recognizeSpeech", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RateSpeechRecognitionRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Pass true if the speech recognition is good + IsGood bool `json:"is_good"` +} + +// Rates recognized speech in a video note or a voice note message +func (client *Client) RateSpeechRecognition(req *RateSpeechRecognitionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "rateSpeechRecognition", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "is_good": req.IsGood, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetChatAvailableMessageSendersRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` } // Returns list of message sender identifiers, which can be used to send messages in a chat -func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessageSendersRequest) (*MessageSenders, error) { +func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessageSendersRequest) (*ChatMessageSenders, error) { result, err := client.Send(Request{ meta: meta{ Type: "getChatAvailableMessageSenders", @@ -2630,7 +3026,7 @@ func (client *Client) GetChatAvailableMessageSenders(req *GetChatAvailableMessag return nil, buildResponseError(result.Data) } - return UnmarshalMessageSenders(result.Data) + return UnmarshalChatMessageSenders(result.Data) } type SetChatMessageSenderRequest struct { @@ -2667,8 +3063,8 @@ type SendMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the message to reply to or 0 - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` // Markup for replying to the message; pass null if none; for bots only @@ -2686,7 +3082,7 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { Data: map[string]interface{}{ "chat_id": req.ChatId, "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, "options": req.Options, "reply_markup": req.ReplyMarkup, "input_message_content": req.InputMessageContent, @@ -2708,8 +3104,8 @@ type SendMessageAlbumRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the messages will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a message to reply to or 0 - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` // Contents of messages to be sent. At most 10 messages can be added to an album @@ -2725,7 +3121,7 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, Data: map[string]interface{}{ "chat_id": req.ChatId, "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, "options": req.Options, "input_message_contents": req.InputMessageContents, }, @@ -2778,15 +3174,15 @@ type SendInlineQueryResultMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a message to reply to or 0 - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` // Identifier of the inline query QueryId JsonInt64 `json:"query_id"` - // Identifier of the inline result + // Identifier of the inline query result ResultId string `json:"result_id"` - // If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and GetOption("venue_search_bot_username") + // Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") HideViaBot bool `json:"hide_via_bot"` } @@ -2797,13 +3193,13 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes Type: "sendInlineQueryResultMessage", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, - "options": req.Options, - "query_id": req.QueryId, - "result_id": req.ResultId, - "hide_via_bot": req.HideViaBot, + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "reply_to": req.ReplyTo, + "options": req.Options, + "query_id": req.QueryId, + "result_id": req.ResultId, + "hide_via_bot": req.HideViaBot, }, }) if err != nil { @@ -2820,18 +3216,18 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes type ForwardMessagesRequest struct { // Identifier of the chat to which to forward messages ChatId int64 `json:"chat_id"` + // If not 0, a message thread identifier in which the message will be sent; for forum threads only + MessageThreadId int64 `json:"message_thread_id"` // Identifier of the chat from which to forward messages FromChatId int64 `json:"from_chat_id"` - // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously + // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if message.can_be_forwarded MessageIds []int64 `json:"message_ids"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` - // If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local + // Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local SendCopy bool `json:"send_copy"` - // If true, media caption of message copies will be removed. Ignored if send_copy is false + // Pass true to remove media captions of message copies. Ignored if send_copy is false RemoveCaption bool `json:"remove_caption"` - // If true, messages will not be forwarded and instead fake messages will be returned - OnlyPreview bool `json:"only_preview"` } // Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message @@ -2841,13 +3237,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, - "options": req.Options, - "send_copy": req.SendCopy, - "remove_caption": req.RemoveCaption, - "only_preview": req.OnlyPreview, + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "from_chat_id": req.FromChatId, + "message_ids": req.MessageIds, + "options": req.Options, + "send_copy": req.SendCopy, + "remove_caption": req.RemoveCaption, }, }) if err != nil { @@ -2866,6 +3262,8 @@ type ResendMessagesRequest struct { ChatId int64 `json:"chat_id"` // Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order MessageIds []int64 `json:"message_ids"` + // New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false + Quote *FormattedText `json:"quote"` } // 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 @@ -2877,6 +3275,7 @@ func (client *Client) ResendMessages(req *ResendMessagesRequest) (*Messages, err Data: map[string]interface{}{ "chat_id": req.ChatId, "message_ids": req.MessageIds, + "quote": req.Quote, }, }) if err != nil { @@ -2890,39 +3289,13 @@ func (client *Client) ResendMessages(req *ResendMessagesRequest) (*Messages, err return UnmarshalMessages(result.Data) } -type SendChatScreenshotTakenNotificationRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` -} - -// Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats -func (client *Client) SendChatScreenshotTakenNotification(req *SendChatScreenshotTakenNotificationRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "sendChatScreenshotTakenNotification", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type AddLocalMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` // Identifier of the sender of the message SenderId MessageSender `json:"sender_id"` - // Identifier of the message to reply to or 0 - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Pass true to disable notification for the message DisableNotification bool `json:"disable_notification"` // The content of the message to be added @@ -2938,7 +3311,7 @@ func (client *Client) AddLocalMessage(req *AddLocalMessageRequest) (*Message, er Data: map[string]interface{}{ "chat_id": req.ChatId, "sender_id": req.SenderId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, "disable_notification": req.DisableNotification, "input_message_content": req.InputMessageContent, }, @@ -3168,7 +3541,7 @@ type EditMessageCaptionRequest struct { MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New message content caption; 0-GetOption("message_caption_length_max") characters; pass null to remove caption + // New message content caption; 0-getOption("message_caption_length_max") characters; pass null to remove caption Caption *FormattedText `json:"caption"` } @@ -3335,7 +3708,7 @@ type EditInlineMessageCaptionRequest struct { InlineMessageId string `json:"inline_message_id"` // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` - // New message content caption; pass null to remove caption; 0-GetOption("message_caption_length_max") characters + // New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -3423,12 +3796,651 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState return UnmarshalOk(result.Data) } +// Returns list of custom emojis, which can be used as forum topic icon by all users +func (client *Client) GetForumTopicDefaultIcons() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getForumTopicDefaultIcons", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +type CreateForumTopicRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Name of the topic; 1-128 characters + Name string `json:"name"` + // Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons + Icon *ForumTopicIcon `json:"icon"` +} + +// Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup +func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopicInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createForumTopic", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "name": req.Name, + "icon": req.Icon, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalForumTopicInfo(result.Data) +} + +type EditForumTopicRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` + // New name of the topic; 0-128 characters. If empty, the previous topic name is kept + Name string `json:"name"` + // Pass true to edit the icon of the topic. Icon of the General topic can't be edited + EditIconCustomEmoji bool `json:"edit_icon_custom_emoji"` + // Identifier of the new custom emoji for topic icon; pass 0 to remove the custom emoji. Ignored if edit_icon_custom_emoji is false. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` +} + +// Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic +func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editForumTopic", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "name": req.Name, + "edit_icon_custom_emoji": req.EditIconCustomEmoji, + "icon_custom_emoji_id": req.IconCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetForumTopicRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` +} + +// Returns information about a forum topic +func (client *Client) GetForumTopic(req *GetForumTopicRequest) (*ForumTopic, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getForumTopic", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalForumTopic(result.Data) +} + +type GetForumTopicLinkRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` +} + +// Returns an HTTPS link to a topic in a forum chat. This is an offline request +func (client *Client) GetForumTopicLink(req *GetForumTopicLinkRequest) (*MessageLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getForumTopicLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageLink(result.Data) +} + +type GetForumTopicsRequest struct { + // Identifier of the forum chat + ChatId int64 `json:"chat_id"` + // Query to search for in the forum topic's name + Query string `json:"query"` + // The date starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last topic + OffsetDate int32 `json:"offset_date"` + // The message identifier of the last message in the last found topic, or 0 for the first request + OffsetMessageId int64 `json:"offset_message_id"` + // The message thread identifier of the last found topic, or 0 for the first request + OffsetMessageThreadId int64 `json:"offset_message_thread_id"` + // The maximum number of forum topics to be returned; up to 100. For optimal performance, the number of returned forum topics is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server +func (client *Client) GetForumTopics(req *GetForumTopicsRequest) (*ForumTopics, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getForumTopics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "query": req.Query, + "offset_date": req.OffsetDate, + "offset_message_id": req.OffsetMessageId, + "offset_message_thread_id": req.OffsetMessageThreadId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalForumTopics(result.Data) +} + +type SetForumTopicNotificationSettingsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` + // New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` +} + +// Changes the notification settings of a forum topic +func (client *Client) SetForumTopicNotificationSettings(req *SetForumTopicNotificationSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setForumTopicNotificationSettings", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "notification_settings": req.NotificationSettings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleForumTopicIsClosedRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` + // Pass true to close the topic; pass false to reopen it + IsClosed bool `json:"is_closed"` +} + +// Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic +func (client *Client) ToggleForumTopicIsClosed(req *ToggleForumTopicIsClosedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleForumTopicIsClosed", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "is_closed": req.IsClosed, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleGeneralForumTopicIsHiddenRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Pass true to hide and close the General topic; pass false to unhide it + IsHidden bool `json:"is_hidden"` +} + +// Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup +func (client *Client) ToggleGeneralForumTopicIsHidden(req *ToggleGeneralForumTopicIsHiddenRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleGeneralForumTopicIsHidden", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "is_hidden": req.IsHidden, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleForumTopicIsPinnedRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` + // Pass true to pin the topic; pass false to unpin it + IsPinned bool `json:"is_pinned"` +} + +// Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics +func (client *Client) ToggleForumTopicIsPinned(req *ToggleForumTopicIsPinnedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleForumTopicIsPinned", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "is_pinned": req.IsPinned, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetPinnedForumTopicsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new list of pinned forum topics + MessageThreadIds []int64 `json:"message_thread_ids"` +} + +// Changes the order of pinned forum topics +func (client *Client) SetPinnedForumTopics(req *SetPinnedForumTopicsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setPinnedForumTopics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_ids": req.MessageThreadIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteForumTopicRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` +} + +// Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages +func (client *Client) DeleteForumTopic(req *DeleteForumTopicRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteForumTopic", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetEmojiReactionRequest struct { + // Text representation of the reaction + Emoji string `json:"emoji"` +} + +// Returns information about a emoji reaction. Returns a 404 error if the reaction is not found +func (client *Client) GetEmojiReaction(req *GetEmojiReactionRequest) (*EmojiReaction, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getEmojiReaction", + }, + Data: map[string]interface{}{ + "emoji": req.Emoji, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiReaction(result.Data) +} + +// Returns TGS stickers with generic animations for custom emoji reactions +func (client *Client) GetCustomEmojiReactionAnimations() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCustomEmojiReactionAnimations", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +type GetMessageAvailableReactionsRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Number of reaction per row, 5-25 + RowSize int32 `json:"row_size"` +} + +// Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message +func (client *Client) GetMessageAvailableReactions(req *GetMessageAvailableReactionsRequest) (*AvailableReactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageAvailableReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "row_size": req.RowSize, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAvailableReactions(result.Data) +} + +// Clears the list of recently used reactions +func (client *Client) ClearRecentReactions() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clearRecentReactions", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AddMessageReactionRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Type of the reaction to add + ReactionType ReactionType `json:"reaction_type"` + // Pass true if the reaction is added with a big animation + IsBig bool `json:"is_big"` + // Pass true if the reaction needs to be added to recent reactions + UpdateRecentReactions bool `json:"update_recent_reactions"` +} + +// Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message +func (client *Client) AddMessageReaction(req *AddMessageReactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addMessageReaction", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reaction_type": req.ReactionType, + "is_big": req.IsBig, + "update_recent_reactions": req.UpdateRecentReactions, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveMessageReactionRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Type of the reaction to remove + ReactionType ReactionType `json:"reaction_type"` +} + +// Removes a reaction from a message. A chosen reaction can always be removed +func (client *Client) RemoveMessageReaction(req *RemoveMessageReactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeMessageReaction", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reaction_type": req.ReactionType, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetMessageAddedReactionsRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Type of the reactions to return; pass null to return all added reactions + ReactionType ReactionType `json:"reaction_type"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of reactions to be returned; must be positive and can't be greater than 100 + Limit int32 `json:"limit"` +} + +// Returns reactions added for a message, along with their sender +func (client *Client) GetMessageAddedReactions(req *GetMessageAddedReactionsRequest) (*AddedReactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageAddedReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reaction_type": req.ReactionType, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAddedReactions(result.Data) +} + +type SetDefaultReactionTypeRequest struct { + // New type of the default reaction + ReactionType ReactionType `json:"reaction_type"` +} + +// Changes type of default reaction for the current user +func (client *Client) SetDefaultReactionType(req *SetDefaultReactionTypeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setDefaultReactionType", + }, + Data: map[string]interface{}{ + "reaction_type": req.ReactionType, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SearchQuoteRequest struct { + // Text in which to search for the quote + Text *FormattedText `json:"text"` + // Quote to search for + Quote *FormattedText `json:"quote"` + // Approximate quote position in UTF-16 code units + QuotePosition int32 `json:"quote_position"` +} + +// Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously +func SearchQuote(req *SearchQuoteRequest) (*FoundPosition, error) { + result, err := Execute(Request{ + meta: meta{ + Type: "searchQuote", + }, + Data: map[string]interface{}{ + "text": req.Text, + "quote": req.Quote, + "quote_position": req.QuotePosition, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundPosition(result.Data) +} + +// deprecated +// Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously +func (client *Client) SearchQuote(req *SearchQuoteRequest) (*FoundPosition, error) { + return SearchQuote(req) +} + type GetTextEntitiesRequest struct { - // The text in which to look for entites + // The text in which to look for entities Text string `json:"text"` } -// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously +// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously func GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { result, err := Execute(Request{ meta: meta{ @@ -3450,7 +4462,7 @@ func GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { } // deprecated -// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously +// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously func (client *Client) GetTextEntities(req *GetTextEntitiesRequest) (*TextEntities, error) { return GetTextEntities(req) } @@ -3462,7 +4474,7 @@ type ParseTextEntitiesRequest struct { ParseMode TextParseMode `json:"parse_mode"` } -// Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { result, err := Execute(Request{ meta: meta{ @@ -3485,13 +4497,13 @@ func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { } // deprecated -// Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { return ParseTextEntities(req) } type ParseMarkdownRequest struct { - // The text to parse. For example, "__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" + // The text to parse. For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**" Text *FormattedText `json:"text"` } @@ -3788,6 +4800,38 @@ func (client *Client) GetJsonString(req *GetJsonStringRequest) (*Text, error) { return GetJsonString(req) } +type GetThemeParametersJsonStringRequest struct { + // Theme parameters to convert to JSON + Theme *ThemeParameters `json:"theme"` +} + +// Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously +func GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Text, error) { + result, err := Execute(Request{ + meta: meta{ + Type: "getThemeParametersJsonString", + }, + Data: map[string]interface{}{ + "theme": req.Theme, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +// deprecated +// Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously +func (client *Client) GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Text, error) { + return GetThemeParametersJsonString(req) +} + type SetPollAnswerRequest struct { // Identifier of the chat to which the poll belongs ChatId int64 `json:"chat_id"` @@ -3827,14 +4871,14 @@ type GetPollVotersRequest struct { 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 + // Number of voters 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. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached + // The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached Limit int32 `json:"limit"` } -// Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib -func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*Users, error) { +// Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib +func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*MessageSenders, error) { result, err := client.Send(Request{ meta: meta{ Type: "getPollVoters", @@ -3855,7 +4899,7 @@ func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*Users, error) { return nil, buildResponseError(result.Data) } - return UnmarshalUsers(result.Data) + return UnmarshalMessageSenders(result.Data) } type StopPollRequest struct { @@ -3867,7 +4911,7 @@ type StopPollRequest struct { ReplyMarkup ReplyMarkup `json:"reply_markup"` } -// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set +// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set func (client *Client) StopPoll(req *StopPollRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -3964,7 +5008,7 @@ type GetLoginUrlRequest struct { MessageId int64 `json:"message_id"` // Button identifier ButtonId int64 `json:"button_id"` - // True, if the user allowed the bot to send them messages + // Pass true to allow the bot to send messages to the current user AllowWriteAccess bool `json:"allow_write_access"` } @@ -3992,8 +5036,84 @@ func (client *Client) GetLoginUrl(req *GetLoginUrlRequest) (*HttpUrl, error) { return UnmarshalHttpUrl(result.Data) } +type ShareUserWithBotRequest struct { + // Identifier of the chat with the bot + ChatId int64 `json:"chat_id"` + // Identifier of the message with the button + MessageId int64 `json:"message_id"` + // Identifier of the button + ButtonId int32 `json:"button_id"` + // Identifier of the shared user + SharedUserId int64 `json:"shared_user_id"` + // Pass true to check that the user can be shared by the button instead of actually sharing them + OnlyCheck bool `json:"only_check"` +} + +// Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot +func (client *Client) ShareUserWithBot(req *ShareUserWithBotRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "shareUserWithBot", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "button_id": req.ButtonId, + "shared_user_id": req.SharedUserId, + "only_check": req.OnlyCheck, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ShareChatWithBotRequest struct { + // Identifier of the chat with the bot + ChatId int64 `json:"chat_id"` + // Identifier of the message with the button + MessageId int64 `json:"message_id"` + // Identifier of the button + ButtonId int32 `json:"button_id"` + // Identifier of the shared chat + SharedChatId int64 `json:"shared_chat_id"` + // Pass true to check that the chat can be shared by the button instead of actually sharing it. Doesn't check bot_is_member and bot_administrator_rights restrictions. If the bot must be a member, then all chats from getGroupsInCommon and all chats, where the user can add the bot, are suitable. In the latter case the bot will be automatically added to the chat. If the bot must be an administrator, then all chats, where the bot already has requested rights or can be added to administrators by the user, are suitable. In the latter case the bot will be automatically granted requested rights + OnlyCheck bool `json:"only_check"` +} + +// Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot +func (client *Client) ShareChatWithBot(req *ShareChatWithBotRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "shareChatWithBot", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "button_id": req.ButtonId, + "shared_chat_id": req.SharedChatId, + "only_check": req.OnlyCheck, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetInlineQueryResultsRequest struct { - // The identifier of the target bot + // Identifier of the target bot BotUserId int64 `json:"bot_user_id"` // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` @@ -4001,7 +5121,7 @@ type GetInlineQueryResultsRequest struct { UserLocation *Location `json:"user_location"` // Text of the query Query string `json:"query"` - // Offset of the first entry to return + // Offset of the first entry to return; use empty string to get the first chunk of results Offset string `json:"offset"` } @@ -4033,18 +5153,16 @@ func (client *Client) GetInlineQueryResults(req *GetInlineQueryResultsRequest) ( type AnswerInlineQueryRequest struct { // Identifier of the inline query InlineQueryId JsonInt64 `json:"inline_query_id"` - // True, if the result of the query can be cached for the specified user + // Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query IsPersonal bool `json:"is_personal"` + // Button to be shown above inline query results; pass null if none + Button *InlineQueryResultsButton `json:"button"` // The results of the query Results []InputInlineQueryResult `json:"results"` // Allowed time to cache the results of the query, in seconds CacheTime int32 `json:"cache_time"` // Offset for the next inline query; pass an empty string if there are no more results NextOffset string `json:"next_offset"` - // If non-empty, this text must be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter - SwitchPmText string `json:"switch_pm_text"` - // The parameter for the bot start message - SwitchPmParameter string `json:"switch_pm_parameter"` } // Sets the result of an inline query; for bots only @@ -4054,13 +5172,12 @@ func (client *Client) AnswerInlineQuery(req *AnswerInlineQueryRequest) (*Ok, err Type: "answerInlineQuery", }, Data: map[string]interface{}{ - "inline_query_id": req.InlineQueryId, - "is_personal": req.IsPersonal, - "results": req.Results, - "cache_time": req.CacheTime, - "next_offset": req.NextOffset, - "switch_pm_text": req.SwitchPmText, - "switch_pm_parameter": req.SwitchPmParameter, + "inline_query_id": req.InlineQueryId, + "is_personal": req.IsPersonal, + "button": req.Button, + "results": req.Results, + "cache_time": req.CacheTime, + "next_offset": req.NextOffset, }, }) if err != nil { @@ -4074,6 +5191,245 @@ func (client *Client) AnswerInlineQuery(req *AnswerInlineQueryRequest) (*Ok, err return UnmarshalOk(result.Data) } +type SearchWebAppRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // Short name of the Web App + WebAppShortName string `json:"web_app_short_name"` +} + +// Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found +func (client *Client) SearchWebApp(req *SearchWebAppRequest) (*FoundWebApp, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchWebApp", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "web_app_short_name": req.WebAppShortName, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundWebApp(result.Data) +} + +type GetWebAppLinkUrlRequest struct { + // Identifier of the chat in which the link was clicked; pass 0 if none + ChatId int64 `json:"chat_id"` + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // Short name of the Web App + WebAppShortName string `json:"web_app_short_name"` + // Start parameter from internalLinkTypeWebApp + StartParameter string `json:"start_parameter"` + // Preferred Web App theme; pass null to use the default theme + Theme *ThemeParameters `json:"theme"` + // Short name of the application; 0-64 English letters, digits, and underscores + ApplicationName string `json:"application_name"` + // Pass true if the current user allowed the bot to send them messages + AllowWriteAccess bool `json:"allow_write_access"` +} + +// Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked +func (client *Client) GetWebAppLinkUrl(req *GetWebAppLinkUrlRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getWebAppLinkUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "bot_user_id": req.BotUserId, + "web_app_short_name": req.WebAppShortName, + "start_parameter": req.StartParameter, + "theme": req.Theme, + "application_name": req.ApplicationName, + "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 GetWebAppUrlRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, an internalLinkTypeSideMenuBot link, or an empty when the bot is opened from the side menu + Url string `json:"url"` + // Preferred Web App theme; pass null to use the default theme + Theme *ThemeParameters `json:"theme"` + // Short name of the application; 0-64 English letters, digits, and underscores + ApplicationName string `json:"application_name"` +} + +// Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link +func (client *Client) GetWebAppUrl(req *GetWebAppUrlRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getWebAppUrl", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "url": req.Url, + "theme": req.Theme, + "application_name": req.ApplicationName, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + +type SendWebAppDataRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // Text of the keyboardButtonTypeWebApp button, which opened the Web App + ButtonText string `json:"button_text"` + // The data + Data string `json:"data"` +} + +// Sends data received from a keyboardButtonTypeWebApp Web App to a bot +func (client *Client) SendWebAppData(req *SendWebAppDataRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendWebAppData", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "button_text": req.ButtonText, + "data": req.Data, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type OpenWebAppRequest struct { + // Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats + ChatId int64 `json:"chat_id"` + // Identifier of the bot, providing the Web App + BotUserId int64 `json:"bot_user_id"` + // The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise + Url string `json:"url"` + // Preferred Web App theme; pass null to use the default theme + Theme *ThemeParameters `json:"theme"` + // Short name of the application; 0-64 English letters, digits, and underscores + ApplicationName string `json:"application_name"` + // If not 0, a message thread identifier in which the message will be sent + MessageThreadId int64 `json:"message_thread_id"` + // Information about the message or story to be replied in the message sent by the Web App; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` +} + +// Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once +func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "openWebApp", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "bot_user_id": req.BotUserId, + "url": req.Url, + "theme": req.Theme, + "application_name": req.ApplicationName, + "message_thread_id": req.MessageThreadId, + "reply_to": req.ReplyTo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalWebAppInfo(result.Data) +} + +type CloseWebAppRequest struct { + // Identifier of Web App launch, received from openWebApp + WebAppLaunchId JsonInt64 `json:"web_app_launch_id"` +} + +// Informs TDLib that a previously opened Web App was closed +func (client *Client) CloseWebApp(req *CloseWebAppRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "closeWebApp", + }, + Data: map[string]interface{}{ + "web_app_launch_id": req.WebAppLaunchId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AnswerWebAppQueryRequest struct { + // Identifier of the Web App query + WebAppQueryId string `json:"web_app_query_id"` + // The result of the query + Result InputInlineQueryResult `json:"result"` +} + +// Sets the result of interaction with a Web App and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only +func (client *Client) AnswerWebAppQuery(req *AnswerWebAppQueryRequest) (*SentWebAppMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "answerWebAppQuery", + }, + Data: map[string]interface{}{ + "web_app_query_id": req.WebAppQueryId, + "result": req.Result, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalSentWebAppMessage(result.Data) +} + type GetCallbackQueryAnswerRequest struct { // Identifier of the chat with the message ChatId int64 `json:"chat_id"` @@ -4111,7 +5467,7 @@ type AnswerCallbackQueryRequest struct { CallbackQueryId JsonInt64 `json:"callback_query_id"` // Text of the answer Text string `json:"text"` - // If true, an alert must be shown to the user instead of a toast notification + // Pass true to show an alert to the user instead of a toast notification ShowAlert bool `json:"show_alert"` // URL to be opened Url string `json:"url"` @@ -4210,7 +5566,7 @@ type SetGameScoreRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // True, if the message needs to be edited + // Pass true to edit the game message to include the current scoreboard EditMessage bool `json:"edit_message"` // User identifier UserId int64 `json:"user_id"` @@ -4249,7 +5605,7 @@ func (client *Client) SetGameScore(req *SetGameScoreRequest) (*Message, error) { type SetInlineGameScoreRequest struct { // Inline message identifier InlineMessageId string `json:"inline_message_id"` - // True, if the message needs to be edited + // Pass true to edit the game message to include the current scoreboard EditMessage bool `json:"edit_message"` // User identifier UserId int64 `json:"user_id"` @@ -4352,7 +5708,7 @@ type DeleteChatReplyMarkupRequest struct { MessageId int64 `json:"message_id"` } -// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup is changed +// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4461,11 +5817,11 @@ func (client *Client) CloseChat(req *CloseChatRequest) (*Ok, error) { type ViewMessagesRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // If not 0, a message thread identifier in which the messages are being viewed - MessageThreadId int64 `json:"message_thread_id"` // The identifiers of the messages being viewed MessageIds []int64 `json:"message_ids"` - // True, if messages in closed chats must be marked as read by the request + // Source of the message view; pass null to guess the source based on chat open state + Source MessageSource `json:"source"` + // Pass true to mark as read the specified messages even the chat is closed ForceRead bool `json:"force_read"` } @@ -4476,10 +5832,10 @@ func (client *Client) ViewMessages(req *ViewMessagesRequest) (*Ok, error) { Type: "viewMessages", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, - "message_ids": req.MessageIds, - "force_read": req.ForceRead, + "chat_id": req.ChatId, + "message_ids": req.MessageIds, + "source": req.Source, + "force_read": req.ForceRead, }, }) if err != nil { @@ -4551,6 +5907,35 @@ func (client *Client) ClickAnimatedEmojiMessage(req *ClickAnimatedEmojiMessageRe return UnmarshalSticker(result.Data) } +type GetInternalLinkRequest struct { + // Expected type of the link + Type InternalLinkType `json:"type"` + // Pass true to create an HTTPS link (only available for some link types); pass false to create a tg: link + IsHttp bool `json:"is_http"` +} + +// Returns an HTTPS or a tg: link with the given type. Can be called before authorization +func (client *Client) GetInternalLink(req *GetInternalLinkRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getInternalLink", + }, + Data: map[string]interface{}{ + "type": req.Type, + "is_http": req.IsHttp, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + type GetInternalLinkTypeRequest struct { // The link Link string `json:"link"` @@ -4578,12 +5963,18 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(result.Data) + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(result.Data) + case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(result.Data) case TypeInternalLinkTypeBackground: return UnmarshalInternalLinkTypeBackground(result.Data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(result.Data) + case TypeInternalLinkTypeBotStart: return UnmarshalInternalLinkTypeBotStart(result.Data) @@ -4593,18 +5984,39 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) + case TypeInternalLinkTypeChatBoost: + return UnmarshalInternalLinkTypeChatBoost(result.Data) + + case TypeInternalLinkTypeChatFolderInvite: + return UnmarshalInternalLinkTypeChatFolderInvite(result.Data) + + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(result.Data) + case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(result.Data) - case TypeInternalLinkTypeFilterSettings: - return UnmarshalInternalLinkTypeFilterSettings(result.Data) + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(result.Data) + + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(result.Data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(result.Data) + case TypeInternalLinkTypeInstantView: + return UnmarshalInternalLinkTypeInstantView(result.Data) + + case TypeInternalLinkTypeInvoice: + return UnmarshalInternalLinkTypeInvoice(result.Data) + case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(result.Data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(result.Data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(result.Data) @@ -4617,6 +6029,15 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(result.Data) + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(result.Data) + + case TypeInternalLinkTypePremiumGiftCode: + return UnmarshalInternalLinkTypePremiumGiftCode(result.Data) + + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(result.Data) + case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(result.Data) @@ -4626,12 +6047,21 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeQrCodeAuthentication: return UnmarshalInternalLinkTypeQrCodeAuthentication(result.Data) + case TypeInternalLinkTypeRestorePurchases: + return UnmarshalInternalLinkTypeRestorePurchases(result.Data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(result.Data) + case TypeInternalLinkTypeSideMenuBot: + return UnmarshalInternalLinkTypeSideMenuBot(result.Data) + case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(result.Data) + case TypeInternalLinkTypeStory: + return UnmarshalInternalLinkTypeStory(result.Data) + case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(result.Data) @@ -4644,9 +6074,18 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(result.Data) + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(result.Data) + + case TypeInternalLinkTypeUserToken: + return UnmarshalInternalLinkTypeUserToken(result.Data) + case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(result.Data) + case TypeInternalLinkTypeWebApp: + return UnmarshalInternalLinkTypeWebApp(result.Data) + default: return nil, errors.New("invalid type") } @@ -4690,7 +6129,7 @@ func (client *Client) GetExternalLinkInfo(req *GetExternalLinkInfoRequest) (Logi type GetExternalLinkRequest struct { // The HTTP link Link string `json:"link"` - // True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages + // Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages AllowWriteAccess bool `json:"allow_write_access"` } @@ -4742,10 +6181,94 @@ func (client *Client) ReadAllChatMentions(req *ReadAllChatMentionsRequest) (*Ok, return UnmarshalOk(result.Data) } +type ReadAllMessageThreadMentionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message thread identifier in which mentions are marked as read + MessageThreadId int64 `json:"message_thread_id"` +} + +// Marks all mentions in a forum topic as read +func (client *Client) ReadAllMessageThreadMentions(req *ReadAllMessageThreadMentionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllMessageThreadMentions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReadAllChatReactionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Marks all reactions in a chat or a forum topic as read +func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllChatReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReadAllMessageThreadReactionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message thread identifier in which reactions are marked as read + MessageThreadId int64 `json:"message_thread_id"` +} + +// Marks all reactions in a forum topic as read +func (client *Client) ReadAllMessageThreadReactions(req *ReadAllMessageThreadReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllMessageThreadReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CreatePrivateChatRequest struct { // User identifier UserId int64 `json:"user_id"` - // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect + // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4774,7 +6297,7 @@ func (client *Client) CreatePrivateChat(req *CreatePrivateChatRequest) (*Chat, e type CreateBasicGroupChatRequest struct { // Basic group identifier BasicGroupId int64 `json:"basic_group_id"` - // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect + // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4803,7 +6326,7 @@ func (client *Client) CreateBasicGroupChat(req *CreateBasicGroupChatRequest) (*C type CreateSupergroupChatRequest struct { // Supergroup or channel identifier SupergroupId int64 `json:"supergroup_id"` - // If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect + // Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect Force bool `json:"force"` } @@ -4856,10 +6379,12 @@ func (client *Client) CreateSecretChat(req *CreateSecretChatRequest) (*Chat, err } type CreateNewBasicGroupChatRequest struct { - // Identifiers of users to be added to the basic group + // Identifiers of users to be added to the basic group; may be empty to create a basic group without other members UserIds []int64 `json:"user_ids"` // Title of the new basic group; 1-128 characters Title string `json:"title"` + // Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` } // Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat @@ -4869,8 +6394,9 @@ func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatReques Type: "createNewBasicGroupChat", }, Data: map[string]interface{}{ - "user_ids": req.UserIds, - "title": req.Title, + "user_ids": req.UserIds, + "title": req.Title, + "message_auto_delete_time": req.MessageAutoDeleteTime, }, }) if err != nil { @@ -4887,13 +6413,17 @@ func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatReques type CreateNewSupergroupChatRequest struct { // Title of the new chat; 1-128 characters Title string `json:"title"` - // True, if a channel chat needs to be created + // Pass true to create a forum supergroup chat + IsForum bool `json:"is_forum"` + // Pass true to create a channel chat; ignored if a forum is created IsChannel bool `json:"is_channel"` // Chat description; 0-255 characters Description string `json:"description"` // Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat Location *ChatLocation `json:"location"` - // True, if the supergroup is created for importing messages using importMessage + // Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + // Pass true to create a supergroup for importing messages using importMessages ForImport bool `json:"for_import"` } @@ -4904,11 +6434,13 @@ func (client *Client) CreateNewSupergroupChat(req *CreateNewSupergroupChatReques Type: "createNewSupergroupChat", }, Data: map[string]interface{}{ - "title": req.Title, - "is_channel": req.IsChannel, - "description": req.Description, - "location": req.Location, - "for_import": req.ForImport, + "title": req.Title, + "is_forum": req.IsForum, + "is_channel": req.IsChannel, + "description": req.Description, + "location": req.Location, + "message_auto_delete_time": req.MessageAutoDeleteTime, + "for_import": req.ForImport, }, }) if err != nil { @@ -5029,19 +6561,19 @@ func (client *Client) AddChatToList(req *AddChatToListRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GetChatFilterRequest struct { - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` +type GetChatFolderRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` } -// Returns information about a chat filter by its identifier -func (client *Client) GetChatFilter(req *GetChatFilterRequest) (*ChatFilter, error) { +// Returns information about a chat folder by its identifier +func (client *Client) GetChatFolder(req *GetChatFolderRequest) (*ChatFolder, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getChatFilter", + Type: "getChatFolder", }, Data: map[string]interface{}{ - "chat_filter_id": req.ChatFilterId, + "chat_folder_id": req.ChatFolderId, }, }) if err != nil { @@ -5052,22 +6584,22 @@ func (client *Client) GetChatFilter(req *GetChatFilterRequest) (*ChatFilter, err return nil, buildResponseError(result.Data) } - return UnmarshalChatFilter(result.Data) + return UnmarshalChatFolder(result.Data) } -type CreateChatFilterRequest struct { - // Chat filter - Filter *ChatFilter `json:"filter"` +type CreateChatFolderRequest struct { + // The new chat folder + Folder *ChatFolder `json:"folder"` } -// Creates new chat filter. Returns information about the created chat filter -func (client *Client) CreateChatFilter(req *CreateChatFilterRequest) (*ChatFilterInfo, error) { +// Creates new chat folder. Returns information about the created chat folder. There can be up to getOption("chat_folder_count_max") chat folders, but the limit can be increased with Telegram Premium +func (client *Client) CreateChatFolder(req *CreateChatFolderRequest) (*ChatFolderInfo, error) { result, err := client.Send(Request{ meta: meta{ - Type: "createChatFilter", + Type: "createChatFolder", }, Data: map[string]interface{}{ - "filter": req.Filter, + "folder": req.Folder, }, }) if err != nil { @@ -5078,25 +6610,25 @@ func (client *Client) CreateChatFilter(req *CreateChatFilterRequest) (*ChatFilte return nil, buildResponseError(result.Data) } - return UnmarshalChatFilterInfo(result.Data) + return UnmarshalChatFolderInfo(result.Data) } -type EditChatFilterRequest struct { - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` - // The edited chat filter - Filter *ChatFilter `json:"filter"` +type EditChatFolderRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // The edited chat folder + Folder *ChatFolder `json:"folder"` } -// Edits existing chat filter. Returns information about the edited chat filter -func (client *Client) EditChatFilter(req *EditChatFilterRequest) (*ChatFilterInfo, error) { +// Edits existing chat folder. Returns information about the edited chat folder +func (client *Client) EditChatFolder(req *EditChatFolderRequest) (*ChatFolderInfo, error) { result, err := client.Send(Request{ meta: meta{ - Type: "editChatFilter", + Type: "editChatFolder", }, Data: map[string]interface{}{ - "chat_filter_id": req.ChatFilterId, - "filter": req.Filter, + "chat_folder_id": req.ChatFolderId, + "folder": req.Folder, }, }) if err != nil { @@ -5107,22 +6639,25 @@ func (client *Client) EditChatFilter(req *EditChatFilterRequest) (*ChatFilterInf return nil, buildResponseError(result.Data) } - return UnmarshalChatFilterInfo(result.Data) + return UnmarshalChatFolderInfo(result.Data) } -type DeleteChatFilterRequest struct { - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` +type DeleteChatFolderRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Identifiers of the chats to leave. The chats must be pinned or always included in the folder + LeaveChatIds []int64 `json:"leave_chat_ids"` } -// Deletes existing chat filter -func (client *Client) DeleteChatFilter(req *DeleteChatFilterRequest) (*Ok, error) { +// Deletes existing chat folder +func (client *Client) DeleteChatFolder(req *DeleteChatFolderRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "deleteChatFilter", + Type: "deleteChatFolder", }, Data: map[string]interface{}{ - "chat_filter_id": req.ChatFilterId, + "chat_folder_id": req.ChatFolderId, + "leave_chat_ids": req.LeaveChatIds, }, }) if err != nil { @@ -5136,19 +6671,74 @@ func (client *Client) DeleteChatFilter(req *DeleteChatFilterRequest) (*Ok, error return UnmarshalOk(result.Data) } -type ReorderChatFiltersRequest struct { - // Identifiers of chat filters in the new correct order - ChatFilterIds []int32 `json:"chat_filter_ids"` +type GetChatFolderChatsToLeaveRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` } -// Changes the order of chat filters -func (client *Client) ReorderChatFilters(req *ReorderChatFiltersRequest) (*Ok, error) { +// Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted +func (client *Client) GetChatFolderChatsToLeave(req *GetChatFolderChatsToLeaveRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ - Type: "reorderChatFilters", + Type: "getChatFolderChatsToLeave", }, Data: map[string]interface{}{ - "chat_filter_ids": req.ChatFilterIds, + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type GetChatFolderChatCountRequest struct { + // The new chat folder + Folder *ChatFolder `json:"folder"` +} + +// Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly +func (client *Client) GetChatFolderChatCount(req *GetChatFolderChatCountRequest) (*Count, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderChatCount", + }, + Data: map[string]interface{}{ + "folder": req.Folder, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCount(result.Data) +} + +type ReorderChatFoldersRequest struct { + // Identifiers of chat folders in the new correct order + ChatFolderIds []int32 `json:"chat_folder_ids"` + // Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users + MainChatListPosition int32 `json:"main_chat_list_position"` +} + +// Changes the order of chat folders +func (client *Client) ReorderChatFolders(req *ReorderChatFoldersRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderChatFolders", + }, + Data: map[string]interface{}{ + "chat_folder_ids": req.ChatFolderIds, + "main_chat_list_position": req.MainChatListPosition, }, }) if err != nil { @@ -5162,11 +6752,11 @@ func (client *Client) ReorderChatFilters(req *ReorderChatFiltersRequest) (*Ok, e return UnmarshalOk(result.Data) } -// Returns recommended chat filters for the current user -func (client *Client) GetRecommendedChatFilters() (*RecommendedChatFilters, error) { +// Returns recommended chat folders for the current user +func (client *Client) GetRecommendedChatFolders() (*RecommendedChatFolders, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getRecommendedChatFilters", + Type: "getRecommendedChatFolders", }, Data: map[string]interface{}{}, }) @@ -5178,22 +6768,22 @@ func (client *Client) GetRecommendedChatFilters() (*RecommendedChatFilters, erro return nil, buildResponseError(result.Data) } - return UnmarshalRecommendedChatFilters(result.Data) + return UnmarshalRecommendedChatFolders(result.Data) } -type GetChatFilterDefaultIconNameRequest struct { - // Chat filter - Filter *ChatFilter `json:"filter"` +type GetChatFolderDefaultIconNameRequest struct { + // Chat folder + Folder *ChatFolder `json:"folder"` } -// Returns default icon name for a filter. Can be called synchronously -func GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Text, error) { +// Returns default icon name for a folder. Can be called synchronously +func GetChatFolderDefaultIconName(req *GetChatFolderDefaultIconNameRequest) (*ChatFolderIcon, error) { result, err := Execute(Request{ meta: meta{ - Type: "getChatFilterDefaultIconName", + Type: "getChatFolderDefaultIconName", }, Data: map[string]interface{}{ - "filter": req.Filter, + "folder": req.Folder, }, }) if err != nil { @@ -5204,13 +6794,316 @@ func GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Te return nil, buildResponseError(result.Data) } - return UnmarshalText(result.Data) + return UnmarshalChatFolderIcon(result.Data) } // deprecated -// Returns default icon name for a filter. Can be called synchronously -func (client *Client) GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Text, error) { - return GetChatFilterDefaultIconName(req) +// Returns default icon name for a folder. Can be called synchronously +func (client *Client) GetChatFolderDefaultIconName(req *GetChatFolderDefaultIconNameRequest) (*ChatFolderIcon, error) { + return GetChatFolderDefaultIconName(req) +} + +type GetChatsForChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link +func (client *Client) GetChatsForChatFolderInviteLink(req *GetChatsForChatFolderInviteLinkRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatsForChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type CreateChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Name of the link; 0-32 characters + Name string `json:"name"` + // Identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link creation + ChatIds []int64 `json:"chat_ids"` +} + +// Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats +func (client *Client) CreateChatFolderInviteLink(req *CreateChatFolderInviteLinkRequest) (*ChatFolderInviteLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "name": req.Name, + "chat_ids": req.ChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLink(result.Data) +} + +type GetChatFolderInviteLinksRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns invite links created by the current user for a shareable chat folder +func (client *Client) GetChatFolderInviteLinks(req *GetChatFolderInviteLinksRequest) (*ChatFolderInviteLinks, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderInviteLinks", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLinks(result.Data) +} + +type EditChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Invite link to be edited + InviteLink string `json:"invite_link"` + // New name of the link; 0-32 characters + Name string `json:"name"` + // New identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link editing + ChatIds []int64 `json:"chat_ids"` +} + +// Edits an invite link for a chat folder +func (client *Client) EditChatFolderInviteLink(req *EditChatFolderInviteLinkRequest) (*ChatFolderInviteLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "invite_link": req.InviteLink, + "name": req.Name, + "chat_ids": req.ChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLink(result.Data) +} + +type DeleteChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Invite link to be deleted + InviteLink string `json:"invite_link"` +} + +// Deletes an invite link for a chat folder +func (client *Client) DeleteChatFolderInviteLink(req *DeleteChatFolderInviteLinkRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "invite_link": req.InviteLink, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CheckChatFolderInviteLinkRequest struct { + // Invite link to be checked + InviteLink string `json:"invite_link"` +} + +// Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder +func (client *Client) CheckChatFolderInviteLink(req *CheckChatFolderInviteLinkRequest) (*ChatFolderInviteLinkInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "invite_link": req.InviteLink, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLinkInfo(result.Data) +} + +type AddChatFolderByInviteLinkRequest struct { + // Invite link for the chat folder + InviteLink string `json:"invite_link"` + // Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet + ChatIds []int64 `json:"chat_ids"` +} + +// Adds a chat folder by an invite link +func (client *Client) AddChatFolderByInviteLink(req *AddChatFolderByInviteLinkRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addChatFolderByInviteLink", + }, + Data: map[string]interface{}{ + "invite_link": req.InviteLink, + "chat_ids": req.ChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetChatFolderNewChatsRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat folder +func (client *Client) GetChatFolderNewChats(req *GetChatFolderNewChatsRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderNewChats", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type ProcessChatFolderNewChatsRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren't joined yet + AddedChatIds []int64 `json:"added_chat_ids"` +} + +// Process new chats added to a shareable chat folder by its owner +func (client *Client) ProcessChatFolderNewChats(req *ProcessChatFolderNewChatsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "processChatFolderNewChats", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "added_chat_ids": req.AddedChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns settings for automatic moving of chats to and from the Archive chat lists +func (client *Client) GetArchiveChatListSettings() (*ArchiveChatListSettings, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getArchiveChatListSettings", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalArchiveChatListSettings(result.Data) +} + +type SetArchiveChatListSettingsRequest struct { + // New settings + Settings *ArchiveChatListSettings `json:"settings"` +} + +// Changes settings for automatic moving of chats to and from the Archive chat lists +func (client *Client) SetArchiveChatListSettings(req *SetArchiveChatListSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setArchiveChatListSettings", + }, + Data: map[string]interface{}{ + "settings": req.Settings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) } type SetChatTitleRequest struct { @@ -5271,22 +7164,54 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type SetChatMessageTtlRequest struct { +type SetChatAccentColorRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret - Ttl int32 `json:"ttl"` + // Identifier of the accent color to use + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header background; 0 if none + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` } -// Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram) -func (client *Client) SetChatMessageTtl(req *SetChatMessageTtlRequest) (*Ok, error) { +// Changes accent color and background custom emoji of a chat. Supported only for channels with getOption("channel_custom_accent_color_boost_level_min") boost level. Requires can_change_info administrator right +func (client *Client) SetChatAccentColor(req *SetChatAccentColorRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "setChatMessageTtl", + Type: "setChatAccentColor", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "ttl": req.Ttl, + "chat_id": req.ChatId, + "accent_color_id": req.AccentColorId, + "background_custom_emoji_id": req.BackgroundCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetChatMessageAutoDeleteTimeRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New time value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` +} + +// Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). +func (client *Client) SetChatMessageAutoDeleteTime(req *SetChatMessageAutoDeleteTimeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatMessageAutoDeleteTime", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_auto_delete_time": req.MessageAutoDeleteTime, }, }) if err != nil { @@ -5329,6 +7254,41 @@ func (client *Client) SetChatPermissions(req *SetChatPermissionsRequest) (*Ok, e return UnmarshalOk(result.Data) } +type SetChatBackgroundRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The input background to use; pass null to create a new filled background or to remove the current background + Background InputBackground `json:"background"` + // Background type; pass null to remove the current background + Type BackgroundType `json:"type"` + // Dimming of the background in dark themes, as a percentage; 0-100 + DarkThemeDimming int32 `json:"dark_theme_dimming"` +} + +// Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users +func (client *Client) SetChatBackground(req *SetChatBackgroundRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatBackground", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "background": req.Background, + "type": req.Type, + "dark_theme_dimming": req.DarkThemeDimming, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatThemeRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -5393,7 +7353,7 @@ func (client *Client) SetChatDraftMessage(req *SetChatDraftMessageRequest) (*Ok, type SetChatNotificationSettingsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever + // New notification settings for the chat. If the chat is muted for more than 366 days, it is considered to be muted forever NotificationSettings *ChatNotificationSettings `json:"notification_settings"` } @@ -5422,7 +7382,7 @@ func (client *Client) SetChatNotificationSettings(req *SetChatNotificationSettin type ToggleChatHasProtectedContentRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // True, if chat content can't be saved locally, forwarded, or copied + // New value of has_protected_content HasProtectedContent bool `json:"has_protected_content"` } @@ -5448,6 +7408,35 @@ func (client *Client) ToggleChatHasProtectedContent(req *ToggleChatHasProtectedC return UnmarshalOk(result.Data) } +type ToggleChatIsTranslatableRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of is_translatable + IsTranslatable bool `json:"is_translatable"` +} + +// Changes the translatable state of a chat; for Telegram Premium users only +func (client *Client) ToggleChatIsTranslatable(req *ToggleChatIsTranslatableRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleChatIsTranslatable", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "is_translatable": req.IsTranslatable, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleChatIsMarkedAsUnreadRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -5506,6 +7495,35 @@ func (client *Client) ToggleChatDefaultDisableNotification(req *ToggleChatDefaul return UnmarshalOk(result.Data) } +type SetChatAvailableReactionsRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Reactions available in the chat. All emoji reactions must be active + AvailableReactions ChatAvailableReactions `json:"available_reactions"` +} + +// Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right +func (client *Client) SetChatAvailableReactions(req *SetChatAvailableReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatAvailableReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "available_reactions": req.AvailableReactions, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatClientDataRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -5656,9 +7674,9 @@ type PinChatMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the new pinned message MessageId int64 `json:"message_id"` - // True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats + // Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats DisableNotification bool `json:"disable_notification"` - // True, if the message needs to be pinned for one side only; private chats only + // Pass true to pin the message only for self; private chats only OnlyForSelf bool `json:"only_for_self"` } @@ -5741,12 +7759,41 @@ func (client *Client) UnpinAllChatMessages(req *UnpinAllChatMessagesRequest) (*O return UnmarshalOk(result.Data) } +type UnpinAllMessageThreadMessagesRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier in which messages will be unpinned + MessageThreadId int64 `json:"message_thread_id"` +} + +// Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup +func (client *Client) UnpinAllMessageThreadMessages(req *UnpinAllMessageThreadMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "unpinAllMessageThreadMessages", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type JoinChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` } -// Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method +// Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created func (client *Client) JoinChat(req *JoinChatRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5960,7 +8007,7 @@ type TransferChatOwnershipRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user UserId int64 `json:"user_id"` - // The password of the current user + // The 2-step verification password of the current user Password string `json:"password"` } @@ -6027,7 +8074,7 @@ type SearchChatMembersRequest struct { Filter ChatMembersFilter `json:"filter"` } -// Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels +// Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels func (client *Client) SearchChatMembers(req *SearchChatMembersRequest) (*ChatMembers, error) { result, err := client.Send(Request{ meta: meta{ @@ -6078,11 +8125,11 @@ func (client *Client) GetChatAdministrators(req *GetChatAdministratorsRequest) ( } type ClearAllDraftMessagesRequest struct { - // If true, local draft messages in secret chats will not be cleared + // Pass true to keep local message drafts in secret chats ExcludeSecretChats bool `json:"exclude_secret_chats"` } -// Clears draft messages in all chats +// Clears message drafts in all chats func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6103,14 +8150,111 @@ func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) ( return UnmarshalOk(result.Data) } +type GetSavedNotificationSoundRequest struct { + // Identifier of the notification sound + NotificationSoundId JsonInt64 `json:"notification_sound_id"` +} + +// Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier +func (client *Client) GetSavedNotificationSound(req *GetSavedNotificationSoundRequest) (*NotificationSounds, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSavedNotificationSound", + }, + Data: map[string]interface{}{ + "notification_sound_id": req.NotificationSoundId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalNotificationSounds(result.Data) +} + +// Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used +func (client *Client) GetSavedNotificationSounds() (*NotificationSounds, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSavedNotificationSounds", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalNotificationSounds(result.Data) +} + +type AddSavedNotificationSoundRequest struct { + // Notification sound file to add + Sound InputFile `json:"sound"` +} + +// Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, its position isn't changed +func (client *Client) AddSavedNotificationSound(req *AddSavedNotificationSoundRequest) (*NotificationSound, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addSavedNotificationSound", + }, + Data: map[string]interface{}{ + "sound": req.Sound, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalNotificationSound(result.Data) +} + +type RemoveSavedNotificationSoundRequest struct { + // Identifier of the notification sound + NotificationSoundId JsonInt64 `json:"notification_sound_id"` +} + +// Removes a notification sound from the list of saved notification sounds +func (client *Client) RemoveSavedNotificationSound(req *RemoveSavedNotificationSoundRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeSavedNotificationSound", + }, + Data: map[string]interface{}{ + "notification_sound_id": req.NotificationSoundId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetChatNotificationSettingsExceptionsRequest struct { // If specified, only chats from the scope will be returned; pass null to return chats from all scopes Scope NotificationSettingsScope `json:"scope"` - // If true, also chats with non-default sound will be returned + // Pass true to include in the response chats with only non-default sound CompareSound bool `json:"compare_sound"` } -// Returns list of chats with non-default notification settings +// Returns list of chats with non-default notification settings for new messages func (client *Client) GetChatNotificationSettingsExceptions(req *GetChatNotificationSettingsExceptionsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -6187,7 +8331,7 @@ func (client *Client) SetScopeNotificationSettings(req *SetScopeNotificationSett return UnmarshalOk(result.Data) } -// Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to "default" and message previews are shown +// Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown func (client *Client) ResetAllNotificationSettings() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6211,11 +8355,11 @@ type ToggleChatIsPinnedRequest struct { ChatList ChatList `json:"chat_list"` // Chat identifier ChatId int64 `json:"chat_id"` - // True, if the chat is pinned + // Pass true to pin the chat; pass false to unpin it IsPinned bool `json:"is_pinned"` } -// Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/arhive chat list +// Changes the pinned state of a chat. There can be up to getOption("pinned_chat_count_max")/getOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/archive chat list. The limit can be increased with Telegram Premium func (client *Client) ToggleChatIsPinned(req *ToggleChatIsPinnedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6267,16 +8411,1020 @@ func (client *Client) SetPinnedChats(req *SetPinnedChatsRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type ReadChatListRequest struct { + // Chat list in which to mark all chats as read + ChatList ChatList `json:"chat_list"` +} + +// Traverse all chats in a chat list and marks all messages in the chats as read +func (client *Client) ReadChatList(req *ReadChatListRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readChatList", + }, + Data: map[string]interface{}{ + "chat_list": req.ChatList, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetStoryRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` + // Pass true to get only locally available information without sending network requests + OnlyLocal bool `json:"only_local"` +} + +// Returns a story +func (client *Client) GetStory(req *GetStoryRequest) (*Story, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "only_local": req.OnlyLocal, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStory(result.Data) +} + +// Returns channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there +func (client *Client) GetChatsToSendStories() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatsToSendStories", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type CanSendStoryRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Checks whether the current user can send a story on behalf of a chat; requires can_post_stories rights for channel chats +func (client *Client) CanSendStory(req *CanSendStoryRequest) (CanSendStoryResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "canSendStory", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(result.Data) + + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(result.Data) + + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(result.Data) + + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(result.Data) + + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(result.Data) + + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +type SendStoryRequest struct { + // Identifier of the chat that will post the story + ChatId int64 `json:"chat_id"` + // Content of the story + Content InputStoryContent `json:"content"` + // Clickable rectangle areas to be shown on the story media; pass null if none + Areas *InputStoryAreas `json:"areas"` + // Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters + Caption *FormattedText `json:"caption"` + // The privacy settings for the story + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` + // Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise + ActivePeriod int32 `json:"active_period"` + // Pass true to keep the story accessible after expiration + IsPinned bool `json:"is_pinned"` + // Pass true if the content of the story must be protected from forwarding and screenshotting + ProtectContent bool `json:"protect_content"` +} + +// Sends a new story to a chat; requires can_post_stories rights for channel chats. Returns a temporary story +func (client *Client) SendStory(req *SendStoryRequest) (*Story, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendStory", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "content": req.Content, + "areas": req.Areas, + "caption": req.Caption, + "privacy_settings": req.PrivacySettings, + "active_period": req.ActivePeriod, + "is_pinned": req.IsPinned, + "protect_content": req.ProtectContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStory(result.Data) +} + +type EditStoryRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Identifier of the story to edit + StoryId int32 `json:"story_id"` + // New content of the story; pass null to keep the current content + Content InputStoryContent `json:"content"` + // New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can't be edited if story content isn't changed + Areas *InputStoryAreas `json:"areas"` + // New story caption; pass null to keep the current caption + Caption *FormattedText `json:"caption"` +} + +// Changes content and caption of a story. Can be called only if story.can_be_edited == true +func (client *Client) EditStory(req *EditStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "content": req.Content, + "areas": req.Areas, + "caption": req.Caption, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStoryPrivacySettingsRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Identifier of the story + StoryId int32 `json:"story_id"` + // The new privacy settigs for the story + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` +} + +// Changes privacy settings of a story. Can be called only if story.can_be_edited == true +func (client *Client) SetStoryPrivacySettings(req *SetStoryPrivacySettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStoryPrivacySettings", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "privacy_settings": req.PrivacySettings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleStoryIsPinnedRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Identifier of the story + StoryId int32 `json:"story_id"` + // Pass true to make the story accessible after expiration; pass false to make it private + IsPinned bool `json:"is_pinned"` +} + +// Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true +func (client *Client) ToggleStoryIsPinned(req *ToggleStoryIsPinnedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleStoryIsPinned", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "is_pinned": req.IsPinned, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteStoryRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Identifier of the story to delete + StoryId int32 `json:"story_id"` +} + +// Deletes a previously sent story. Can be called only if story.can_be_deleted == true +func (client *Client) DeleteStory(req *DeleteStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns list of chats with non-default notification settings for stories +func (client *Client) GetStoryNotificationSettingsExceptions() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryNotificationSettingsExceptions", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type LoadActiveStoriesRequest struct { + // The story list in which to load active stories + StoryList StoryList `json:"story_list"` +} + +// Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded +func (client *Client) LoadActiveStories(req *LoadActiveStoriesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadActiveStories", + }, + Data: map[string]interface{}{ + "story_list": req.StoryList, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetChatActiveStoriesListRequest struct { + // Identifier of the chat that posted stories + ChatId int64 `json:"chat_id"` + // New list for active stories posted by the chat + StoryList StoryList `json:"story_list"` +} + +// Changes story list in which stories from the chat are shown +func (client *Client) SetChatActiveStoriesList(req *SetChatActiveStoriesListRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatActiveStoriesList", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_list": req.StoryList, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetChatActiveStoriesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns the list of active stories posted by the given chat +func (client *Client) GetChatActiveStories(req *GetChatActiveStoriesRequest) (*ChatActiveStories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatActiveStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatActiveStories(result.Data) +} + +type GetChatPinnedStoriesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the story starting from which stories must be returned; use 0 to get results from the last story + FromStoryId int32 `json:"from_story_id"` + // The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns the list of pinned stories posted by the given chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +func (client *Client) GetChatPinnedStories(req *GetChatPinnedStoriesRequest) (*Stories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatPinnedStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "from_story_id": req.FromStoryId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStories(result.Data) +} + +type GetChatArchivedStoriesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the story starting from which stories must be returned; use 0 to get results from the last story + FromStoryId int32 `json:"from_story_id"` + // The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns the list of all stories posted by the given chat; requires can_edit_stories rights for channel chats. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +func (client *Client) GetChatArchivedStories(req *GetChatArchivedStoriesRequest) (*Stories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatArchivedStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "from_story_id": req.FromStoryId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStories(result.Data) +} + +type OpenStoryRequest struct { + // The identifier of the sender of the opened story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` +} + +// Informs TDLib that a story is opened and is being viewed by the user +func (client *Client) OpenStory(req *OpenStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "openStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CloseStoryRequest struct { + // The identifier of the sender of the story to close + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` +} + +// Informs TDLib that a story is closed by the user +func (client *Client) CloseStory(req *CloseStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "closeStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetStoryAvailableReactionsRequest struct { + // Number of reaction per row, 5-25 + RowSize int32 `json:"row_size"` +} + +// Returns reactions, which can be chosen for a story +func (client *Client) GetStoryAvailableReactions(req *GetStoryAvailableReactionsRequest) (*AvailableReactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryAvailableReactions", + }, + Data: map[string]interface{}{ + "row_size": req.RowSize, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAvailableReactions(result.Data) +} + +type SetStoryReactionRequest struct { + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` + // Type of the reaction to set; pass null to remove the reaction. `reactionTypeCustomEmoji` reactions can be used only by Telegram Premium users + ReactionType ReactionType `json:"reaction_type"` + // Pass true if the reaction needs to be added to recent reactions + UpdateRecentReactions bool `json:"update_recent_reactions"` +} + +// Changes chosen reaction on a story +func (client *Client) SetStoryReaction(req *SetStoryReactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStoryReaction", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "reaction_type": req.ReactionType, + "update_recent_reactions": req.UpdateRecentReactions, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetStoryViewersRequest struct { + // Story identifier + StoryId int32 `json:"story_id"` + // Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers + Query string `json:"query"` + // Pass true to get only contacts; pass false to get all relevant viewers + OnlyContacts bool `json:"only_contacts"` + // Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date + PreferWithReaction bool `json:"prefer_with_reaction"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of story viewers to return + Limit int32 `json:"limit"` +} + +// Returns viewers of a story. The method can be called only for stories posted on behalf of the current user +func (client *Client) GetStoryViewers(req *GetStoryViewersRequest) (*StoryViewers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryViewers", + }, + Data: map[string]interface{}{ + "story_id": req.StoryId, + "query": req.Query, + "only_contacts": req.OnlyContacts, + "prefer_with_reaction": req.PreferWithReaction, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryViewers(result.Data) +} + +type ReportStoryRequest struct { + // The identifier of the sender of the story to report + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story to report + StoryId int32 `json:"story_id"` + // The reason for reporting the story + Reason ReportReason `json:"reason"` + // Additional report details; 0-1024 characters + Text string `json:"text"` +} + +// Reports a story to the Telegram moderators +func (client *Client) ReportStory(req *ReportStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reportStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "reason": req.Reason, + "text": req.Text, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only +func (client *Client) ActivateStoryStealthMode() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "activateStoryStealthMode", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns the list of available chat boost slots for the current user +func (client *Client) GetAvailableChatBoostSlots() (*ChatBoostSlots, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAvailableChatBoostSlots", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostSlots(result.Data) +} + +type GetChatBoostStatusRequest struct { + // Identifier of the channel chat + ChatId int64 `json:"chat_id"` +} + +// Returns the current boost status for a channel chat +func (client *Client) GetChatBoostStatus(req *GetChatBoostStatusRequest) (*ChatBoostStatus, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostStatus", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostStatus(result.Data) +} + +type BoostChatRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Identifiers of boost slots of the current user from which to apply boosts to the chat + SlotIds []int32 `json:"slot_ids"` +} + +// Boosts a chat and returns the list of available chat boost slots for the current user after the boost +func (client *Client) BoostChat(req *BoostChatRequest) (*ChatBoostSlots, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "boostChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "slot_ids": req.SlotIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostSlots(result.Data) +} + +type GetChatBoostLinkRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` +} + +// Returns an HTTPS link to boost the specified channel chat +func (client *Client) GetChatBoostLink(req *GetChatBoostLinkRequest) (*ChatBoostLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostLink(result.Data) +} + +type GetChatBoostLinkInfoRequest struct { + // The link to boost a chat + Url string `json:"url"` +} + +// Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost +func (client *Client) GetChatBoostLinkInfo(req *GetChatBoostLinkInfoRequest) (*ChatBoostLinkInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostLinkInfo", + }, + Data: map[string]interface{}{ + "url": req.Url, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostLinkInfo(result.Data) +} + +type GetChatBoostsRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Pass true to receive only boosts received from gift codes and giveaways created by the chat + OnlyGiftCodes bool `json:"only_gift_codes"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns list of boosts applied to a chat; requires administrator rights in the channel chat +func (client *Client) GetChatBoosts(req *GetChatBoostsRequest) (*FoundChatBoosts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoosts", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "only_gift_codes": req.OnlyGiftCodes, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundChatBoosts(result.Data) +} + +type GetUserChatBoostsRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Identifier of the user + UserId int64 `json:"user_id"` +} + +// Returns list of boosts applied to a chat by a given user; requires administrator rights in the channel chat; for bots only +func (client *Client) GetUserChatBoosts(req *GetUserChatBoostsRequest) (*FoundChatBoosts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUserChatBoosts", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundChatBoosts(result.Data) +} + +type GetAttachmentMenuBotRequest struct { + // Bot's user identifier + BotUserId int64 `json:"bot_user_id"` +} + +// Returns information about a bot that can be added to attachment or side menu +func (client *Client) GetAttachmentMenuBot(req *GetAttachmentMenuBotRequest) (*AttachmentMenuBot, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAttachmentMenuBot", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAttachmentMenuBot(result.Data) +} + +type ToggleBotIsAddedToAttachmentMenuRequest struct { + // Bot's user identifier + BotUserId int64 `json:"bot_user_id"` + // Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu + IsAdded bool `json:"is_added"` + // Pass true if the current user allowed the bot to send them messages. Ignored if is_added is false + AllowWriteAccess bool `json:"allow_write_access"` +} + +// Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true +func (client *Client) ToggleBotIsAddedToAttachmentMenu(req *ToggleBotIsAddedToAttachmentMenuRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleBotIsAddedToAttachmentMenu", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "is_added": req.IsAdded, + "allow_write_access": req.AllowWriteAccess, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list +func (client *Client) GetThemedEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getThemedEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + +// Returns recent emoji statuses +func (client *Client) GetRecentEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getRecentEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + +// Returns default emoji statuses +func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + +// Clears the list of recently used emoji statuses +func (client *Client) ClearRecentEmojiStatuses() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clearRecentEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type DownloadFileRequest struct { // Identifier of the file to download FileId int32 `json:"file_id"` - // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first + // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first Priority int32 `json:"priority"` // The starting position from which the file needs to be downloaded - Offset int32 `json:"offset"` + Offset int64 `json:"offset"` // Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit - Limit int32 `json:"limit"` - // If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent + Limit int64 `json:"limit"` + // Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started Synchronous bool `json:"synchronous"` } @@ -6309,11 +9457,11 @@ type GetFileDownloadedPrefixSizeRequest struct { // Identifier of the file FileId int32 `json:"file_id"` // Offset from which downloaded prefix size needs to be calculated - Offset int32 `json:"offset"` + Offset int64 `json:"offset"` } // Returns file downloaded prefix size from a given offset, in bytes -func (client *Client) GetFileDownloadedPrefixSize(req *GetFileDownloadedPrefixSizeRequest) (*Count, error) { +func (client *Client) GetFileDownloadedPrefixSize(req *GetFileDownloadedPrefixSizeRequest) (*FileDownloadedPrefixSize, error) { result, err := client.Send(Request{ meta: meta{ Type: "getFileDownloadedPrefixSize", @@ -6331,7 +9479,7 @@ func (client *Client) GetFileDownloadedPrefixSize(req *GetFileDownloadedPrefixSi return nil, buildResponseError(result.Data) } - return UnmarshalCount(result.Data) + return UnmarshalFileDownloadedPrefixSize(result.Data) } type CancelDownloadFileRequest struct { @@ -6392,20 +9540,20 @@ func (client *Client) GetSuggestedFileName(req *GetSuggestedFileNameRequest) (*T return UnmarshalText(result.Data) } -type UploadFileRequest struct { +type PreliminaryUploadFileRequest struct { // File to upload File InputFile `json:"file"` // File type; pass null if unknown FileType FileType `json:"file_type"` - // Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded first + // Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first Priority int32 `json:"priority"` } -// Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message -func (client *Client) UploadFile(req *UploadFileRequest) (*File, error) { +// Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message +func (client *Client) PreliminaryUploadFile(req *PreliminaryUploadFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ - Type: "uploadFile", + Type: "preliminaryUploadFile", }, Data: map[string]interface{}{ "file": req.File, @@ -6424,16 +9572,16 @@ func (client *Client) UploadFile(req *UploadFileRequest) (*File, error) { return UnmarshalFile(result.Data) } -type CancelUploadFileRequest struct { +type CancelPreliminaryUploadFileRequest struct { // Identifier of the file to stop uploading FileId int32 `json:"file_id"` } -// Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined -func (client *Client) CancelUploadFile(req *CancelUploadFileRequest) (*Ok, error) { +// Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile. For other files the behavior is undefined +func (client *Client) CancelPreliminaryUploadFile(req *CancelPreliminaryUploadFileRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "cancelUploadFile", + Type: "cancelPreliminaryUploadFile", }, Data: map[string]interface{}{ "file_id": req.FileId, @@ -6454,7 +9602,7 @@ type WriteGeneratedFilePartRequest struct { // The identifier of the generation process GenerationId JsonInt64 `json:"generation_id"` // The offset from which to write the data to the file - Offset int32 `json:"offset"` + Offset int64 `json:"offset"` // The data to write Data []byte `json:"data"` } @@ -6486,9 +9634,9 @@ type SetFileGenerationProgressRequest struct { // The identifier of the generation process GenerationId JsonInt64 `json:"generation_id"` // Expected size of the generated file, in bytes; 0 if unknown - ExpectedSize int32 `json:"expected_size"` + ExpectedSize int64 `json:"expected_size"` // The number of bytes already generated - LocalPrefixSize int32 `json:"local_prefix_size"` + LocalPrefixSize int64 `json:"local_prefix_size"` } // Informs TDLib on a file generation progress @@ -6547,9 +9695,9 @@ type ReadFilePartRequest struct { // Identifier of the file. The file must be located in the TDLib file cache FileId int32 `json:"file_id"` // The offset from which to read the file - Offset int32 `json:"offset"` + Offset int64 `json:"offset"` // Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position - Count int32 `json:"count"` + Count int64 `json:"count"` } // Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file @@ -6601,12 +9749,201 @@ func (client *Client) DeleteFile(req *DeleteFileRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type AddFileToDownloadsRequest struct { + // Identifier of the file to download + FileId int32 `json:"file_id"` + // Chat identifier of the message with the file + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first + Priority int32 `json:"priority"` +} + +// Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file +func (client *Client) AddFileToDownloads(req *AddFileToDownloadsRequest) (*File, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addFileToDownloads", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "priority": req.Priority, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFile(result.Data) +} + +type ToggleDownloadIsPausedRequest struct { + // Identifier of the downloaded file + FileId int32 `json:"file_id"` + // Pass true if the download is paused + IsPaused bool `json:"is_paused"` +} + +// Changes pause state of a file in the file download list +func (client *Client) ToggleDownloadIsPaused(req *ToggleDownloadIsPausedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleDownloadIsPaused", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "is_paused": req.IsPaused, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleAllDownloadsArePausedRequest struct { + // Pass true to pause all downloads; pass false to unpause them + ArePaused bool `json:"are_paused"` +} + +// Changes pause state of all files in the file download list +func (client *Client) ToggleAllDownloadsArePaused(req *ToggleAllDownloadsArePausedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleAllDownloadsArePaused", + }, + Data: map[string]interface{}{ + "are_paused": req.ArePaused, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveFileFromDownloadsRequest struct { + // Identifier of the downloaded file + FileId int32 `json:"file_id"` + // Pass true to delete the file from the TDLib file cache + DeleteFromCache bool `json:"delete_from_cache"` +} + +// Removes a file from the file download list +func (client *Client) RemoveFileFromDownloads(req *RemoveFileFromDownloadsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeFileFromDownloads", + }, + Data: map[string]interface{}{ + "file_id": req.FileId, + "delete_from_cache": req.DeleteFromCache, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemoveAllFilesFromDownloadsRequest struct { + // Pass true to remove only active downloads, including paused + OnlyActive bool `json:"only_active"` + // Pass true to remove only completed downloads + OnlyCompleted bool `json:"only_completed"` + // Pass true to delete the file from the TDLib file cache + DeleteFromCache bool `json:"delete_from_cache"` +} + +// Removes all files from the file download list +func (client *Client) RemoveAllFilesFromDownloads(req *RemoveAllFilesFromDownloadsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeAllFilesFromDownloads", + }, + Data: map[string]interface{}{ + "only_active": req.OnlyActive, + "only_completed": req.OnlyCompleted, + "delete_from_cache": req.DeleteFromCache, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SearchFileDownloadsRequest struct { + // Query to search for; may be empty to return all downloaded files + Query string `json:"query"` + // Pass true to search only for active downloads, including paused + OnlyActive bool `json:"only_active"` + // Pass true to search only for completed downloads + OnlyCompleted bool `json:"only_completed"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of files to be returned + Limit int32 `json:"limit"` +} + +// Searches for files in the file download list or recently downloaded files from the list +func (client *Client) SearchFileDownloads(req *SearchFileDownloadsRequest) (*FoundFileDownloads, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchFileDownloads", + }, + Data: map[string]interface{}{ + "query": req.Query, + "only_active": req.OnlyActive, + "only_completed": req.OnlyCompleted, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundFileDownloads(result.Data) +} + type GetMessageFileTypeRequest struct { // Beginning of the message file; up to 100 first lines MessageFileHead string `json:"message_file_head"` } -// Returns information about a file with messages exported from another app +// Returns information about a file with messages exported from another application func (client *Client) GetMessageFileType(req *GetMessageFileTypeRequest) (MessageFileType, error) { result, err := client.Send(Request{ meta: meta{ @@ -6732,7 +10069,7 @@ type CreateChatInviteLinkRequest struct { ExpirationDate int32 `json:"expiration_date"` // The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited MemberLimit int32 `json:"member_limit"` - // True, if the link only creates join request. If true, member_limit must not be specified + // Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 CreatesJoinRequest bool `json:"creates_join_request"` } @@ -6772,7 +10109,7 @@ type EditChatInviteLinkRequest struct { ExpirationDate int32 `json:"expiration_date"` // The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited MemberLimit int32 `json:"member_limit"` - // True, if the link only creates join request. If true, member_limit must not be specified + // Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 CreatesJoinRequest bool `json:"creates_join_request"` } @@ -7051,7 +10388,7 @@ type JoinChatByInviteLinkRequest struct { InviteLink string `json:"invite_link"` } -// Uses an invite link to add the current user to the chat if possible +// Uses an invite link to add the current user to the chat if possible. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created func (client *Client) JoinChatByInviteLink(req *JoinChatByInviteLinkRequest) (*Chat, error) { result, err := client.Send(Request{ meta: meta{ @@ -7115,7 +10452,7 @@ type ProcessChatJoinRequestRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the user that sent the request UserId int64 `json:"user_id"` - // True, if the request is approved. Otherwise the request is declived + // Pass true to approve the request; pass false to decline it Approve bool `json:"approve"` } @@ -7147,7 +10484,7 @@ type ProcessChatJoinRequestsRequest struct { ChatId int64 `json:"chat_id"` // Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links InviteLink string `json:"invite_link"` - // True, if the requests are approved. Otherwise the requests are declived + // Pass true to approve all requests; pass false to decline them Approve bool `json:"approve"` } @@ -7179,7 +10516,7 @@ type CreateCallRequest struct { UserId int64 `json:"user_id"` // The call protocols supported by the application Protocol *CallProtocol `json:"protocol"` - // True, if a video call needs to be created + // Pass true to create a video call IsVideo bool `json:"is_video"` } @@ -7267,11 +10604,11 @@ func (client *Client) SendCallSignalingData(req *SendCallSignalingDataRequest) ( type DiscardCallRequest struct { // Call identifier CallId int32 `json:"call_id"` - // True, if the user was disconnected + // Pass true if the user was disconnected IsDisconnected bool `json:"is_disconnected"` // The call duration, in seconds Duration int32 `json:"duration"` - // True, if the call was a video call + // Pass true if the call was a video call IsVideo bool `json:"is_video"` // Identifier of the connection used during the call ConnectionId JsonInt64 `json:"connection_id"` @@ -7344,7 +10681,7 @@ type SendCallDebugInformationRequest struct { DebugInformation string `json:"debug_information"` } -// Sends debug information for a call +// Sends debug information for a call to Telegram servers func (client *Client) SendCallDebugInformation(req *SendCallDebugInformationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7366,6 +10703,35 @@ func (client *Client) SendCallDebugInformation(req *SendCallDebugInformationRequ return UnmarshalOk(result.Data) } +type SendCallLogRequest struct { + // Call identifier + CallId int32 `json:"call_id"` + // Call log file. Only inputFileLocal and inputFileGenerated are supported + LogFile InputFile `json:"log_file"` +} + +// Sends log file for a call to Telegram servers +func (client *Client) SendCallLog(req *SendCallLogRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendCallLog", + }, + Data: map[string]interface{}{ + "call_id": req.CallId, + "log_file": req.LogFile, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetVideoChatAvailableParticipantsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -7422,12 +10788,14 @@ func (client *Client) SetVideoChatDefaultParticipant(req *SetVideoChatDefaultPar } type CreateVideoChatRequest struct { - // Chat identifier, in which the video chat will be created + // Identifier of a chat in which the video chat will be created ChatId int64 `json:"chat_id"` // Group call title; if empty, chat title will be used Title string `json:"title"` // Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future StartDate int32 `json:"start_date"` + // Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges + IsRtmpStream bool `json:"is_rtmp_stream"` } // Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights @@ -7437,9 +10805,10 @@ func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId Type: "createVideoChat", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "title": req.Title, - "start_date": req.StartDate, + "chat_id": req.ChatId, + "title": req.Title, + "start_date": req.StartDate, + "is_rtmp_stream": req.IsRtmpStream, }, }) if err != nil { @@ -7453,6 +10822,58 @@ func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId return UnmarshalGroupCallId(result.Data) } +type GetVideoChatRtmpUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns RTMP URL for streaming to the chat; requires creator privileges +func (client *Client) GetVideoChatRtmpUrl(req *GetVideoChatRtmpUrlRequest) (*RtmpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getVideoChatRtmpUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRtmpUrl(result.Data) +} + +type ReplaceVideoChatRtmpUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Replaces the current RTMP URL for streaming to the chat; requires creator privileges +func (client *Client) ReplaceVideoChatRtmpUrl(req *ReplaceVideoChatRtmpUrlRequest) (*RtmpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "replaceVideoChatRtmpUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRtmpUrl(result.Data) +} + type GetGroupCallRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -7543,9 +10964,9 @@ type JoinGroupCallRequest struct { AudioSourceId int32 `json:"audio_source_id"` // Group call join payload; received from tgcalls Payload string `json:"payload"` - // True, if the user's microphone is muted + // Pass true to join the call with muted microphone IsMuted bool `json:"is_muted"` - // True, if the user's video is enabled + // Pass true if the user's video is enabled IsMyVideoEnabled bool `json:"is_my_video_enabled"` // If non-empty, invite hash to be used to join the group call without being muted by administrators InviteHash string `json:"invite_hash"` @@ -7613,7 +11034,7 @@ func (client *Client) StartGroupCallScreenSharing(req *StartGroupCallScreenShari type ToggleGroupCallScreenSharingIsPausedRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` - // True if screen sharing is paused + // Pass true to pause screen sharing; pass false to unpause it IsPaused bool `json:"is_paused"` } @@ -7730,7 +11151,7 @@ type InviteGroupCallParticipantsRequest struct { UserIds []int64 `json:"user_ids"` } -// Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats +// Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats func (client *Client) InviteGroupCallParticipants(req *InviteGroupCallParticipantsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7931,7 +11352,7 @@ type SetGroupCallParticipantIsSpeakingRequest struct { GroupCallId int32 `json:"group_call_id"` // Group call participant's synchronization audio source identifier, or 0 for the current user AudioSource int32 `json:"audio_source"` - // True, if the user is speaking + // Pass true if the user is speaking IsSpeaking bool `json:"is_speaking"` } @@ -7963,7 +11384,7 @@ type ToggleGroupCallParticipantIsMutedRequest struct { GroupCallId int32 `json:"group_call_id"` // Participant identifier ParticipantId MessageSender `json:"participant_id"` - // Pass true if the user must be muted and false otherwise + // Pass true to mute the user; pass false to unmute them IsMuted bool `json:"is_muted"` } @@ -8135,6 +11556,32 @@ func (client *Client) EndGroupCall(req *EndGroupCallRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetGroupCallStreamsRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Returns information about available group call streams +func (client *Client) GetGroupCallStreams(req *GetGroupCallStreamsRequest) (*GroupCallStreams, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGroupCallStreams", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGroupCallStreams(result.Data) +} + type GetGroupCallStreamSegmentRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -8173,22 +11620,22 @@ func (client *Client) GetGroupCallStreamSegment(req *GetGroupCallStreamSegmentRe return UnmarshalFilePart(result.Data) } -type ToggleMessageSenderIsBlockedRequest struct { +type SetMessageSenderBlockListRequest struct { // Identifier of a message sender to block/unblock SenderId MessageSender `json:"sender_id"` - // New value of is_blocked - IsBlocked bool `json:"is_blocked"` + // New block list for the message sender; pass null to unblock the message sender + BlockList BlockList `json:"block_list"` } -// Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked -func (client *Client) ToggleMessageSenderIsBlocked(req *ToggleMessageSenderIsBlockedRequest) (*Ok, error) { +// Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked +func (client *Client) SetMessageSenderBlockList(req *SetMessageSenderBlockListRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "toggleMessageSenderIsBlocked", + Type: "setMessageSenderBlockList", }, Data: map[string]interface{}{ "sender_id": req.SenderId, - "is_blocked": req.IsBlocked, + "block_list": req.BlockList, }, }) if err != nil { @@ -8205,11 +11652,11 @@ func (client *Client) ToggleMessageSenderIsBlocked(req *ToggleMessageSenderIsBlo type BlockMessageSenderFromRepliesRequest struct { // The identifier of an incoming message in the Replies chat MessageId int64 `json:"message_id"` - // Pass true if the message must be deleted + // Pass true to delete the message DeleteMessage bool `json:"delete_message"` - // Pass true if all messages from the same sender must be deleted + // Pass true to delete all messages from the same sender DeleteAllMessages bool `json:"delete_all_messages"` - // Pass true if the sender must be reported to the Telegram moderators + // Pass true to report the sender to the Telegram moderators ReportSpam bool `json:"report_spam"` } @@ -8238,6 +11685,8 @@ func (client *Client) BlockMessageSenderFromReplies(req *BlockMessageSenderFromR } type GetBlockedMessageSendersRequest struct { + // Block list from which to return users + BlockList BlockList `json:"block_list"` // Number of users and chats to skip in the result; must be non-negative Offset int32 `json:"offset"` // The maximum number of users and chats to return; up to 100 @@ -8251,8 +11700,9 @@ func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequ Type: "getBlockedMessageSenders", }, Data: map[string]interface{}{ - "offset": req.Offset, - "limit": req.Limit, + "block_list": req.BlockList, + "offset": req.Offset, + "limit": req.Limit, }, }) if err != nil { @@ -8267,9 +11717,9 @@ func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequ } type AddContactRequest struct { - // The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored + // The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored Contact *Contact `json:"contact"` - // True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number + // Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number SharePhoneNumber bool `json:"share_phone_number"` } @@ -8321,7 +11771,7 @@ func (client *Client) ImportContacts(req *ImportContactsRequest) (*ImportedConta return UnmarshalImportedContacts(result.Data) } -// Returns all user contacts +// Returns all contacts of the user func (client *Client) GetContacts() (*Users, error) { result, err := client.Send(Request{ meta: meta{ @@ -8459,6 +11909,135 @@ func (client *Client) ClearImportedContacts() (*Ok, error) { return UnmarshalOk(result.Data) } +type SetCloseFriendsRequest struct { + // User identifiers of close friends; the users must be contacts of the current user + UserIds []int64 `json:"user_ids"` +} + +// Changes the list of close friends of the current user +func (client *Client) SetCloseFriends(req *SetCloseFriendsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setCloseFriends", + }, + Data: map[string]interface{}{ + "user_ids": req.UserIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns all close friends of the current user +func (client *Client) GetCloseFriends() (*Users, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCloseFriends", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUsers(result.Data) +} + +type SetUserPersonalProfilePhotoRequest struct { + // User identifier + UserId int64 `json:"user_id"` + // Profile photo to set; pass null to delete the photo; inputChatPhotoPrevious isn't supported in this function + Photo InputChatPhoto `json:"photo"` +} + +// Changes a personal profile photo of a contact user +func (client *Client) SetUserPersonalProfilePhoto(req *SetUserPersonalProfilePhotoRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setUserPersonalProfilePhoto", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "photo": req.Photo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SuggestUserProfilePhotoRequest struct { + // User identifier + UserId int64 `json:"user_id"` + // Profile photo to suggest; inputChatPhotoPrevious isn't supported in this function + Photo InputChatPhoto `json:"photo"` +} + +// Suggests a profile photo to another regular user with common messages +func (client *Client) SuggestUserProfilePhoto(req *SuggestUserProfilePhotoRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "suggestUserProfilePhoto", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "photo": req.Photo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SearchUserByPhoneNumberRequest struct { + // Phone number to search for + PhoneNumber string `json:"phone_number"` +} + +// Searches a user by their phone number. Returns a 404 error if the user can't be found +func (client *Client) SearchUserByPhoneNumber(req *SearchUserByPhoneNumberRequest) (*User, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchUserByPhoneNumber", + }, + Data: map[string]interface{}{ + "phone_number": req.PhoneNumber, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUser(result.Data) +} + type SharePhoneNumberRequest struct { // Identifier of the user with whom to share the phone number. The user must be a mutual contact UserId int64 `json:"user_id"` @@ -8494,7 +12073,7 @@ type GetUserProfilePhotosRequest struct { Limit int32 `json:"limit"` } -// Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already +// Returns the profile photos of a user. Personal and public photo aren't returned func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*ChatPhotos, error) { result, err := client.Send(Request{ meta: meta{ @@ -8518,21 +12097,27 @@ func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*C } type GetStickersRequest struct { - // String representation of emoji. If empty, returns all known installed stickers - Emoji string `json:"emoji"` + // Type of the stickers to return + StickerType StickerType `json:"sticker_type"` + // Search query; a space-separated list of emoji or a keyword prefix. If empty, returns all known installed stickers + Query string `json:"query"` // The maximum number of stickers to be returned Limit int32 `json:"limit"` + // Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats + ChatId int64 `json:"chat_id"` } -// Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, favorite and recently used stickers may also be returned +// Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ Type: "getStickers", }, Data: map[string]interface{}{ - "emoji": req.Emoji, - "limit": req.Limit, + "sticker_type": req.StickerType, + "query": req.Query, + "limit": req.Limit, + "chat_id": req.ChatId, }, }) if err != nil { @@ -8546,21 +12131,85 @@ func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) { return UnmarshalStickers(result.Data) } +type GetAllStickerEmojisRequest struct { + // Type of the stickers to search for + StickerType StickerType `json:"sticker_type"` + // Search query + Query string `json:"query"` + // Chat identifier for which to find stickers + ChatId int64 `json:"chat_id"` + // Pass true if only main emoji for each found sticker must be included in the result + ReturnOnlyMainEmoji bool `json:"return_only_main_emoji"` +} + +// Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id) +func (client *Client) GetAllStickerEmojis(req *GetAllStickerEmojisRequest) (*Emojis, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAllStickerEmojis", + }, + Data: map[string]interface{}{ + "sticker_type": req.StickerType, + "query": req.Query, + "chat_id": req.ChatId, + "return_only_main_emoji": req.ReturnOnlyMainEmoji, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojis(result.Data) +} + type SearchStickersRequest struct { - // String representation of emoji; must be non-empty - Emoji string `json:"emoji"` - // The maximum number of stickers to be returned + // Type of the stickers to return + StickerType StickerType `json:"sticker_type"` + // Space-separated list of emoji to search for; must be non-empty + Emojis string `json:"emojis"` + // The maximum number of stickers to be returned; 0-100 Limit int32 `json:"limit"` } -// Searches for stickers from public sticker sets that correspond to a given emoji +// Searches for stickers from public sticker sets that correspond to any of the given emoji func (client *Client) SearchStickers(req *SearchStickersRequest) (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchStickers", }, Data: map[string]interface{}{ - "emoji": req.Emoji, + "sticker_type": req.StickerType, + "emojis": req.Emojis, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +type GetPremiumStickersRequest struct { + // The maximum number of stickers to be returned; 0-100 + Limit int32 `json:"limit"` +} + +// Returns premium stickers from regular sticker sets +func (client *Client) GetPremiumStickers(req *GetPremiumStickersRequest) (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumStickers", + }, + Data: map[string]interface{}{ "limit": req.Limit, }, }) @@ -8576,8 +12225,8 @@ func (client *Client) SearchStickers(req *SearchStickersRequest) (*Stickers, err } type GetInstalledStickerSetsRequest struct { - // Pass true to return mask sticker sets; pass false to return ordinary sticker sets - IsMasks bool `json:"is_masks"` + // Type of the sticker sets to return + StickerType StickerType `json:"sticker_type"` } // Returns a list of installed sticker sets @@ -8587,7 +12236,7 @@ func (client *Client) GetInstalledStickerSets(req *GetInstalledStickerSetsReques Type: "getInstalledStickerSets", }, Data: map[string]interface{}{ - "is_masks": req.IsMasks, + "sticker_type": req.StickerType, }, }) if err != nil { @@ -8602,8 +12251,8 @@ func (client *Client) GetInstalledStickerSets(req *GetInstalledStickerSetsReques } type GetArchivedStickerSetsRequest struct { - // Pass true to return mask stickers sets; pass false to return ordinary sticker sets - IsMasks bool `json:"is_masks"` + // Type of the sticker sets to return + StickerType StickerType `json:"sticker_type"` // Identifier of the sticker set from which to return the result OffsetStickerSetId JsonInt64 `json:"offset_sticker_set_id"` // The maximum number of sticker sets to return; up to 100 @@ -8617,7 +12266,7 @@ func (client *Client) GetArchivedStickerSets(req *GetArchivedStickerSetsRequest) Type: "getArchivedStickerSets", }, Data: map[string]interface{}{ - "is_masks": req.IsMasks, + "sticker_type": req.StickerType, "offset_sticker_set_id": req.OffsetStickerSetId, "limit": req.Limit, }, @@ -8634,6 +12283,8 @@ func (client *Client) GetArchivedStickerSets(req *GetArchivedStickerSetsRequest) } type GetTrendingStickerSetsRequest struct { + // Type of the sticker sets to return + StickerType StickerType `json:"sticker_type"` // The offset from which to return the sticker sets; must be non-negative Offset int32 `json:"offset"` // The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached @@ -8641,14 +12292,15 @@ type GetTrendingStickerSetsRequest struct { } // Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib -func (client *Client) GetTrendingStickerSets(req *GetTrendingStickerSetsRequest) (*StickerSets, error) { +func (client *Client) GetTrendingStickerSets(req *GetTrendingStickerSetsRequest) (*TrendingStickerSets, error) { result, err := client.Send(Request{ meta: meta{ Type: "getTrendingStickerSets", }, Data: map[string]interface{}{ - "offset": req.Offset, - "limit": req.Limit, + "sticker_type": req.StickerType, + "offset": req.Offset, + "limit": req.Limit, }, }) if err != nil { @@ -8659,7 +12311,7 @@ func (client *Client) GetTrendingStickerSets(req *GetTrendingStickerSetsRequest) return nil, buildResponseError(result.Data) } - return UnmarshalStickerSets(result.Data) + return UnmarshalTrendingStickerSets(result.Data) } type GetAttachedStickerSetsRequest struct { @@ -8667,7 +12319,7 @@ type GetAttachedStickerSetsRequest struct { FileId int32 `json:"file_id"` } -// Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets +// Returns a list of sticker sets attached to a file, including regular, mask, and emoji sticker sets. Currently, only animations, photos, and videos can have attached sticker sets func (client *Client) GetAttachedStickerSets(req *GetAttachedStickerSetsRequest) (*StickerSets, error) { result, err := client.Send(Request{ meta: meta{ @@ -8741,8 +12393,8 @@ func (client *Client) SearchStickerSet(req *SearchStickerSetRequest) (*StickerSe } type SearchInstalledStickerSetsRequest struct { - // Pass true to return mask sticker sets; pass false to return ordinary sticker sets - IsMasks bool `json:"is_masks"` + // Type of the sticker sets to search for + StickerType StickerType `json:"sticker_type"` // Query to search for Query string `json:"query"` // The maximum number of sticker sets to return @@ -8756,9 +12408,9 @@ func (client *Client) SearchInstalledStickerSets(req *SearchInstalledStickerSets Type: "searchInstalledStickerSets", }, Data: map[string]interface{}{ - "is_masks": req.IsMasks, - "query": req.Query, - "limit": req.Limit, + "sticker_type": req.StickerType, + "query": req.Query, + "limit": req.Limit, }, }) if err != nil { @@ -8857,8 +12509,8 @@ func (client *Client) ViewTrendingStickerSets(req *ViewTrendingStickerSetsReques } type ReorderInstalledStickerSetsRequest struct { - // Pass true to change the order of mask sticker sets; pass false to change the order of ordinary sticker sets - IsMasks bool `json:"is_masks"` + // Type of the sticker sets to reorder + StickerType StickerType `json:"sticker_type"` // Identifiers of installed sticker sets in the new correct order StickerSetIds []JsonInt64 `json:"sticker_set_ids"` } @@ -8870,7 +12522,7 @@ func (client *Client) ReorderInstalledStickerSets(req *ReorderInstalledStickerSe Type: "reorderInstalledStickerSets", }, Data: map[string]interface{}{ - "is_masks": req.IsMasks, + "sticker_type": req.StickerType, "sticker_set_ids": req.StickerSetIds, }, }) @@ -8918,7 +12570,7 @@ type AddRecentStickerRequest struct { Sticker InputFile `json:"sticker"` } -// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list +// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers func (client *Client) AddRecentSticker(req *AddRecentStickerRequest) (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ @@ -9019,7 +12671,7 @@ type AddFavoriteStickerRequest struct { Sticker InputFile `json:"sticker"` } -// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list +// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers func (client *Client) AddFavoriteSticker(req *AddFavoriteStickerRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9095,7 +12747,7 @@ func (client *Client) GetStickerEmojis(req *GetStickerEmojisRequest) (*Emojis, e type SearchEmojisRequest struct { // Text to search for Text string `json:"text"` - // True, if only emojis, which exactly match text needs to be returned + // Pass true if only emojis, which exactly match the text, needs to be returned ExactMatch bool `json:"exact_match"` // List of possible IETF language tags of the user's input language; may be empty if unknown InputLanguageCodes []string `json:"input_language_codes"` @@ -9124,6 +12776,32 @@ func (client *Client) SearchEmojis(req *SearchEmojisRequest) (*Emojis, error) { return UnmarshalEmojis(result.Data) } +type GetEmojiCategoriesRequest struct { + // Type of emoji categories to return; pass null to get default emoji categories + Type EmojiCategoryType `json:"type"` +} + +// Returns available emojis categories +func (client *Client) GetEmojiCategories(req *GetEmojiCategoriesRequest) (*EmojiCategories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getEmojiCategories", + }, + Data: map[string]interface{}{ + "type": req.Type, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiCategories(result.Data) +} + type GetAnimatedEmojiRequest struct { // The emoji Emoji string `json:"emoji"` @@ -9176,6 +12854,89 @@ func (client *Client) GetEmojiSuggestionsUrl(req *GetEmojiSuggestionsUrlRequest) return UnmarshalHttpUrl(result.Data) } +type GetCustomEmojiStickersRequest struct { + // Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously + CustomEmojiIds []JsonInt64 `json:"custom_emoji_ids"` +} + +// Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned +func (client *Client) GetCustomEmojiStickers(req *GetCustomEmojiStickersRequest) (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCustomEmojiStickers", + }, + Data: map[string]interface{}{ + "custom_emoji_ids": req.CustomEmojiIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +// Returns default list of custom emoji stickers for placing on a chat photo +func (client *Client) GetDefaultChatPhotoCustomEmojiStickers() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultChatPhotoCustomEmojiStickers", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +// Returns default list of custom emoji stickers for placing on a profile photo +func (client *Client) GetDefaultProfilePhotoCustomEmojiStickers() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultProfilePhotoCustomEmojiStickers", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +// Returns default list of custom emoji stickers for reply background +func (client *Client) GetDefaultBackgroundCustomEmojiStickers() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultBackgroundCustomEmojiStickers", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + // Returns saved animations func (client *Client) GetSavedAnimations() (*Animations, error) { result, err := client.Send(Request{ @@ -9324,16 +13085,19 @@ func (client *Client) RemoveRecentHashtag(req *RemoveRecentHashtagRequest) (*Ok, type GetWebPagePreviewRequest struct { // Message text with formatting Text *FormattedText `json:"text"` + // Options to be used for generation of the link preview; pass null to use default link preview options + LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` } -// Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview +// Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview func (client *Client) GetWebPagePreview(req *GetWebPagePreviewRequest) (*WebPage, error) { result, err := client.Send(Request{ meta: meta{ Type: "getWebPagePreview", }, Data: map[string]interface{}{ - "text": req.Text, + "text": req.Text, + "link_preview_options": req.LinkPreviewOptions, }, }) if err != nil { @@ -9350,7 +13114,7 @@ func (client *Client) GetWebPagePreview(req *GetWebPagePreviewRequest) (*WebPage type GetWebPageInstantViewRequest struct { // The web page URL Url string `json:"url"` - // If true, the full instant view for the web page will be returned + // Pass true to get full instant view for the web page ForceFull bool `json:"force_full"` } @@ -9379,6 +13143,8 @@ func (client *Client) GetWebPageInstantView(req *GetWebPageInstantViewRequest) ( type SetProfilePhotoRequest struct { // Profile photo to set Photo InputChatPhoto `json:"photo"` + // Pass true to set a public photo, which will be visible even the main photo is hidden by privacy settings + IsPublic bool `json:"is_public"` } // Changes a profile photo for the current user @@ -9388,7 +13154,8 @@ func (client *Client) SetProfilePhoto(req *SetProfilePhotoRequest) (*Ok, error) Type: "setProfilePhoto", }, Data: map[string]interface{}{ - "photo": req.Photo, + "photo": req.Photo, + "is_public": req.IsPublic, }, }) if err != nil { @@ -9428,6 +13195,35 @@ func (client *Client) DeleteProfilePhoto(req *DeleteProfilePhotoRequest) (*Ok, e return UnmarshalOk(result.Data) } +type SetAccentColorRequest struct { + // Identifier of the accent color to use + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header background; 0 if none + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` +} + +// Changes accent color and background custom emoji for the current user; for Telegram Premium users only +func (client *Client) SetAccentColor(req *SetAccentColorRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setAccentColor", + }, + Data: map[string]interface{}{ + "accent_color_id": req.AccentColorId, + "background_custom_emoji_id": req.BackgroundCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetNameRequest struct { // The new value of the first name for the current user; 1-64 characters FirstName string `json:"first_name"` @@ -9458,7 +13254,7 @@ func (client *Client) SetName(req *SetNameRequest) (*Ok, error) { } type SetBioRequest struct { - // The new value of the user bio; 0-70 characters without line feeds + // The new value of the user bio; 0-getOption("bio_length_max") characters without line feeds Bio string `json:"bio"` } @@ -9484,11 +13280,11 @@ func (client *Client) SetBio(req *SetBioRequest) (*Ok, error) { } type SetUsernameRequest struct { - // The new value of the username. Use an empty string to remove the username + // The new value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username Username string `json:"username"` } -// Changes the username of the current user +// Changes the editable username of the current user func (client *Client) SetUsername(req *SetUsernameRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9509,12 +13305,93 @@ func (client *Client) SetUsername(req *SetUsernameRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type ToggleUsernameIsActiveRequest struct { + // The username to change + Username string `json:"username"` + // Pass true to activate the username; pass false to disable it + IsActive bool `json:"is_active"` +} + +// Changes active state for a username of the current user. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached +func (client *Client) ToggleUsernameIsActive(req *ToggleUsernameIsActiveRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleUsernameIsActive", + }, + Data: map[string]interface{}{ + "username": req.Username, + "is_active": req.IsActive, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReorderActiveUsernamesRequest struct { + // The new order of active usernames. All currently active usernames must be specified + Usernames []string `json:"usernames"` +} + +// Changes order of active usernames of the current user +func (client *Client) ReorderActiveUsernames(req *ReorderActiveUsernamesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderActiveUsernames", + }, + Data: map[string]interface{}{ + "usernames": req.Usernames, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetEmojiStatusRequest struct { + // New emoji status; pass null to switch to the default badge + EmojiStatus *EmojiStatus `json:"emoji_status"` +} + +// Changes the emoji status of the current user; for Telegram Premium users only +func (client *Client) SetEmojiStatus(req *SetEmojiStatusRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setEmojiStatus", + }, + Data: map[string]interface{}{ + "emoji_status": req.EmojiStatus, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetLocationRequest struct { // The new location of the user Location *Location `json:"location"` } -// Changes the location of the current user. Needs to be called if GetOption("is_location_visible") is true and location changes for more than 1 kilometer +// Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9542,7 +13419,7 @@ type ChangePhoneNumberRequest struct { Settings *PhoneNumberAuthenticationSettings `json:"settings"` } -// Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code +// Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code func (client *Client) ChangePhoneNumber(req *ChangePhoneNumberRequest) (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -9564,7 +13441,7 @@ func (client *Client) ChangePhoneNumber(req *ChangePhoneNumberRequest) (*Authent return UnmarshalAuthenticationCodeInfo(result.Data) } -// Re-sends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed +// Resends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed func (client *Client) ResendChangePhoneNumberCode() (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -9609,10 +13486,55 @@ func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCode return UnmarshalOk(result.Data) } +// Returns an HTTPS link, which can be used to get information about the current user +func (client *Client) GetUserLink() (*UserLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUserLink", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUserLink(result.Data) +} + +type SearchUserByTokenRequest struct { + // Token to search for + Token string `json:"token"` +} + +// Searches a user by a token from the user's link +func (client *Client) SearchUserByToken(req *SearchUserByTokenRequest) (*User, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchUserByToken", + }, + Data: map[string]interface{}{ + "token": req.Token, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUser(result.Data) +} + type SetCommandsRequest struct { // The scope to which the commands are relevant; pass null to change commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands + // A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands LanguageCode string `json:"language_code"` // List of the bot's commands Commands []*BotCommand `json:"commands"` @@ -9644,7 +13566,7 @@ func (client *Client) SetCommands(req *SetCommandsRequest) (*Ok, error) { type DeleteCommandsRequest struct { // The scope to which the commands are relevant; pass null to delete commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 country code or an empty string + // A two-letter ISO 639-1 language code or an empty string LanguageCode string `json:"language_code"` } @@ -9673,11 +13595,11 @@ func (client *Client) DeleteCommands(req *DeleteCommandsRequest) (*Ok, error) { type GetCommandsRequest struct { // The scope to which the commands are relevant; pass null to get commands in the default bot command scope Scope BotCommandScope `json:"scope"` - // A two-letter ISO 639-1 country code or an empty string + // A two-letter ISO 639-1 language code or an empty string LanguageCode string `json:"language_code"` } -// Returns the list of commands supported by the bot for the given user scope and language; for bots only +// Returns list of commands supported by the bot for the given user scope and language; for bots only func (client *Client) GetCommands(req *GetCommandsRequest) (*BotCommands, error) { result, err := client.Send(Request{ meta: meta{ @@ -9699,6 +13621,470 @@ func (client *Client) GetCommands(req *GetCommandsRequest) (*BotCommands, error) return UnmarshalBotCommands(result.Data) } +type SetMenuButtonRequest struct { + // Identifier of the user or 0 to set menu button for all users + UserId int64 `json:"user_id"` + // New menu button + MenuButton *BotMenuButton `json:"menu_button"` +} + +// Sets menu button for the given user or for all users; for bots only +func (client *Client) SetMenuButton(req *SetMenuButtonRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setMenuButton", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "menu_button": req.MenuButton, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetMenuButtonRequest struct { + // Identifier of the user or 0 to get the default menu button + UserId int64 `json:"user_id"` +} + +// Returns menu button set by the bot for the given user; for bots only +func (client *Client) GetMenuButton(req *GetMenuButtonRequest) (*BotMenuButton, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMenuButton", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBotMenuButton(result.Data) +} + +type SetDefaultGroupAdministratorRightsRequest struct { + // Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights + DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` +} + +// Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only +func (client *Client) SetDefaultGroupAdministratorRights(req *SetDefaultGroupAdministratorRightsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setDefaultGroupAdministratorRights", + }, + Data: map[string]interface{}{ + "default_group_administrator_rights": req.DefaultGroupAdministratorRights, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetDefaultChannelAdministratorRightsRequest struct { + // Default administrator rights for adding the bot to channels; pass null to remove default rights + DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` +} + +// Sets default administrator rights for adding the bot to channel chats; for bots only +func (client *Client) SetDefaultChannelAdministratorRights(req *SetDefaultChannelAdministratorRightsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setDefaultChannelAdministratorRights", + }, + Data: map[string]interface{}{ + "default_channel_administrator_rights": req.DefaultChannelAdministratorRights, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CanBotSendMessagesRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` +} + +// Checks whether the specified bot can send messages to the user. Returns a 404 error if can't and the access can be granted by call to allowBotToSendMessages +func (client *Client) CanBotSendMessages(req *CanBotSendMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "canBotSendMessages", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AllowBotToSendMessagesRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` +} + +// Allows the specified bot to send messages to the user +func (client *Client) AllowBotToSendMessages(req *AllowBotToSendMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "allowBotToSendMessages", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SendWebAppCustomRequestRequest struct { + // Identifier of the bot + BotUserId int64 `json:"bot_user_id"` + // The method name + Method string `json:"method"` + // JSON-serialized method parameters + Parameters string `json:"parameters"` +} + +// Sends a custom request from a Web App +func (client *Client) SendWebAppCustomRequest(req *SendWebAppCustomRequestRequest) (*CustomRequestResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendWebAppCustomRequest", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "method": req.Method, + "parameters": req.Parameters, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCustomRequestResult(result.Data) +} + +type SetBotNameRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name + LanguageCode string `json:"language_code"` + // New bot's name on the specified language; 0-64 characters; must be non-empty if language code is empty + Name string `json:"name"` +} + +// Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) SetBotName(req *SetBotNameRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBotName", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetBotNameRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code or an empty string + LanguageCode string `json:"language_code"` +} + +// Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) GetBotName(req *GetBotNameRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBotName", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type SetBotProfilePhotoRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // Profile photo to set; pass null to delete the chat photo + Photo InputChatPhoto `json:"photo"` +} + +// Changes a profile photo for a bot +func (client *Client) SetBotProfilePhoto(req *SetBotProfilePhotoRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBotProfilePhoto", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "photo": req.Photo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleBotUsernameIsActiveRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The username to change + Username string `json:"username"` + // Pass true to activate the username; pass false to disable it + IsActive bool `json:"is_active"` +} + +// Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) ToggleBotUsernameIsActive(req *ToggleBotUsernameIsActiveRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleBotUsernameIsActive", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "username": req.Username, + "is_active": req.IsActive, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReorderBotActiveUsernamesRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The new order of active usernames. All currently active usernames must be specified + Usernames []string `json:"usernames"` +} + +// Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) ReorderBotActiveUsernames(req *ReorderBotActiveUsernamesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderBotActiveUsernames", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "usernames": req.Usernames, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetBotInfoDescriptionRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code. If empty, the description will be shown to all users for whose languages there is no dedicated description + LanguageCode string `json:"language_code"` + // New bot's description on the specified language + Description string `json:"description"` +} + +// Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) SetBotInfoDescription(req *SetBotInfoDescriptionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBotInfoDescription", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "description": req.Description, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetBotInfoDescriptionRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code or an empty string + LanguageCode string `json:"language_code"` +} + +// Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) GetBotInfoDescription(req *GetBotInfoDescriptionRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBotInfoDescription", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type SetBotInfoShortDescriptionRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users for whose languages there is no dedicated description + LanguageCode string `json:"language_code"` + // New bot's short description on the specified language + ShortDescription string `json:"short_description"` +} + +// Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) SetBotInfoShortDescription(req *SetBotInfoShortDescriptionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBotInfoShortDescription", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "short_description": req.ShortDescription, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetBotInfoShortDescriptionRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code or an empty string + LanguageCode string `json:"language_code"` +} + +// Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) GetBotInfoShortDescription(req *GetBotInfoShortDescriptionRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBotInfoShortDescription", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + // Returns all active sessions of the current user func (client *Client) GetActiveSessions() (*Sessions, error) { result, err := client.Send(Request{ @@ -9763,10 +14149,36 @@ func (client *Client) TerminateAllOtherSessions() (*Ok, error) { return UnmarshalOk(result.Data) } +type ConfirmSessionRequest struct { + // Session identifier + SessionId JsonInt64 `json:"session_id"` +} + +// Confirms an unconfirmed session of the current user from another device +func (client *Client) ConfirmSession(req *ConfirmSessionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "confirmSession", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleSessionCanAcceptCallsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` - // True, if incoming calls can be accepted by the session + // Pass true to allow accepting incoming calls by the session; pass false otherwise CanAcceptCalls bool `json:"can_accept_calls"` } @@ -9795,7 +14207,7 @@ func (client *Client) ToggleSessionCanAcceptCalls(req *ToggleSessionCanAcceptCal type ToggleSessionCanAcceptSecretChatsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` - // True, if incoming secret chats can be accepted by the session + // Pass true to allow accepting secret chats by the session; pass false otherwise CanAcceptSecretChats bool `json:"can_accept_secret_chats"` } @@ -9914,11 +14326,11 @@ func (client *Client) DisconnectAllWebsites() (*Ok, error) { type SetSupergroupUsernameRequest struct { // Identifier of the supergroup or channel SupergroupId int64 `json:"supergroup_id"` - // New value of the username. Use an empty string to remove the username + // New value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username Username string `json:"username"` } -// Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel +// Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel func (client *Client) SetSupergroupUsername(req *SetSupergroupUsernameRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9940,6 +14352,93 @@ func (client *Client) SetSupergroupUsername(req *SetSupergroupUsernameRequest) ( return UnmarshalOk(result.Data) } +type ToggleSupergroupUsernameIsActiveRequest struct { + // Identifier of the supergroup or channel + SupergroupId int64 `json:"supergroup_id"` + // The username to change + Username string `json:"username"` + // Pass true to activate the username; pass false to disable it + IsActive bool `json:"is_active"` +} + +// Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or channel. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached +func (client *Client) ToggleSupergroupUsernameIsActive(req *ToggleSupergroupUsernameIsActiveRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupUsernameIsActive", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "username": req.Username, + "is_active": req.IsActive, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DisableAllSupergroupUsernamesRequest struct { + // Identifier of the supergroup or channel + SupergroupId int64 `json:"supergroup_id"` +} + +// Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel +func (client *Client) DisableAllSupergroupUsernames(req *DisableAllSupergroupUsernamesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "disableAllSupergroupUsernames", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReorderSupergroupActiveUsernamesRequest struct { + // Identifier of the supergroup or channel + SupergroupId int64 `json:"supergroup_id"` + // The new order of active usernames. All currently active usernames must be specified + Usernames []string `json:"usernames"` +} + +// Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel +func (client *Client) ReorderSupergroupActiveUsernames(req *ReorderSupergroupActiveUsernamesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderSupergroupActiveUsernames", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "usernames": req.Usernames, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetSupergroupStickerSetRequest struct { // Identifier of the supergroup SupergroupId int64 `json:"supergroup_id"` @@ -9998,6 +14497,64 @@ func (client *Client) ToggleSupergroupSignMessages(req *ToggleSupergroupSignMess return UnmarshalOk(result.Data) } +type ToggleSupergroupJoinToSendMessagesRequest struct { + // Identifier of the supergroup + SupergroupId int64 `json:"supergroup_id"` + // New value of join_to_send_messages + JoinToSendMessages bool `json:"join_to_send_messages"` +} + +// Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members administrator right +func (client *Client) ToggleSupergroupJoinToSendMessages(req *ToggleSupergroupJoinToSendMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupJoinToSendMessages", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "join_to_send_messages": req.JoinToSendMessages, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleSupergroupJoinByRequestRequest struct { + // Identifier of the channel + SupergroupId int64 `json:"supergroup_id"` + // New value of join_by_request + JoinByRequest bool `json:"join_by_request"` +} + +// Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right +func (client *Client) ToggleSupergroupJoinByRequest(req *ToggleSupergroupJoinByRequestRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupJoinByRequest", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "join_by_request": req.JoinByRequest, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleSupergroupIsAllHistoryAvailableRequest struct { // The identifier of the supergroup SupergroupId int64 `json:"supergroup_id"` @@ -10027,6 +14584,93 @@ func (client *Client) ToggleSupergroupIsAllHistoryAvailable(req *ToggleSupergrou return UnmarshalOk(result.Data) } +type ToggleSupergroupHasHiddenMembersRequest struct { + // Identifier of the supergroup + SupergroupId int64 `json:"supergroup_id"` + // New value of has_hidden_members + HasHiddenMembers bool `json:"has_hidden_members"` +} + +// Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers. Can be called only if supergroupFullInfo.can_hide_members == true +func (client *Client) ToggleSupergroupHasHiddenMembers(req *ToggleSupergroupHasHiddenMembersRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupHasHiddenMembers", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "has_hidden_members": req.HasHiddenMembers, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleSupergroupHasAggressiveAntiSpamEnabledRequest struct { + // The identifier of the supergroup, which isn't a broadcast group + SupergroupId int64 `json:"supergroup_id"` + // The new value of has_aggressive_anti_spam_enabled + HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` +} + +// Toggles whether aggressive anti-spam checks are enabled in the supergroup. Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam == true +func (client *Client) ToggleSupergroupHasAggressiveAntiSpamEnabled(req *ToggleSupergroupHasAggressiveAntiSpamEnabledRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupHasAggressiveAntiSpamEnabled", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "has_aggressive_anti_spam_enabled": req.HasAggressiveAntiSpamEnabled, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleSupergroupIsForumRequest struct { + // Identifier of the supergroup + SupergroupId int64 `json:"supergroup_id"` + // New value of is_forum + IsForum bool `json:"is_forum"` +} + +// Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums +func (client *Client) ToggleSupergroupIsForum(req *ToggleSupergroupIsForumRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSupergroupIsForum", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "is_forum": req.IsForum, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleSupergroupIsBroadcastGroupRequest struct { // Identifier of the supergroup SupergroupId int64 `json:"supergroup_id"` @@ -10082,6 +14726,35 @@ func (client *Client) ReportSupergroupSpam(req *ReportSupergroupSpamRequest) (*O return UnmarshalOk(result.Data) } +type ReportSupergroupAntiSpamFalsePositiveRequest struct { + // Supergroup identifier + SupergroupId int64 `json:"supergroup_id"` + // Identifier of the erroneously deleted message + MessageId int64 `json:"message_id"` +} + +// Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup. Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true +func (client *Client) ReportSupergroupAntiSpamFalsePositive(req *ReportSupergroupAntiSpamFalsePositiveRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reportSupergroupAntiSpamFalsePositive", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetSupergroupMembersRequest struct { // Identifier of the supergroup or channel SupergroupId int64 `json:"supergroup_id"` @@ -10158,7 +14831,7 @@ type GetChatEventLogRequest struct { UserIds []int64 `json:"user_ids"` } -// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id) +// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id) func (client *Client) GetChatEventLog(req *GetChatEventLogRequest) (*ChatEvents, error) { result, err := client.Send(Request{ meta: meta{ @@ -10185,24 +14858,21 @@ func (client *Client) GetChatEventLog(req *GetChatEventLogRequest) (*ChatEvents, } type GetPaymentFormRequest struct { - // Chat identifier of the Invoice message - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` + // The invoice + InputInvoice InputInvoice `json:"input_invoice"` // Preferred payment form theme; pass null to use the default theme - Theme *PaymentFormTheme `json:"theme"` + Theme *ThemeParameters `json:"theme"` } -// Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy +// Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy func (client *Client) GetPaymentForm(req *GetPaymentFormRequest) (*PaymentForm, error) { result, err := client.Send(Request{ meta: meta{ Type: "getPaymentForm", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "theme": req.Theme, + "input_invoice": req.InputInvoice, + "theme": req.Theme, }, }) if err != nil { @@ -10217,13 +14887,11 @@ func (client *Client) GetPaymentForm(req *GetPaymentFormRequest) (*PaymentForm, } type ValidateOrderInfoRequest struct { - // Chat identifier of the Invoice message - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` + // The invoice + InputInvoice InputInvoice `json:"input_invoice"` // The order information, provided by the user; pass null if empty OrderInfo *OrderInfo `json:"order_info"` - // True, if the order information can be saved + // Pass true to save the order information AllowSave bool `json:"allow_save"` } @@ -10234,10 +14902,9 @@ func (client *Client) ValidateOrderInfo(req *ValidateOrderInfoRequest) (*Validat Type: "validateOrderInfo", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "order_info": req.OrderInfo, - "allow_save": req.AllowSave, + "input_invoice": req.InputInvoice, + "order_info": req.OrderInfo, + "allow_save": req.AllowSave, }, }) if err != nil { @@ -10252,10 +14919,8 @@ func (client *Client) ValidateOrderInfo(req *ValidateOrderInfoRequest) (*Validat } type SendPaymentFormRequest struct { - // Chat identifier of the Invoice message - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` + // The invoice + InputInvoice InputInvoice `json:"input_invoice"` // Payment form identifier returned by getPaymentForm PaymentFormId JsonInt64 `json:"payment_form_id"` // Identifier returned by validateOrderInfo, or an empty string @@ -10275,8 +14940,7 @@ func (client *Client) SendPaymentForm(req *SendPaymentFormRequest) (*PaymentResu Type: "sendPaymentForm", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, + "input_invoice": req.InputInvoice, "payment_form_id": req.PaymentFormId, "order_info_id": req.OrderInfoId, "shipping_option_id": req.ShippingOptionId, @@ -10296,7 +14960,7 @@ func (client *Client) SendPaymentForm(req *SendPaymentFormRequest) (*PaymentResu } type GetPaymentReceiptRequest struct { - // Chat identifier of the PaymentSuccessful message + // Chat identifier of the messagePaymentSuccessful message ChatId int64 `json:"chat_id"` // Message identifier MessageId int64 `json:"message_id"` @@ -10324,7 +14988,7 @@ func (client *Client) GetPaymentReceipt(req *GetPaymentReceiptRequest) (*Payment return UnmarshalPaymentReceipt(result.Data) } -// Returns saved order info, if any +// Returns saved order information. Returns a 404 error if there is no saved order information func (client *Client) GetSavedOrderInfo() (*OrderInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -10343,7 +15007,7 @@ func (client *Client) GetSavedOrderInfo() (*OrderInfo, error) { return UnmarshalOrderInfo(result.Data) } -// Deletes saved order info +// Deletes saved order information func (client *Client) DeleteSavedOrderInfo() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -10381,6 +15045,32 @@ func (client *Client) DeleteSavedCredentials() (*Ok, error) { return UnmarshalOk(result.Data) } +type CreateInvoiceLinkRequest struct { + // Information about the invoice of the type inputMessageInvoice + Invoice InputMessageContent `json:"invoice"` +} + +// Creates a link for the given invoice; for bots only +func (client *Client) CreateInvoiceLink(req *CreateInvoiceLinkRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createInvoiceLink", + }, + Data: map[string]interface{}{ + "invoice": req.Invoice, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + // Returns a user that can be contacted to get support func (client *Client) GetSupportUser() (*User, error) { result, err := client.Send(Request{ @@ -10401,7 +15091,7 @@ func (client *Client) GetSupportUser() (*User, error) { } type GetBackgroundsRequest struct { - // True, if the backgrounds must be ordered for dark theme + // Pass true to order returned backgrounds for a dark theme ForDarkTheme bool `json:"for_dark_theme"` } @@ -10482,11 +15172,11 @@ func (client *Client) SearchBackground(req *SearchBackgroundRequest) (*Backgroun } type SetBackgroundRequest struct { - // The input background to use; pass null to create a new filled backgrounds or to remove the current background + // The input background to use; pass null to create a new filled background or to remove the current background Background InputBackground `json:"background"` // Background type; pass null to use the default type of the remote background or to remove the current background Type BackgroundType `json:"type"` - // True, if the background is chosen for dark theme + // Pass true if the background is changed for a dark theme ForDarkTheme bool `json:"for_dark_theme"` } @@ -10559,7 +15249,7 @@ func (client *Client) ResetBackgrounds() (*Ok, error) { } type GetLocalizationTargetInfoRequest struct { - // If true, returns only locally available information without sending network requests + // Pass true to get only locally available information without sending network requests OnlyLocal bool `json:"only_local"` } @@ -10666,7 +15356,7 @@ func (client *Client) SynchronizeLanguagePack(req *SynchronizeLanguagePackReques } type AddCustomServerLanguagePackRequest struct { - // Identifier of a language pack to be added; may be different from a name that is used in an "https://t.me/setlanguage/" link + // Identifier of a language pack to be added LanguagePackId string `json:"language_pack_id"` } @@ -10692,7 +15382,7 @@ func (client *Client) AddCustomServerLanguagePack(req *AddCustomServerLanguagePa } type SetCustomLanguagePackRequest struct { - // Information about the language pack. Language pack ID must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization + // Information about the language pack. Language pack identifier must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization Info *LanguagePackInfo `json:"info"` // Strings of the new language pack Strings []*LanguagePackString `json:"strings"` @@ -10974,9 +15664,9 @@ type GetOptionRequest struct { Name string `json:"name"` } -// Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization -func (client *Client) GetOption(req *GetOptionRequest) (OptionValue, error) { - result, err := client.Send(Request{ +// 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 GetOption(req *GetOptionRequest) (OptionValue, error) { + result, err := Execute(Request{ meta: meta{ Type: "getOption", }, @@ -11010,6 +15700,12 @@ func (client *Client) GetOption(req *GetOptionRequest) (OptionValue, error) { } } +// 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" +func (client *Client) GetOption(req *GetOptionRequest) (OptionValue, error) { + return GetOption(req) +} + type SetOptionRequest struct { // The name of the option Name string `json:"name"` @@ -11087,6 +15783,8 @@ func (client *Client) GetAccountTtl() (*AccountTtl, error) { type DeleteAccountRequest struct { // The reason why the account was deleted; optional Reason string `json:"reason"` + // The 2-step verification password of the current user. If not specified, account deletion can be canceled within one week + Password string `json:"password"` } // Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account. Can be called before authorization when the current authorization state is authorizationStateWaitPassword @@ -11096,7 +15794,8 @@ func (client *Client) DeleteAccount(req *DeleteAccountRequest) (*Ok, error) { Type: "deleteAccount", }, Data: map[string]interface{}{ - "reason": req.Reason, + "reason": req.Reason, + "password": req.Password, }, }) if err != nil { @@ -11110,6 +15809,51 @@ func (client *Client) DeleteAccount(req *DeleteAccountRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SetDefaultMessageAutoDeleteTimeRequest struct { + // New default message auto-delete time; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically + MessageAutoDeleteTime *MessageAutoDeleteTime `json:"message_auto_delete_time"` +} + +// Changes the default message auto-delete time for new chats +func (client *Client) SetDefaultMessageAutoDeleteTime(req *SetDefaultMessageAutoDeleteTimeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setDefaultMessageAutoDeleteTime", + }, + Data: map[string]interface{}{ + "message_auto_delete_time": req.MessageAutoDeleteTime, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns default message auto-delete time setting for new chats +func (client *Client) GetDefaultMessageAutoDeleteTime() (*MessageAutoDeleteTime, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultMessageAutoDeleteTime", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageAutoDeleteTime(result.Data) +} + type RemoveChatActionBarRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -11139,10 +15883,10 @@ func (client *Client) RemoveChatActionBar(req *RemoveChatActionBarRequest) (*Ok, type ReportChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifiers of reported messages, if any + // Identifiers of reported messages; may be empty to report the whole chat MessageIds []int64 `json:"message_ids"` // The reason for reporting the chat - Reason ChatReportReason `json:"reason"` + Reason ReportReason `json:"reason"` // Additional report details; 0-1024 characters Text string `json:"text"` } @@ -11177,7 +15921,7 @@ type ReportChatPhotoRequest struct { // Identifier of the photo to report. Only full photos from chatPhoto can be reported FileId int32 `json:"file_id"` // The reason for reporting the chat photo - Reason ChatReportReason `json:"reason"` + Reason ReportReason `json:"reason"` // Additional report details; 0-1024 characters Text string `json:"text"` } @@ -11206,6 +15950,38 @@ func (client *Client) ReportChatPhoto(req *ReportChatPhotoRequest) (*Ok, error) return UnmarshalOk(result.Data) } +type ReportMessageReactionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Identifier of the sender, which added the reaction + SenderId MessageSender `json:"sender_id"` +} + +// Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions +func (client *Client) ReportMessageReactions(req *ReportMessageReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reportMessageReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "sender_id": req.SenderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetChatStatisticsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -11276,6 +16052,41 @@ func (client *Client) GetMessageStatistics(req *GetMessageStatisticsRequest) (*M return UnmarshalMessageStatistics(result.Data) } +type GetMessagePublicForwardsRequest struct { + // Chat identifier of the message + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib +func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*FoundMessages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessagePublicForwards", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundMessages(result.Data) +} + type GetStatisticalGraphRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -11389,7 +16200,7 @@ type OptimizeStorageRequest struct { Size int64 `json:"size"` // Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit Ttl int32 `json:"ttl"` - // Limit on the total count of files after deletion. Pass -1 to use the default limit + // Limit on the total number of files after deletion. Pass -1 to use the default limit Count int32 `json:"count"` // The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value ImmunityDelay int32 `json:"immunity_delay"` @@ -11461,7 +16272,7 @@ func (client *Client) SetNetworkType(req *SetNetworkTypeRequest) (*Ok, error) { } type GetNetworkStatisticsRequest struct { - // If true, returns only data for the current library launch + // Pass true to get statistics only for the current library launch OnlyCurrent bool `json:"only_current"` } @@ -11579,6 +16390,73 @@ func (client *Client) SetAutoDownloadSettings(req *SetAutoDownloadSettingsReques return UnmarshalOk(result.Data) } +// Returns autosave settings for the current user +func (client *Client) GetAutosaveSettings() (*AutosaveSettings, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAutosaveSettings", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAutosaveSettings(result.Data) +} + +type SetAutosaveSettingsRequest struct { + // Autosave settings scope + Scope AutosaveSettingsScope `json:"scope"` + // New autosave settings for the scope; pass null to set autosave settings to default + Settings *ScopeAutosaveSettings `json:"settings"` +} + +// Sets autosave settings for the given scope. The method is guaranteed to work only after at least one call to getAutosaveSettings +func (client *Client) SetAutosaveSettings(req *SetAutosaveSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setAutosaveSettings", + }, + Data: map[string]interface{}{ + "scope": req.Scope, + "settings": req.Settings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Clears the list of all autosave settings exceptions. The method is guaranteed to work only after at least one call to getAutosaveSettings +func (client *Client) ClearAutosaveSettingsExceptions() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clearAutosaveSettingsExceptions", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetBankCardInfoRequest struct { // The bank card number BankCardNumber string `json:"bank_card_number"` @@ -11608,7 +16486,7 @@ func (client *Client) GetBankCardInfo(req *GetBankCardInfoRequest) (*BankCardInf type GetPassportElementRequest struct { // Telegram Passport element type Type PassportElementType `json:"type"` - // Password of the current user + // The 2-step verification password of the current user Password string `json:"password"` } @@ -11677,7 +16555,7 @@ func (client *Client) GetPassportElement(req *GetPassportElementRequest) (Passpo } type GetAllPassportElementsRequest struct { - // Password of the current user + // The 2-step verification password of the current user Password string `json:"password"` } @@ -11705,7 +16583,7 @@ func (client *Client) GetAllPassportElements(req *GetAllPassportElementsRequest) type SetPassportElementRequest struct { // Input Telegram Passport element Element InputPassportElement `json:"element"` - // Password of the current user + // The 2-step verification password of the current user Password string `json:"password"` } @@ -11883,7 +16761,7 @@ func (client *Client) SendPhoneNumberVerificationCode(req *SendPhoneNumberVerifi return UnmarshalAuthenticationCodeInfo(result.Data) } -// Re-sends the code to verify a phone number to be added to a user's Telegram Passport +// Resends the code to verify a phone number to be added to a user's Telegram Passport func (client *Client) ResendPhoneNumberVerificationCode() (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -11954,7 +16832,7 @@ func (client *Client) SendEmailAddressVerificationCode(req *SendEmailAddressVeri return UnmarshalEmailAddressAuthenticationCodeInfo(result.Data) } -// Re-sends the code to verify an email address to be added to a user's Telegram Passport +// Resends the code to verify an email address to be added to a user's Telegram Passport func (client *Client) ResendEmailAddressVerificationCode() (*EmailAddressAuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -12036,8 +16914,8 @@ func (client *Client) GetPassportAuthorizationForm(req *GetPassportAuthorization type GetPassportAuthorizationFormAvailableElementsRequest struct { // Authorization form identifier - AutorizationFormId int32 `json:"autorization_form_id"` - // Password of the current user + AuthorizationFormId int32 `json:"authorization_form_id"` + // The 2-step verification password of the current user Password string `json:"password"` } @@ -12048,8 +16926,8 @@ func (client *Client) GetPassportAuthorizationFormAvailableElements(req *GetPass Type: "getPassportAuthorizationFormAvailableElements", }, Data: map[string]interface{}{ - "autorization_form_id": req.AutorizationFormId, - "password": req.Password, + "authorization_form_id": req.AuthorizationFormId, + "password": req.Password, }, }) if err != nil { @@ -12065,7 +16943,7 @@ func (client *Client) GetPassportAuthorizationFormAvailableElements(req *GetPass type SendPassportAuthorizationFormRequest struct { // Authorization form identifier - AutorizationFormId int32 `json:"autorization_form_id"` + AuthorizationFormId int32 `json:"authorization_form_id"` // Types of Telegram Passport elements chosen by user to complete the authorization form Types []PassportElementType `json:"types"` } @@ -12077,8 +16955,8 @@ func (client *Client) SendPassportAuthorizationForm(req *SendPassportAuthorizati Type: "sendPassportAuthorizationForm", }, Data: map[string]interface{}{ - "autorization_form_id": req.AutorizationFormId, - "types": req.Types, + "authorization_form_id": req.AuthorizationFormId, + "types": req.Types, }, }) if err != nil { @@ -12201,8 +17079,10 @@ func (client *Client) SetBotUpdatesStatus(req *SetBotUpdatesStatusRequest) (*Ok, type UploadStickerFileRequest struct { // Sticker file owner; ignored for regular users UserId int64 `json:"user_id"` - // Sticker file to upload - Sticker InputSticker `json:"sticker"` + // Sticker format + StickerFormat StickerFormat `json:"sticker_format"` + // File file to upload; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements + Sticker InputFile `json:"sticker"` } // Uploads a file with a sticker; returns the uploaded file @@ -12212,8 +17092,9 @@ func (client *Client) UploadStickerFile(req *UploadStickerFileRequest) (*File, e Type: "uploadStickerFile", }, Data: map[string]interface{}{ - "user_id": req.UserId, - "sticker": req.Sticker, + "user_id": req.UserId, + "sticker_format": req.StickerFormat, + "sticker": req.Sticker, }, }) if err != nil { @@ -12298,10 +17179,14 @@ type CreateNewStickerSetRequest struct { Title string `json:"title"` // Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters Name string `json:"name"` - // True, if stickers are masks. Animated stickers can't be masks - IsMasks bool `json:"is_masks"` - // List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown - Stickers []InputSticker `json:"stickers"` + // Format of the stickers in the set + StickerFormat StickerFormat `json:"sticker_format"` + // Type of the stickers in the set + StickerType StickerType `json:"sticker_type"` + // Pass true if stickers in the sticker set must be repainted; for custom emoji sticker sets only + NeedsRepainting bool `json:"needs_repainting"` + // List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown + Stickers []*InputSticker `json:"stickers"` // Source of the sticker set; may be empty if unknown Source string `json:"source"` } @@ -12313,12 +17198,14 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti Type: "createNewStickerSet", }, Data: map[string]interface{}{ - "user_id": req.UserId, - "title": req.Title, - "name": req.Name, - "is_masks": req.IsMasks, - "stickers": req.Stickers, - "source": req.Source, + "user_id": req.UserId, + "title": req.Title, + "name": req.Name, + "sticker_format": req.StickerFormat, + "sticker_type": req.StickerType, + "needs_repainting": req.NeedsRepainting, + "stickers": req.Stickers, + "source": req.Source, }, }) if err != nil { @@ -12338,11 +17225,11 @@ type AddStickerToSetRequest struct { // Sticker set name Name string `json:"name"` // Sticker to add to the set - Sticker InputSticker `json:"sticker"` + Sticker *InputSticker `json:"sticker"` } -// Adds a new sticker to a set; for bots only. Returns the sticker set -func (client *Client) AddStickerToSet(req *AddStickerToSetRequest) (*StickerSet, error) { +// Adds a new sticker to a set; for bots only +func (client *Client) AddStickerToSet(req *AddStickerToSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "addStickerToSet", @@ -12361,7 +17248,7 @@ func (client *Client) AddStickerToSet(req *AddStickerToSetRequest) (*StickerSet, return nil, buildResponseError(result.Data) } - return UnmarshalStickerSet(result.Data) + return UnmarshalOk(result.Data) } type SetStickerSetThumbnailRequest struct { @@ -12369,12 +17256,12 @@ type SetStickerSetThumbnailRequest struct { UserId int64 `json:"user_id"` // Sticker set name Name string `json:"name"` - // Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them + // Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set Thumbnail InputFile `json:"thumbnail"` } -// Sets a sticker set thumbnail; for bots only. Returns the sticker set -func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) (*StickerSet, error) { +// Sets a sticker set thumbnail; for bots only +func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "setStickerSetThumbnail", @@ -12393,13 +17280,97 @@ func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) return nil, buildResponseError(result.Data) } - return UnmarshalStickerSet(result.Data) + return UnmarshalOk(result.Data) +} + +type SetCustomEmojiStickerSetThumbnailRequest struct { + // Sticker set name + Name string `json:"name"` + // Identifier of the custom emoji from the sticker set, which will be set as sticker set thumbnail; pass 0 to remove the sticker set thumbnail + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +// Sets a custom emoji sticker set thumbnail; for bots only +func (client *Client) SetCustomEmojiStickerSetThumbnail(req *SetCustomEmojiStickerSetThumbnailRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setCustomEmojiStickerSetThumbnail", + }, + Data: map[string]interface{}{ + "name": req.Name, + "custom_emoji_id": req.CustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStickerSetTitleRequest struct { + // Sticker set name + Name string `json:"name"` + // New sticker set title + Title string `json:"title"` +} + +// Sets a sticker set title; for bots only +func (client *Client) SetStickerSetTitle(req *SetStickerSetTitleRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStickerSetTitle", + }, + Data: map[string]interface{}{ + "name": req.Name, + "title": req.Title, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteStickerSetRequest struct { + // Sticker set name + Name string `json:"name"` +} + +// Deleted a sticker set; for bots only +func (client *Client) DeleteStickerSet(req *DeleteStickerSetRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteStickerSet", + }, + Data: map[string]interface{}{ + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) } type SetStickerPositionInSetRequest struct { // Sticker Sticker InputFile `json:"sticker"` - // New position of the sticker in the set, zero-based + // New position of the sticker in the set, 0-based Position int32 `json:"position"` } @@ -12451,6 +17422,93 @@ func (client *Client) RemoveStickerFromSet(req *RemoveStickerFromSetRequest) (*O return UnmarshalOk(result.Data) } +type SetStickerEmojisRequest struct { + // Sticker + Sticker InputFile `json:"sticker"` + // New string with 1-20 emoji corresponding to the sticker + Emojis string `json:"emojis"` +} + +// Changes the list of emoji corresponding to a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot +func (client *Client) SetStickerEmojis(req *SetStickerEmojisRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStickerEmojis", + }, + Data: map[string]interface{}{ + "sticker": req.Sticker, + "emojis": req.Emojis, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStickerKeywordsRequest struct { + // Sticker + Sticker InputFile `json:"sticker"` + // List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker + Keywords []string `json:"keywords"` +} + +// Changes the list of keywords of a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot +func (client *Client) SetStickerKeywords(req *SetStickerKeywordsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStickerKeywords", + }, + Data: map[string]interface{}{ + "sticker": req.Sticker, + "keywords": req.Keywords, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStickerMaskPositionRequest struct { + // Sticker + Sticker InputFile `json:"sticker"` + // Position where the mask is placed; pass null to remove mask position + MaskPosition *MaskPosition `json:"mask_position"` +} + +// Changes the mask position of a mask sticker; for bots only. The sticker must belong to a mask sticker set created by the bot +func (client *Client) SetStickerMaskPosition(req *SetStickerMaskPositionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStickerMaskPosition", + }, + Data: map[string]interface{}{ + "sticker": req.Sticker, + "mask_position": req.MaskPosition, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetMapThumbnailFileRequest struct { // Location of the map center Location *Location `json:"location"` @@ -12462,7 +17520,7 @@ type GetMapThumbnailFileRequest struct { Height int32 `json:"height"` // Map scale; 1-3 Scale int32 `json:"scale"` - // Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown + // Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown ChatId int64 `json:"chat_id"` } @@ -12492,6 +17550,376 @@ func (client *Client) GetMapThumbnailFile(req *GetMapThumbnailFileRequest) (*Fil return UnmarshalFile(result.Data) } +type GetPremiumLimitRequest struct { + // Type of the limit + LimitType PremiumLimitType `json:"limit_type"` +} + +// Returns information about a limit, increased for Premium users. Returns a 404 error if the limit is unknown +func (client *Client) GetPremiumLimit(req *GetPremiumLimitRequest) (*PremiumLimit, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumLimit", + }, + Data: map[string]interface{}{ + "limit_type": req.LimitType, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumLimit(result.Data) +} + +type GetPremiumFeaturesRequest struct { + // Source of the request; pass null if the method is called from some non-standard source + Source PremiumSource `json:"source"` +} + +// Returns information about features, available to Premium users +func (client *Client) GetPremiumFeatures(req *GetPremiumFeaturesRequest) (*PremiumFeatures, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumFeatures", + }, + Data: map[string]interface{}{ + "source": req.Source, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumFeatures(result.Data) +} + +// Returns examples of premium stickers for demonstration purposes +func (client *Client) GetPremiumStickerExamples() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumStickerExamples", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +type ViewPremiumFeatureRequest struct { + // The viewed premium feature + Feature PremiumFeature `json:"feature"` +} + +// Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen +func (client *Client) ViewPremiumFeature(req *ViewPremiumFeatureRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "viewPremiumFeature", + }, + Data: map[string]interface{}{ + "feature": req.Feature, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Informs TDLib that the user clicked Premium subscription button on the Premium features screen +func (client *Client) ClickPremiumSubscriptionButton() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clickPremiumSubscriptionButton", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns state of Telegram Premium subscription and promotion videos for Premium features +func (client *Client) GetPremiumState() (*PremiumState, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumState", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumState(result.Data) +} + +type GetPremiumGiftCodePaymentOptionsRequest struct { + // Identifier of the channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none + BoostedChatId int64 `json:"boosted_chat_id"` +} + +// Returns available options for Telegram Premium gift code or giveaway creation +func (client *Client) GetPremiumGiftCodePaymentOptions(req *GetPremiumGiftCodePaymentOptionsRequest) (*PremiumGiftCodePaymentOptions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumGiftCodePaymentOptions", + }, + Data: map[string]interface{}{ + "boosted_chat_id": req.BoostedChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumGiftCodePaymentOptions(result.Data) +} + +type CheckPremiumGiftCodeRequest struct { + // The code to check + Code string `json:"code"` +} + +// Return information about a Telegram Premium gift code +func (client *Client) CheckPremiumGiftCode(req *CheckPremiumGiftCodeRequest) (*PremiumGiftCodeInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkPremiumGiftCode", + }, + Data: map[string]interface{}{ + "code": req.Code, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumGiftCodeInfo(result.Data) +} + +type ApplyPremiumGiftCodeRequest struct { + // The code to apply + Code string `json:"code"` +} + +// Applies a Telegram Premium gift code +func (client *Client) ApplyPremiumGiftCode(req *ApplyPremiumGiftCodeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "applyPremiumGiftCode", + }, + Data: map[string]interface{}{ + "code": req.Code, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type LaunchPrepaidPremiumGiveawayRequest struct { + // Unique identifier of the prepaid giveaway + GiveawayId JsonInt64 `json:"giveaway_id"` + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` +} + +// Launches a prepaid Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +func (client *Client) LaunchPrepaidPremiumGiveaway(req *LaunchPrepaidPremiumGiveawayRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "launchPrepaidPremiumGiveaway", + }, + Data: map[string]interface{}{ + "giveaway_id": req.GiveawayId, + "parameters": req.Parameters, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetPremiumGiveawayInfoRequest struct { + // Identifier of the channel chat which started the giveaway + ChatId int64 `json:"chat_id"` + // Identifier of the giveaway message in the chat + MessageId int64 `json:"message_id"` +} + +// Returns information about a Telegram Premium giveaway +func (client *Client) GetPremiumGiveawayInfo(req *GetPremiumGiveawayInfoRequest) (PremiumGiveawayInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumGiveawayInfo", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypePremiumGiveawayInfoOngoing: + return UnmarshalPremiumGiveawayInfoOngoing(result.Data) + + case TypePremiumGiveawayInfoCompleted: + return UnmarshalPremiumGiveawayInfoCompleted(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +type CanPurchasePremiumRequest struct { + // Transaction purpose + Purpose StorePaymentPurpose `json:"purpose"` +} + +// Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase +func (client *Client) CanPurchasePremium(req *CanPurchasePremiumRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "canPurchasePremium", + }, + Data: map[string]interface{}{ + "purpose": req.Purpose, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AssignAppStoreTransactionRequest struct { + // App Store receipt + Receipt []byte `json:"receipt"` + // Transaction purpose + Purpose StorePaymentPurpose `json:"purpose"` +} + +// Informs server about a purchase through App Store. For official applications only +func (client *Client) AssignAppStoreTransaction(req *AssignAppStoreTransactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "assignAppStoreTransaction", + }, + Data: map[string]interface{}{ + "receipt": req.Receipt, + "purpose": req.Purpose, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AssignGooglePlayTransactionRequest struct { + // Application package name + PackageName string `json:"package_name"` + // Identifier of the purchased store product + StoreProductId string `json:"store_product_id"` + // Google Play purchase token + PurchaseToken string `json:"purchase_token"` + // Transaction purpose + Purpose StorePaymentPurpose `json:"purpose"` +} + +// Informs server about a purchase through Google Play. For official applications only +func (client *Client) AssignGooglePlayTransaction(req *AssignGooglePlayTransactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "assignGooglePlayTransaction", + }, + Data: map[string]interface{}{ + "package_name": req.PackageName, + "store_product_id": req.StoreProductId, + "purchase_token": req.PurchaseToken, + "purpose": req.Purpose, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type AcceptTermsOfServiceRequest struct { // Terms of service identifier TermsOfServiceId string `json:"terms_of_service_id"` @@ -12518,6 +17946,47 @@ func (client *Client) AcceptTermsOfService(req *AcceptTermsOfServiceRequest) (*O return UnmarshalOk(result.Data) } +type SearchStringsByPrefixRequest struct { + // The strings to search in for the query + Strings []string `json:"strings"` + // Query to search for + Query string `json:"query"` + // The maximum number of objects to return + Limit int32 `json:"limit"` + // Pass true to receive no results for an empty query + ReturnNoneForEmptyQuery bool `json:"return_none_for_empty_query"` +} + +// Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously +func SearchStringsByPrefix(req *SearchStringsByPrefixRequest) (*FoundPositions, error) { + result, err := Execute(Request{ + meta: meta{ + Type: "searchStringsByPrefix", + }, + Data: map[string]interface{}{ + "strings": req.Strings, + "query": req.Query, + "limit": req.Limit, + "return_none_for_empty_query": req.ReturnNoneForEmptyQuery, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundPositions(result.Data) +} + +// deprecated +// Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously +func (client *Client) SearchStringsByPrefix(req *SearchStringsByPrefixRequest) (*FoundPositions, error) { + return SearchStringsByPrefix(req) +} + type SendCustomRequestRequest struct { // The method name Method string `json:"method"` @@ -12667,7 +18136,7 @@ func (client *Client) GetPhoneNumberInfo(req *GetPhoneNumberInfoRequest) (*Phone } type GetPhoneNumberInfoSyncRequest struct { - // A two-letter ISO 639-1 country code for country information localization + // A two-letter ISO 639-1 language code for country information localization LanguageCode string `json:"language_code"` // The phone number prefix PhoneNumberPrefix string `json:"phone_number_prefix"` @@ -12701,25 +18170,6 @@ func (client *Client) GetPhoneNumberInfoSync(req *GetPhoneNumberInfoSyncRequest) return GetPhoneNumberInfoSync(req) } -// Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram -func (client *Client) GetApplicationDownloadLink() (*HttpUrl, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getApplicationDownloadLink", - }, - Data: map[string]interface{}{}, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalHttpUrl(result.Data) -} - type GetDeepLinkInfoRequest struct { // The link Link string `json:"link"` @@ -12786,6 +18236,32 @@ func (client *Client) GetApplicationConfig() (JsonValue, error) { } } +type AddApplicationChangelogRequest struct { + // The previous application version + PreviousApplicationVersion string `json:"previous_application_version"` +} + +// Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed +func (client *Client) AddApplicationChangelog(req *AddApplicationChangelogRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addApplicationChangelog", + }, + Data: map[string]interface{}{ + "previous_application_version": req.PreviousApplicationVersion, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SaveApplicationLogEventRequest struct { // Event type Type string `json:"type"` @@ -12818,12 +18294,31 @@ func (client *Client) SaveApplicationLogEvent(req *SaveApplicationLogEventReques return UnmarshalOk(result.Data) } +// Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram +func (client *Client) GetApplicationDownloadLink() (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getApplicationDownloadLink", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + type AddProxyRequest struct { - // Proxy server IP address + // Proxy server domain or IP address Server string `json:"server"` // Proxy server port Port int32 `json:"port"` - // True, if the proxy needs to be enabled + // Pass true to immediately enable the proxy Enable bool `json:"enable"` // Proxy type Type ProxyType `json:"type"` @@ -12856,11 +18351,11 @@ func (client *Client) AddProxy(req *AddProxyRequest) (*Proxy, error) { type EditProxyRequest struct { // Proxy identifier ProxyId int32 `json:"proxy_id"` - // Proxy server IP address + // Proxy server domain or IP address Server string `json:"server"` // Proxy server port Port int32 `json:"port"` - // True, if the proxy needs to be enabled + // Pass true to immediately enable the proxy Enable bool `json:"enable"` // Proxy type Type ProxyType `json:"type"` @@ -13286,6 +18781,80 @@ func (client *Client) AddLogMessage(req *AddLogMessageRequest) (*Ok, error) { return AddLogMessage(req) } +type GetUserSupportInfoRequest struct { + // User identifier + UserId int64 `json:"user_id"` +} + +// Returns support information for the given user; for Telegram support only +func (client *Client) GetUserSupportInfo(req *GetUserSupportInfoRequest) (*UserSupportInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUserSupportInfo", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUserSupportInfo(result.Data) +} + +type SetUserSupportInfoRequest struct { + // User identifier + UserId int64 `json:"user_id"` + // New information message + Message *FormattedText `json:"message"` +} + +// Sets support information for the given user; for Telegram support only +func (client *Client) SetUserSupportInfo(req *SetUserSupportInfoRequest) (*UserSupportInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setUserSupportInfo", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "message": req.Message, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUserSupportInfo(result.Data) +} + +// 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 func (client *Client) TestCallEmpty() (*Ok, error) { result, err := client.Send(Request{ @@ -13507,13 +19076,13 @@ func (client *Client) TestNetwork() (*Ok, error) { } type TestProxyRequest struct { - // Proxy server IP address + // Proxy server domain or IP address Server string `json:"server"` // Proxy server port Port int32 `json:"port"` // Proxy type Type ProxyType `json:"type"` - // Identifier of a datacenter, with which to test connection + // Identifier of a datacenter with which to test connection DcId int32 `json:"dc_id"` // The maximum overall timeout for the request Timeout float64 `json:"timeout"` @@ -13613,6 +19182,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(result.Data) + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(result.Data) + case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(result.Data) @@ -13625,6 +19197,12 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatPhoto: return UnmarshalUpdateChatPhoto(result.Data) + case TypeUpdateChatAccentColor: + return UnmarshalUpdateChatAccentColor(result.Data) + + case TypeUpdateChatBackgroundCustomEmoji: + return UnmarshalUpdateChatBackgroundCustomEmoji(result.Data) + case TypeUpdateChatPermissions: return UnmarshalUpdateChatPermissions(result.Data) @@ -13643,14 +19221,17 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(result.Data) + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(result.Data) + case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(result.Data) case TypeUpdateChatMessageSender: return UnmarshalUpdateChatMessageSender(result.Data) - case TypeUpdateChatMessageTtl: - return UnmarshalUpdateChatMessageTtl(result.Data) + case TypeUpdateChatMessageAutoDeleteTime: + return UnmarshalUpdateChatMessageAutoDeleteTime(result.Data) case TypeUpdateChatNotificationSettings: return UnmarshalUpdateChatNotificationSettings(result.Data) @@ -13661,12 +19242,18 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(result.Data) + case TypeUpdateChatBackground: + return UnmarshalUpdateChatBackground(result.Data) + case TypeUpdateChatTheme: return UnmarshalUpdateChatTheme(result.Data) case TypeUpdateChatUnreadMentionCount: return UnmarshalUpdateChatUnreadMentionCount(result.Data) + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(result.Data) + case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(result.Data) @@ -13676,21 +19263,27 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatHasProtectedContent: return UnmarshalUpdateChatHasProtectedContent(result.Data) - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(result.Data) - - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(result.Data) + case TypeUpdateChatIsTranslatable: + return UnmarshalUpdateChatIsTranslatable(result.Data) case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(result.Data) - case TypeUpdateChatFilters: - return UnmarshalUpdateChatFilters(result.Data) + case TypeUpdateChatBlockList: + return UnmarshalUpdateChatBlockList(result.Data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(result.Data) + + case TypeUpdateChatFolders: + return UnmarshalUpdateChatFolders(result.Data) case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(result.Data) + case TypeUpdateForumTopicInfo: + return UnmarshalUpdateForumTopicInfo(result.Data) + case TypeUpdateScopeNotificationSettings: return UnmarshalUpdateScopeNotificationSettings(result.Data) @@ -13748,6 +19341,18 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(result.Data) + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(result.Data) + + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(result.Data) + + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(result.Data) + + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(result.Data) + case TypeUpdateCall: return UnmarshalUpdateCall(result.Data) @@ -13769,6 +19374,27 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateUnreadChatCount: return UnmarshalUpdateUnreadChatCount(result.Data) + case TypeUpdateStory: + return UnmarshalUpdateStory(result.Data) + + case TypeUpdateStoryDeleted: + return UnmarshalUpdateStoryDeleted(result.Data) + + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(result.Data) + + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(result.Data) + + case TypeUpdateChatActiveStories: + return UnmarshalUpdateChatActiveStories(result.Data) + + case TypeUpdateStoryListChatCount: + return UnmarshalUpdateStoryListChatCount(result.Data) + + case TypeUpdateStoryStealthMode: + return UnmarshalUpdateStoryStealthMode(result.Data) + case TypeUpdateOption: return UnmarshalUpdateOption(result.Data) @@ -13790,12 +19416,18 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(result.Data) + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(result.Data) + case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(result.Data) case TypeUpdateChatThemes: return UnmarshalUpdateChatThemes(result.Data) + case TypeUpdateAccentColors: + return UnmarshalUpdateAccentColors(result.Data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(result.Data) @@ -13808,6 +19440,21 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(result.Data) + case TypeUpdateUnconfirmedSession: + return UnmarshalUpdateUnconfirmedSession(result.Data) + + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(result.Data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(result.Data) + + case TypeUpdateActiveEmojiReactions: + return UnmarshalUpdateActiveEmojiReactions(result.Data) + + case TypeUpdateDefaultReactionType: + return UnmarshalUpdateDefaultReactionType(result.Data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(result.Data) @@ -13820,6 +19467,12 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(result.Data) + case TypeUpdateAddChatMembersPrivacyForbidden: + return UnmarshalUpdateAddChatMembersPrivacyForbidden(result.Data) + + case TypeUpdateAutosaveSettings: + return UnmarshalUpdateAutosaveSettings(result.Data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(result.Data) @@ -13856,6 +19509,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateNewChatJoinRequest: return UnmarshalUpdateNewChatJoinRequest(result.Data) + case TypeUpdateChatBoost: + return UnmarshalUpdateChatBoost(result.Data) + default: return nil, errors.New("invalid type") } diff --git a/client/type.go b/client/type.go index 0022c59..4fabcbe 100755 --- a/client/type.go +++ b/client/type.go @@ -8,24 +8,39 @@ import ( const ( ClassAuthenticationCodeType = "AuthenticationCodeType" + ClassEmailAddressAuthentication = "EmailAddressAuthentication" + ClassEmailAddressResetState = "EmailAddressResetState" ClassAuthorizationState = "AuthorizationState" ClassInputFile = "InputFile" ClassThumbnailFormat = "ThumbnailFormat" ClassMaskPoint = "MaskPoint" + ClassStickerFormat = "StickerFormat" + ClassStickerType = "StickerType" + ClassStickerFullType = "StickerFullType" ClassPollType = "PollType" ClassUserType = "UserType" + ClassChatPhotoStickerType = "ChatPhotoStickerType" ClassInputChatPhoto = "InputChatPhoto" + ClassPremiumGiveawayParticipantStatus = "PremiumGiveawayParticipantStatus" + ClassPremiumGiveawayInfo = "PremiumGiveawayInfo" ClassChatMemberStatus = "ChatMemberStatus" ClassChatMembersFilter = "ChatMembersFilter" ClassSupergroupMembersFilter = "SupergroupMembersFilter" + ClassInviteLinkChatType = "InviteLinkChatType" ClassSecretChatState = "SecretChatState" ClassMessageSender = "MessageSender" - ClassMessageForwardOrigin = "MessageForwardOrigin" + ClassMessageOrigin = "MessageOrigin" + ClassReactionType = "ReactionType" ClassMessageSendingState = "MessageSendingState" + ClassMessageReplyTo = "MessageReplyTo" + ClassInputMessageReplyTo = "InputMessageReplyTo" + ClassMessageSource = "MessageSource" + ClassMessageSponsorType = "MessageSponsorType" ClassNotificationSettingsScope = "NotificationSettingsScope" ClassChatType = "ChatType" ClassChatList = "ChatList" ClassChatSource = "ChatSource" + ClassChatAvailableReactions = "ChatAvailableReactions" ClassPublicChatType = "PublicChatType" ClassChatActionBar = "ChatActionBar" ClassKeyboardButtonType = "KeyboardButtonType" @@ -37,6 +52,9 @@ const ( ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" ClassPageBlock = "PageBlock" ClassInputCredentials = "InputCredentials" + ClassPaymentProvider = "PaymentProvider" + ClassInputInvoice = "InputInvoice" + ClassMessageExtendedMedia = "MessageExtendedMedia" ClassPassportElementType = "PassportElementType" ClassPassportElement = "PassportElement" ClassInputPassportElement = "InputPassportElement" @@ -45,25 +63,44 @@ const ( ClassMessageContent = "MessageContent" ClassTextEntityType = "TextEntityType" ClassMessageSchedulingState = "MessageSchedulingState" + ClassMessageSelfDestructType = "MessageSelfDestructType" ClassInputMessageContent = "InputMessageContent" ClassSearchMessagesFilter = "SearchMessagesFilter" ClassChatAction = "ChatAction" ClassUserStatus = "UserStatus" + ClassEmojiCategoryType = "EmojiCategoryType" + ClassStoryAreaType = "StoryAreaType" + ClassInputStoryAreaType = "InputStoryAreaType" + ClassStoryContent = "StoryContent" + ClassInputStoryContent = "InputStoryContent" + ClassStoryList = "StoryList" + ClassChatBoostSource = "ChatBoostSource" ClassCallDiscardReason = "CallDiscardReason" ClassCallServerType = "CallServerType" ClassCallState = "CallState" ClassGroupCallVideoQuality = "GroupCallVideoQuality" ClassCallProblem = "CallProblem" + ClassFirebaseAuthenticationSettings = "FirebaseAuthenticationSettings" ClassDiceStickers = "DiceStickers" + ClassSpeechRecognitionResult = "SpeechRecognitionResult" + ClassBotWriteAccessAllowReason = "BotWriteAccessAllowReason" ClassInputInlineQueryResult = "InputInlineQueryResult" ClassInlineQueryResult = "InlineQueryResult" + ClassInlineQueryResultsButtonType = "InlineQueryResultsButtonType" ClassCallbackQueryPayload = "CallbackQueryPayload" ClassChatEventAction = "ChatEventAction" ClassLanguagePackStringValue = "LanguagePackStringValue" + ClassPremiumLimitType = "PremiumLimitType" + ClassPremiumFeature = "PremiumFeature" + ClassPremiumStoryFeature = "PremiumStoryFeature" + ClassPremiumSource = "PremiumSource" + ClassStorePaymentPurpose = "StorePaymentPurpose" + ClassTelegramPaymentPurpose = "TelegramPaymentPurpose" ClassDeviceToken = "DeviceToken" ClassBackgroundFill = "BackgroundFill" ClassBackgroundType = "BackgroundType" ClassInputBackground = "InputBackground" + ClassCanSendStoryResult = "CanSendStoryResult" ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" ClassCheckChatUsernameResult = "CheckChatUsernameResult" ClassCheckStickerSetNameResult = "CheckStickerSetNameResult" @@ -74,20 +111,24 @@ const ( ClassNotificationGroupType = "NotificationGroupType" ClassOptionValue = "OptionValue" ClassJsonValue = "JsonValue" + ClassStoryPrivacySettings = "StoryPrivacySettings" ClassUserPrivacySettingRule = "UserPrivacySettingRule" ClassUserPrivacySetting = "UserPrivacySetting" - ClassChatReportReason = "ChatReportReason" + ClassSessionType = "SessionType" + ClassReportReason = "ReportReason" + ClassTargetChat = "TargetChat" ClassInternalLinkType = "InternalLinkType" + ClassBlockList = "BlockList" ClassFileType = "FileType" ClassNetworkType = "NetworkType" ClassNetworkStatisticsEntry = "NetworkStatisticsEntry" + ClassAutosaveSettingsScope = "AutosaveSettingsScope" ClassConnectionState = "ConnectionState" ClassTopChatCategory = "TopChatCategory" ClassTMeUrlType = "TMeUrlType" ClassSuggestedAction = "SuggestedAction" ClassTextParseMode = "TextParseMode" ClassProxyType = "ProxyType" - ClassInputSticker = "InputSticker" ClassStatisticalGraph = "StatisticalGraph" ClassChatStatistics = "ChatStatistics" ClassVectorPathCommand = "VectorPathCommand" @@ -96,7 +137,6 @@ const ( ClassLogStream = "LogStream" ClassError = "Error" ClassOk = "Ok" - ClassTdlibParameters = "TdlibParameters" ClassAuthenticationCodeInfo = "AuthenticationCodeInfo" ClassEmailAddressAuthenticationCodeInfo = "EmailAddressAuthenticationCodeInfo" ClassTextEntity = "TextEntity" @@ -128,21 +168,38 @@ const ( ClassLocation = "Location" ClassVenue = "Venue" ClassGame = "Game" + ClassWebApp = "WebApp" ClassPoll = "Poll" + ClassBackground = "Background" + ClassBackgrounds = "Backgrounds" + ClassChatBackground = "ChatBackground" ClassProfilePhoto = "ProfilePhoto" ClassChatPhotoInfo = "ChatPhotoInfo" ClassBotCommand = "BotCommand" ClassBotCommands = "BotCommands" + ClassBotMenuButton = "BotMenuButton" ClassChatLocation = "ChatLocation" + ClassChatPhotoSticker = "ChatPhotoSticker" ClassAnimatedChatPhoto = "AnimatedChatPhoto" ClassChatPhoto = "ChatPhoto" ClassChatPhotos = "ChatPhotos" + ClassChatPermissions = "ChatPermissions" + ClassChatAdministratorRights = "ChatAdministratorRights" + ClassPremiumPaymentOption = "PremiumPaymentOption" + ClassPremiumStatePaymentOption = "PremiumStatePaymentOption" + ClassPremiumGiftCodePaymentOption = "PremiumGiftCodePaymentOption" + ClassPremiumGiftCodePaymentOptions = "PremiumGiftCodePaymentOptions" + ClassPremiumGiftCodeInfo = "PremiumGiftCodeInfo" + ClassAccentColor = "AccentColor" + ClassEmojiStatus = "EmojiStatus" + ClassEmojiStatuses = "EmojiStatuses" + ClassUsernames = "Usernames" ClassUser = "User" + ClassBotInfo = "BotInfo" ClassUserFullInfo = "UserFullInfo" ClassUsers = "Users" ClassChatAdministrator = "ChatAdministrator" ClassChatAdministrators = "ChatAdministrators" - ClassChatPermissions = "ChatPermissions" ClassChatMember = "ChatMember" ClassChatMembers = "ChatMembers" ClassChatInviteLink = "ChatInviteLink" @@ -161,24 +218,42 @@ const ( ClassSupergroupFullInfo = "SupergroupFullInfo" ClassSecretChat = "SecretChat" ClassMessageSenders = "MessageSenders" + ClassChatMessageSender = "ChatMessageSender" + ClassChatMessageSenders = "ChatMessageSenders" + ClassMessageViewer = "MessageViewer" + ClassMessageViewers = "MessageViewers" ClassMessageForwardInfo = "MessageForwardInfo" + ClassMessageImportInfo = "MessageImportInfo" ClassMessageReplyInfo = "MessageReplyInfo" + ClassMessageReaction = "MessageReaction" ClassMessageInteractionInfo = "MessageInteractionInfo" + ClassUnreadReaction = "UnreadReaction" ClassMessage = "Message" ClassMessages = "Messages" ClassFoundMessages = "FoundMessages" + ClassFoundChatMessages = "FoundChatMessages" ClassMessagePosition = "MessagePosition" ClassMessagePositions = "MessagePositions" ClassMessageCalendarDay = "MessageCalendarDay" ClassMessageCalendar = "MessageCalendar" + ClassMessageSponsor = "MessageSponsor" ClassSponsoredMessage = "SponsoredMessage" + ClassSponsoredMessages = "SponsoredMessages" + ClassFileDownload = "FileDownload" + ClassDownloadedFileCounts = "DownloadedFileCounts" + ClassFoundFileDownloads = "FoundFileDownloads" ClassChatNotificationSettings = "ChatNotificationSettings" ClassScopeNotificationSettings = "ScopeNotificationSettings" ClassDraftMessage = "DraftMessage" - ClassChatFilter = "ChatFilter" - ClassChatFilterInfo = "ChatFilterInfo" - ClassRecommendedChatFilter = "RecommendedChatFilter" - ClassRecommendedChatFilters = "RecommendedChatFilters" + ClassChatFolderIcon = "ChatFolderIcon" + ClassChatFolder = "ChatFolder" + ClassChatFolderInfo = "ChatFolderInfo" + ClassChatFolderInviteLink = "ChatFolderInviteLink" + ClassChatFolderInviteLinks = "ChatFolderInviteLinks" + ClassChatFolderInviteLinkInfo = "ChatFolderInviteLinkInfo" + ClassRecommendedChatFolder = "RecommendedChatFolder" + ClassRecommendedChatFolders = "RecommendedChatFolders" + ClassArchiveChatListSettings = "ArchiveChatListSettings" ClassChatLists = "ChatLists" ClassChatPosition = "ChatPosition" ClassVideoChat = "VideoChat" @@ -188,7 +263,14 @@ const ( ClassChatsNearby = "ChatsNearby" ClassKeyboardButton = "KeyboardButton" ClassInlineKeyboardButton = "InlineKeyboardButton" + ClassFoundWebApp = "FoundWebApp" + ClassWebAppInfo = "WebAppInfo" ClassMessageThreadInfo = "MessageThreadInfo" + ClassForumTopicIcon = "ForumTopicIcon" + ClassForumTopicInfo = "ForumTopicInfo" + ClassForumTopic = "ForumTopic" + ClassForumTopics = "ForumTopics" + ClassLinkPreviewOptions = "LinkPreviewOptions" ClassPageBlockCaption = "PageBlockCaption" ClassPageBlockListItem = "PageBlockListItem" ClassPageBlockTableCell = "PageBlockTableCell" @@ -201,17 +283,18 @@ const ( ClassBankCardActionOpenUrl = "BankCardActionOpenUrl" ClassBankCardInfo = "BankCardInfo" ClassAddress = "Address" + ClassThemeParameters = "ThemeParameters" ClassLabeledPricePart = "LabeledPricePart" ClassInvoice = "Invoice" ClassOrderInfo = "OrderInfo" ClassShippingOption = "ShippingOption" ClassSavedCredentials = "SavedCredentials" - ClassPaymentsProviderStripe = "PaymentsProviderStripe" - ClassPaymentFormTheme = "PaymentFormTheme" + ClassPaymentOption = "PaymentOption" ClassPaymentForm = "PaymentForm" ClassValidatedOrderInfo = "ValidatedOrderInfo" ClassPaymentResult = "PaymentResult" ClassPaymentReceipt = "PaymentReceipt" + ClassPremiumGiveawayParameters = "PremiumGiveawayParameters" ClassDatedFile = "DatedFile" ClassDate = "Date" ClassPersonalDetails = "PersonalDetails" @@ -236,10 +319,34 @@ const ( ClassStickerSet = "StickerSet" ClassStickerSetInfo = "StickerSetInfo" ClassStickerSets = "StickerSets" + ClassTrendingStickerSets = "TrendingStickerSets" + ClassEmojiCategory = "EmojiCategory" + ClassEmojiCategories = "EmojiCategories" + ClassStoryViewer = "StoryViewer" + ClassStoryViewers = "StoryViewers" + ClassStoryAreaPosition = "StoryAreaPosition" + ClassStoryArea = "StoryArea" + ClassInputStoryArea = "InputStoryArea" + ClassInputStoryAreas = "InputStoryAreas" + ClassStoryVideo = "StoryVideo" + ClassStoryInteractionInfo = "StoryInteractionInfo" + ClassStory = "Story" + ClassStories = "Stories" + ClassStoryInfo = "StoryInfo" + ClassChatActiveStories = "ChatActiveStories" + ClassPrepaidPremiumGiveaway = "PrepaidPremiumGiveaway" + ClassChatBoostStatus = "ChatBoostStatus" + ClassChatBoost = "ChatBoost" + ClassFoundChatBoosts = "FoundChatBoosts" + ClassChatBoostSlot = "ChatBoostSlot" + ClassChatBoostSlots = "ChatBoostSlots" ClassCallProtocol = "CallProtocol" ClassCallServer = "CallServer" ClassCallId = "CallId" ClassGroupCallId = "GroupCallId" + ClassGroupCallStream = "GroupCallStream" + ClassGroupCallStreams = "GroupCallStreams" + ClassRtmpUrl = "RtmpUrl" ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker" ClassGroupCall = "GroupCall" ClassGroupCallVideoSourceGroup = "GroupCallVideoSourceGroup" @@ -247,9 +354,19 @@ const ( ClassGroupCallParticipant = "GroupCallParticipant" ClassCall = "Call" ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" + ClassAddedReaction = "AddedReaction" + ClassAddedReactions = "AddedReactions" + ClassAvailableReaction = "AvailableReaction" + ClassAvailableReactions = "AvailableReactions" + ClassEmojiReaction = "EmojiReaction" ClassAnimations = "Animations" ClassImportedContacts = "ImportedContacts" + ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" + ClassAttachmentMenuBot = "AttachmentMenuBot" + ClassSentWebAppMessage = "SentWebAppMessage" ClassHttpUrl = "HttpUrl" + ClassUserLink = "UserLink" + ClassInlineQueryResultsButton = "InlineQueryResultsButton" ClassInlineQueryResults = "InlineQueryResults" ClassCallbackQueryAnswer = "CallbackQueryAnswer" ClassCustomRequestResult = "CustomRequestResult" @@ -262,23 +379,31 @@ const ( ClassLanguagePackStrings = "LanguagePackStrings" ClassLanguagePackInfo = "LanguagePackInfo" ClassLocalizationTargetInfo = "LocalizationTargetInfo" + ClassPremiumLimit = "PremiumLimit" + ClassPremiumFeatures = "PremiumFeatures" + ClassPremiumFeaturePromotionAnimation = "PremiumFeaturePromotionAnimation" + ClassPremiumState = "PremiumState" ClassPushReceiverId = "PushReceiverId" - ClassBackground = "Background" - ClassBackgrounds = "Backgrounds" ClassThemeSettings = "ThemeSettings" ClassChatTheme = "ChatTheme" ClassHashtags = "Hashtags" + ClassNotificationSound = "NotificationSound" + ClassNotificationSounds = "NotificationSounds" ClassNotification = "Notification" ClassNotificationGroup = "NotificationGroup" ClassJsonObjectMember = "JsonObjectMember" ClassUserPrivacySettingRules = "UserPrivacySettingRules" ClassAccountTtl = "AccountTtl" + ClassMessageAutoDeleteTime = "MessageAutoDeleteTime" ClassSession = "Session" ClassSessions = "Sessions" + ClassUnconfirmedSession = "UnconfirmedSession" ClassConnectedWebsite = "ConnectedWebsite" ClassConnectedWebsites = "ConnectedWebsites" ClassMessageLink = "MessageLink" ClassMessageLinkInfo = "MessageLinkInfo" + ClassChatBoostLink = "ChatBoostLink" + ClassChatBoostLinkInfo = "ChatBoostLinkInfo" ClassFilePart = "FilePart" ClassStorageStatisticsByFileType = "StorageStatisticsByFileType" ClassStorageStatisticsByChat = "StorageStatisticsByChat" @@ -288,14 +413,21 @@ const ( ClassNetworkStatistics = "NetworkStatistics" ClassAutoDownloadSettings = "AutoDownloadSettings" ClassAutoDownloadSettingsPresets = "AutoDownloadSettingsPresets" + ClassScopeAutosaveSettings = "ScopeAutosaveSettings" + ClassAutosaveSettingsException = "AutosaveSettingsException" + ClassAutosaveSettings = "AutosaveSettings" + ClassFoundPosition = "FoundPosition" + ClassFoundPositions = "FoundPositions" ClassTMeUrl = "TMeUrl" ClassTMeUrls = "TMeUrls" ClassCount = "Count" ClassText = "Text" ClassSeconds = "Seconds" + ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize" ClassDeepLinkInfo = "DeepLinkInfo" ClassProxy = "Proxy" ClassProxies = "Proxies" + ClassInputSticker = "InputSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" ClassChatStatisticsMessageInteractionInfo = "ChatStatisticsMessageInteractionInfo" @@ -307,6 +439,7 @@ const ( ClassUpdates = "Updates" ClassLogVerbosityLevel = "LogVerbosityLevel" ClassLogTags = "LogTags" + ClassUserSupportInfo = "UserSupportInfo" ClassTestInt = "TestInt" ClassTestString = "TestString" ClassTestBytes = "TestBytes" @@ -317,956 +450,1332 @@ const ( ) const ( - TypeError = "error" - TypeOk = "ok" - TypeTdlibParameters = "tdlibParameters" - TypeAuthenticationCodeTypeTelegramMessage = "authenticationCodeTypeTelegramMessage" - TypeAuthenticationCodeTypeSms = "authenticationCodeTypeSms" - TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall" - TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall" - TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall" - TypeAuthenticationCodeInfo = "authenticationCodeInfo" - TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo" - TypeTextEntity = "textEntity" - TypeTextEntities = "textEntities" - TypeFormattedText = "formattedText" - TypeTermsOfService = "termsOfService" - TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" - TypeAuthorizationStateWaitEncryptionKey = "authorizationStateWaitEncryptionKey" - TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" - TypeAuthorizationStateWaitCode = "authorizationStateWaitCode" - TypeAuthorizationStateWaitOtherDeviceConfirmation = "authorizationStateWaitOtherDeviceConfirmation" - TypeAuthorizationStateWaitRegistration = "authorizationStateWaitRegistration" - TypeAuthorizationStateWaitPassword = "authorizationStateWaitPassword" - TypeAuthorizationStateReady = "authorizationStateReady" - TypeAuthorizationStateLoggingOut = "authorizationStateLoggingOut" - TypeAuthorizationStateClosing = "authorizationStateClosing" - TypeAuthorizationStateClosed = "authorizationStateClosed" - TypePasswordState = "passwordState" - TypeRecoveryEmailAddress = "recoveryEmailAddress" - TypeTemporaryPasswordState = "temporaryPasswordState" - TypeLocalFile = "localFile" - TypeRemoteFile = "remoteFile" - TypeFile = "file" - TypeInputFileId = "inputFileId" - TypeInputFileRemote = "inputFileRemote" - TypeInputFileLocal = "inputFileLocal" - TypeInputFileGenerated = "inputFileGenerated" - TypePhotoSize = "photoSize" - TypeMinithumbnail = "minithumbnail" - TypeThumbnailFormatJpeg = "thumbnailFormatJpeg" - TypeThumbnailFormatPng = "thumbnailFormatPng" - TypeThumbnailFormatWebp = "thumbnailFormatWebp" - TypeThumbnailFormatGif = "thumbnailFormatGif" - TypeThumbnailFormatTgs = "thumbnailFormatTgs" - TypeThumbnailFormatMpeg4 = "thumbnailFormatMpeg4" - TypeThumbnail = "thumbnail" - TypeMaskPointForehead = "maskPointForehead" - TypeMaskPointEyes = "maskPointEyes" - TypeMaskPointMouth = "maskPointMouth" - TypeMaskPointChin = "maskPointChin" - TypeMaskPosition = "maskPosition" - TypeClosedVectorPath = "closedVectorPath" - TypePollOption = "pollOption" - TypePollTypeRegular = "pollTypeRegular" - TypePollTypeQuiz = "pollTypeQuiz" - TypeAnimation = "animation" - TypeAudio = "audio" - TypeDocument = "document" - TypePhoto = "photo" - TypeSticker = "sticker" - TypeVideo = "video" - TypeVideoNote = "videoNote" - TypeVoiceNote = "voiceNote" - TypeAnimatedEmoji = "animatedEmoji" - TypeContact = "contact" - TypeLocation = "location" - TypeVenue = "venue" - TypeGame = "game" - TypePoll = "poll" - TypeProfilePhoto = "profilePhoto" - TypeChatPhotoInfo = "chatPhotoInfo" - TypeUserTypeRegular = "userTypeRegular" - TypeUserTypeDeleted = "userTypeDeleted" - TypeUserTypeBot = "userTypeBot" - TypeUserTypeUnknown = "userTypeUnknown" - TypeBotCommand = "botCommand" - TypeBotCommands = "botCommands" - TypeChatLocation = "chatLocation" - TypeAnimatedChatPhoto = "animatedChatPhoto" - TypeChatPhoto = "chatPhoto" - TypeChatPhotos = "chatPhotos" - TypeInputChatPhotoPrevious = "inputChatPhotoPrevious" - TypeInputChatPhotoStatic = "inputChatPhotoStatic" - TypeInputChatPhotoAnimation = "inputChatPhotoAnimation" - TypeUser = "user" - TypeUserFullInfo = "userFullInfo" - TypeUsers = "users" - TypeChatAdministrator = "chatAdministrator" - TypeChatAdministrators = "chatAdministrators" - TypeChatPermissions = "chatPermissions" - TypeChatMemberStatusCreator = "chatMemberStatusCreator" - TypeChatMemberStatusAdministrator = "chatMemberStatusAdministrator" - TypeChatMemberStatusMember = "chatMemberStatusMember" - TypeChatMemberStatusRestricted = "chatMemberStatusRestricted" - TypeChatMemberStatusLeft = "chatMemberStatusLeft" - TypeChatMemberStatusBanned = "chatMemberStatusBanned" - TypeChatMember = "chatMember" - TypeChatMembers = "chatMembers" - TypeChatMembersFilterContacts = "chatMembersFilterContacts" - TypeChatMembersFilterAdministrators = "chatMembersFilterAdministrators" - TypeChatMembersFilterMembers = "chatMembersFilterMembers" - TypeChatMembersFilterMention = "chatMembersFilterMention" - TypeChatMembersFilterRestricted = "chatMembersFilterRestricted" - TypeChatMembersFilterBanned = "chatMembersFilterBanned" - TypeChatMembersFilterBots = "chatMembersFilterBots" - TypeSupergroupMembersFilterRecent = "supergroupMembersFilterRecent" - TypeSupergroupMembersFilterContacts = "supergroupMembersFilterContacts" - TypeSupergroupMembersFilterAdministrators = "supergroupMembersFilterAdministrators" - TypeSupergroupMembersFilterSearch = "supergroupMembersFilterSearch" - TypeSupergroupMembersFilterRestricted = "supergroupMembersFilterRestricted" - TypeSupergroupMembersFilterBanned = "supergroupMembersFilterBanned" - TypeSupergroupMembersFilterMention = "supergroupMembersFilterMention" - TypeSupergroupMembersFilterBots = "supergroupMembersFilterBots" - TypeChatInviteLink = "chatInviteLink" - TypeChatInviteLinks = "chatInviteLinks" - TypeChatInviteLinkCount = "chatInviteLinkCount" - TypeChatInviteLinkCounts = "chatInviteLinkCounts" - TypeChatInviteLinkMember = "chatInviteLinkMember" - TypeChatInviteLinkMembers = "chatInviteLinkMembers" - TypeChatInviteLinkInfo = "chatInviteLinkInfo" - TypeChatJoinRequest = "chatJoinRequest" - TypeChatJoinRequests = "chatJoinRequests" - TypeChatJoinRequestsInfo = "chatJoinRequestsInfo" - TypeBasicGroup = "basicGroup" - TypeBasicGroupFullInfo = "basicGroupFullInfo" - TypeSupergroup = "supergroup" - TypeSupergroupFullInfo = "supergroupFullInfo" - TypeSecretChatStatePending = "secretChatStatePending" - TypeSecretChatStateReady = "secretChatStateReady" - TypeSecretChatStateClosed = "secretChatStateClosed" - TypeSecretChat = "secretChat" - TypeMessageSenderUser = "messageSenderUser" - TypeMessageSenderChat = "messageSenderChat" - TypeMessageSenders = "messageSenders" - TypeMessageForwardOriginUser = "messageForwardOriginUser" - TypeMessageForwardOriginChat = "messageForwardOriginChat" - TypeMessageForwardOriginHiddenUser = "messageForwardOriginHiddenUser" - TypeMessageForwardOriginChannel = "messageForwardOriginChannel" - TypeMessageForwardOriginMessageImport = "messageForwardOriginMessageImport" - TypeMessageForwardInfo = "messageForwardInfo" - TypeMessageReplyInfo = "messageReplyInfo" - TypeMessageInteractionInfo = "messageInteractionInfo" - TypeMessageSendingStatePending = "messageSendingStatePending" - TypeMessageSendingStateFailed = "messageSendingStateFailed" - TypeMessage = "message" - TypeMessages = "messages" - TypeFoundMessages = "foundMessages" - TypeMessagePosition = "messagePosition" - TypeMessagePositions = "messagePositions" - TypeMessageCalendarDay = "messageCalendarDay" - TypeMessageCalendar = "messageCalendar" - TypeSponsoredMessage = "sponsoredMessage" - TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats" - TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats" - TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats" - TypeChatNotificationSettings = "chatNotificationSettings" - TypeScopeNotificationSettings = "scopeNotificationSettings" - TypeDraftMessage = "draftMessage" - TypeChatTypePrivate = "chatTypePrivate" - TypeChatTypeBasicGroup = "chatTypeBasicGroup" - TypeChatTypeSupergroup = "chatTypeSupergroup" - TypeChatTypeSecret = "chatTypeSecret" - TypeChatFilter = "chatFilter" - TypeChatFilterInfo = "chatFilterInfo" - TypeRecommendedChatFilter = "recommendedChatFilter" - TypeRecommendedChatFilters = "recommendedChatFilters" - TypeChatListMain = "chatListMain" - TypeChatListArchive = "chatListArchive" - TypeChatListFilter = "chatListFilter" - TypeChatLists = "chatLists" - TypeChatSourceMtprotoProxy = "chatSourceMtprotoProxy" - TypeChatSourcePublicServiceAnnouncement = "chatSourcePublicServiceAnnouncement" - TypeChatPosition = "chatPosition" - TypeVideoChat = "videoChat" - TypeChat = "chat" - TypeChats = "chats" - TypeChatNearby = "chatNearby" - TypeChatsNearby = "chatsNearby" - TypePublicChatTypeHasUsername = "publicChatTypeHasUsername" - TypePublicChatTypeIsLocationBased = "publicChatTypeIsLocationBased" - TypeChatActionBarReportSpam = "chatActionBarReportSpam" - TypeChatActionBarReportUnrelatedLocation = "chatActionBarReportUnrelatedLocation" - TypeChatActionBarInviteMembers = "chatActionBarInviteMembers" - TypeChatActionBarReportAddBlock = "chatActionBarReportAddBlock" - TypeChatActionBarAddContact = "chatActionBarAddContact" - TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber" - TypeChatActionBarJoinRequest = "chatActionBarJoinRequest" - TypeKeyboardButtonTypeText = "keyboardButtonTypeText" - TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" - TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" - TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll" - TypeKeyboardButton = "keyboardButton" - TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" - TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl" - TypeInlineKeyboardButtonTypeCallback = "inlineKeyboardButtonTypeCallback" - TypeInlineKeyboardButtonTypeCallbackWithPassword = "inlineKeyboardButtonTypeCallbackWithPassword" - TypeInlineKeyboardButtonTypeCallbackGame = "inlineKeyboardButtonTypeCallbackGame" - TypeInlineKeyboardButtonTypeSwitchInline = "inlineKeyboardButtonTypeSwitchInline" - TypeInlineKeyboardButtonTypeBuy = "inlineKeyboardButtonTypeBuy" - TypeInlineKeyboardButtonTypeUser = "inlineKeyboardButtonTypeUser" - TypeInlineKeyboardButton = "inlineKeyboardButton" - TypeReplyMarkupRemoveKeyboard = "replyMarkupRemoveKeyboard" - TypeReplyMarkupForceReply = "replyMarkupForceReply" - TypeReplyMarkupShowKeyboard = "replyMarkupShowKeyboard" - TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard" - TypeLoginUrlInfoOpen = "loginUrlInfoOpen" - TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation" - TypeMessageThreadInfo = "messageThreadInfo" - TypeRichTextPlain = "richTextPlain" - TypeRichTextBold = "richTextBold" - TypeRichTextItalic = "richTextItalic" - TypeRichTextUnderline = "richTextUnderline" - TypeRichTextStrikethrough = "richTextStrikethrough" - TypeRichTextFixed = "richTextFixed" - TypeRichTextUrl = "richTextUrl" - TypeRichTextEmailAddress = "richTextEmailAddress" - TypeRichTextSubscript = "richTextSubscript" - TypeRichTextSuperscript = "richTextSuperscript" - TypeRichTextMarked = "richTextMarked" - TypeRichTextPhoneNumber = "richTextPhoneNumber" - TypeRichTextIcon = "richTextIcon" - TypeRichTextReference = "richTextReference" - TypeRichTextAnchor = "richTextAnchor" - TypeRichTextAnchorLink = "richTextAnchorLink" - TypeRichTexts = "richTexts" - TypePageBlockCaption = "pageBlockCaption" - TypePageBlockListItem = "pageBlockListItem" - TypePageBlockHorizontalAlignmentLeft = "pageBlockHorizontalAlignmentLeft" - TypePageBlockHorizontalAlignmentCenter = "pageBlockHorizontalAlignmentCenter" - TypePageBlockHorizontalAlignmentRight = "pageBlockHorizontalAlignmentRight" - TypePageBlockVerticalAlignmentTop = "pageBlockVerticalAlignmentTop" - TypePageBlockVerticalAlignmentMiddle = "pageBlockVerticalAlignmentMiddle" - TypePageBlockVerticalAlignmentBottom = "pageBlockVerticalAlignmentBottom" - TypePageBlockTableCell = "pageBlockTableCell" - TypePageBlockRelatedArticle = "pageBlockRelatedArticle" - TypePageBlockTitle = "pageBlockTitle" - TypePageBlockSubtitle = "pageBlockSubtitle" - TypePageBlockAuthorDate = "pageBlockAuthorDate" - TypePageBlockHeader = "pageBlockHeader" - TypePageBlockSubheader = "pageBlockSubheader" - TypePageBlockKicker = "pageBlockKicker" - TypePageBlockParagraph = "pageBlockParagraph" - TypePageBlockPreformatted = "pageBlockPreformatted" - TypePageBlockFooter = "pageBlockFooter" - TypePageBlockDivider = "pageBlockDivider" - TypePageBlockAnchor = "pageBlockAnchor" - TypePageBlockList = "pageBlockList" - TypePageBlockBlockQuote = "pageBlockBlockQuote" - TypePageBlockPullQuote = "pageBlockPullQuote" - TypePageBlockAnimation = "pageBlockAnimation" - TypePageBlockAudio = "pageBlockAudio" - TypePageBlockPhoto = "pageBlockPhoto" - TypePageBlockVideo = "pageBlockVideo" - TypePageBlockVoiceNote = "pageBlockVoiceNote" - TypePageBlockCover = "pageBlockCover" - TypePageBlockEmbedded = "pageBlockEmbedded" - TypePageBlockEmbeddedPost = "pageBlockEmbeddedPost" - TypePageBlockCollage = "pageBlockCollage" - TypePageBlockSlideshow = "pageBlockSlideshow" - TypePageBlockChatLink = "pageBlockChatLink" - TypePageBlockTable = "pageBlockTable" - TypePageBlockDetails = "pageBlockDetails" - TypePageBlockRelatedArticles = "pageBlockRelatedArticles" - TypePageBlockMap = "pageBlockMap" - TypeWebPageInstantView = "webPageInstantView" - TypeWebPage = "webPage" - TypeCountryInfo = "countryInfo" - TypeCountries = "countries" - TypePhoneNumberInfo = "phoneNumberInfo" - TypeBankCardActionOpenUrl = "bankCardActionOpenUrl" - TypeBankCardInfo = "bankCardInfo" - TypeAddress = "address" - TypeLabeledPricePart = "labeledPricePart" - TypeInvoice = "invoice" - TypeOrderInfo = "orderInfo" - TypeShippingOption = "shippingOption" - TypeSavedCredentials = "savedCredentials" - TypeInputCredentialsSaved = "inputCredentialsSaved" - TypeInputCredentialsNew = "inputCredentialsNew" - TypeInputCredentialsApplePay = "inputCredentialsApplePay" - TypeInputCredentialsGooglePay = "inputCredentialsGooglePay" - TypePaymentsProviderStripe = "paymentsProviderStripe" - TypePaymentFormTheme = "paymentFormTheme" - TypePaymentForm = "paymentForm" - TypeValidatedOrderInfo = "validatedOrderInfo" - TypePaymentResult = "paymentResult" - TypePaymentReceipt = "paymentReceipt" - TypeDatedFile = "datedFile" - TypePassportElementTypePersonalDetails = "passportElementTypePersonalDetails" - TypePassportElementTypePassport = "passportElementTypePassport" - TypePassportElementTypeDriverLicense = "passportElementTypeDriverLicense" - TypePassportElementTypeIdentityCard = "passportElementTypeIdentityCard" - TypePassportElementTypeInternalPassport = "passportElementTypeInternalPassport" - TypePassportElementTypeAddress = "passportElementTypeAddress" - TypePassportElementTypeUtilityBill = "passportElementTypeUtilityBill" - TypePassportElementTypeBankStatement = "passportElementTypeBankStatement" - TypePassportElementTypeRentalAgreement = "passportElementTypeRentalAgreement" - TypePassportElementTypePassportRegistration = "passportElementTypePassportRegistration" - TypePassportElementTypeTemporaryRegistration = "passportElementTypeTemporaryRegistration" - TypePassportElementTypePhoneNumber = "passportElementTypePhoneNumber" - TypePassportElementTypeEmailAddress = "passportElementTypeEmailAddress" - TypeDate = "date" - TypePersonalDetails = "personalDetails" - TypeIdentityDocument = "identityDocument" - TypeInputIdentityDocument = "inputIdentityDocument" - TypePersonalDocument = "personalDocument" - TypeInputPersonalDocument = "inputPersonalDocument" - TypePassportElementPersonalDetails = "passportElementPersonalDetails" - TypePassportElementPassport = "passportElementPassport" - TypePassportElementDriverLicense = "passportElementDriverLicense" - TypePassportElementIdentityCard = "passportElementIdentityCard" - TypePassportElementInternalPassport = "passportElementInternalPassport" - TypePassportElementAddress = "passportElementAddress" - TypePassportElementUtilityBill = "passportElementUtilityBill" - TypePassportElementBankStatement = "passportElementBankStatement" - TypePassportElementRentalAgreement = "passportElementRentalAgreement" - TypePassportElementPassportRegistration = "passportElementPassportRegistration" - TypePassportElementTemporaryRegistration = "passportElementTemporaryRegistration" - TypePassportElementPhoneNumber = "passportElementPhoneNumber" - TypePassportElementEmailAddress = "passportElementEmailAddress" - TypeInputPassportElementPersonalDetails = "inputPassportElementPersonalDetails" - TypeInputPassportElementPassport = "inputPassportElementPassport" - TypeInputPassportElementDriverLicense = "inputPassportElementDriverLicense" - TypeInputPassportElementIdentityCard = "inputPassportElementIdentityCard" - TypeInputPassportElementInternalPassport = "inputPassportElementInternalPassport" - TypeInputPassportElementAddress = "inputPassportElementAddress" - TypeInputPassportElementUtilityBill = "inputPassportElementUtilityBill" - TypeInputPassportElementBankStatement = "inputPassportElementBankStatement" - TypeInputPassportElementRentalAgreement = "inputPassportElementRentalAgreement" - TypeInputPassportElementPassportRegistration = "inputPassportElementPassportRegistration" - TypeInputPassportElementTemporaryRegistration = "inputPassportElementTemporaryRegistration" - TypeInputPassportElementPhoneNumber = "inputPassportElementPhoneNumber" - TypeInputPassportElementEmailAddress = "inputPassportElementEmailAddress" - TypePassportElements = "passportElements" - TypePassportElementErrorSourceUnspecified = "passportElementErrorSourceUnspecified" - TypePassportElementErrorSourceDataField = "passportElementErrorSourceDataField" - TypePassportElementErrorSourceFrontSide = "passportElementErrorSourceFrontSide" - TypePassportElementErrorSourceReverseSide = "passportElementErrorSourceReverseSide" - TypePassportElementErrorSourceSelfie = "passportElementErrorSourceSelfie" - TypePassportElementErrorSourceTranslationFile = "passportElementErrorSourceTranslationFile" - TypePassportElementErrorSourceTranslationFiles = "passportElementErrorSourceTranslationFiles" - TypePassportElementErrorSourceFile = "passportElementErrorSourceFile" - TypePassportElementErrorSourceFiles = "passportElementErrorSourceFiles" - TypePassportElementError = "passportElementError" - TypePassportSuitableElement = "passportSuitableElement" - TypePassportRequiredElement = "passportRequiredElement" - TypePassportAuthorizationForm = "passportAuthorizationForm" - TypePassportElementsWithErrors = "passportElementsWithErrors" - TypeEncryptedCredentials = "encryptedCredentials" - TypeEncryptedPassportElement = "encryptedPassportElement" - TypeInputPassportElementErrorSourceUnspecified = "inputPassportElementErrorSourceUnspecified" - TypeInputPassportElementErrorSourceDataField = "inputPassportElementErrorSourceDataField" - TypeInputPassportElementErrorSourceFrontSide = "inputPassportElementErrorSourceFrontSide" - TypeInputPassportElementErrorSourceReverseSide = "inputPassportElementErrorSourceReverseSide" - TypeInputPassportElementErrorSourceSelfie = "inputPassportElementErrorSourceSelfie" - TypeInputPassportElementErrorSourceTranslationFile = "inputPassportElementErrorSourceTranslationFile" - TypeInputPassportElementErrorSourceTranslationFiles = "inputPassportElementErrorSourceTranslationFiles" - TypeInputPassportElementErrorSourceFile = "inputPassportElementErrorSourceFile" - TypeInputPassportElementErrorSourceFiles = "inputPassportElementErrorSourceFiles" - TypeInputPassportElementError = "inputPassportElementError" - TypeMessageText = "messageText" - TypeMessageAnimation = "messageAnimation" - TypeMessageAudio = "messageAudio" - TypeMessageDocument = "messageDocument" - TypeMessagePhoto = "messagePhoto" - TypeMessageExpiredPhoto = "messageExpiredPhoto" - TypeMessageSticker = "messageSticker" - TypeMessageVideo = "messageVideo" - TypeMessageExpiredVideo = "messageExpiredVideo" - TypeMessageVideoNote = "messageVideoNote" - TypeMessageVoiceNote = "messageVoiceNote" - TypeMessageLocation = "messageLocation" - TypeMessageVenue = "messageVenue" - TypeMessageContact = "messageContact" - TypeMessageAnimatedEmoji = "messageAnimatedEmoji" - TypeMessageDice = "messageDice" - TypeMessageGame = "messageGame" - TypeMessagePoll = "messagePoll" - TypeMessageInvoice = "messageInvoice" - TypeMessageCall = "messageCall" - TypeMessageVideoChatScheduled = "messageVideoChatScheduled" - TypeMessageVideoChatStarted = "messageVideoChatStarted" - TypeMessageVideoChatEnded = "messageVideoChatEnded" - TypeMessageInviteVideoChatParticipants = "messageInviteVideoChatParticipants" - TypeMessageBasicGroupChatCreate = "messageBasicGroupChatCreate" - TypeMessageSupergroupChatCreate = "messageSupergroupChatCreate" - TypeMessageChatChangeTitle = "messageChatChangeTitle" - TypeMessageChatChangePhoto = "messageChatChangePhoto" - TypeMessageChatDeletePhoto = "messageChatDeletePhoto" - TypeMessageChatAddMembers = "messageChatAddMembers" - TypeMessageChatJoinByLink = "messageChatJoinByLink" - TypeMessageChatJoinByRequest = "messageChatJoinByRequest" - TypeMessageChatDeleteMember = "messageChatDeleteMember" - TypeMessageChatUpgradeTo = "messageChatUpgradeTo" - TypeMessageChatUpgradeFrom = "messageChatUpgradeFrom" - TypeMessagePinMessage = "messagePinMessage" - TypeMessageScreenshotTaken = "messageScreenshotTaken" - TypeMessageChatSetTheme = "messageChatSetTheme" - TypeMessageChatSetTtl = "messageChatSetTtl" - TypeMessageCustomServiceAction = "messageCustomServiceAction" - TypeMessageGameScore = "messageGameScore" - TypeMessagePaymentSuccessful = "messagePaymentSuccessful" - TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" - TypeMessageContactRegistered = "messageContactRegistered" - TypeMessageWebsiteConnected = "messageWebsiteConnected" - TypeMessagePassportDataSent = "messagePassportDataSent" - TypeMessagePassportDataReceived = "messagePassportDataReceived" - TypeMessageProximityAlertTriggered = "messageProximityAlertTriggered" - TypeMessageUnsupported = "messageUnsupported" - TypeTextEntityTypeMention = "textEntityTypeMention" - TypeTextEntityTypeHashtag = "textEntityTypeHashtag" - TypeTextEntityTypeCashtag = "textEntityTypeCashtag" - TypeTextEntityTypeBotCommand = "textEntityTypeBotCommand" - TypeTextEntityTypeUrl = "textEntityTypeUrl" - TypeTextEntityTypeEmailAddress = "textEntityTypeEmailAddress" - TypeTextEntityTypePhoneNumber = "textEntityTypePhoneNumber" - TypeTextEntityTypeBankCardNumber = "textEntityTypeBankCardNumber" - TypeTextEntityTypeBold = "textEntityTypeBold" - TypeTextEntityTypeItalic = "textEntityTypeItalic" - TypeTextEntityTypeUnderline = "textEntityTypeUnderline" - TypeTextEntityTypeStrikethrough = "textEntityTypeStrikethrough" - TypeTextEntityTypeCode = "textEntityTypeCode" - TypeTextEntityTypePre = "textEntityTypePre" - TypeTextEntityTypePreCode = "textEntityTypePreCode" - TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl" - TypeTextEntityTypeMentionName = "textEntityTypeMentionName" - TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp" - TypeInputThumbnail = "inputThumbnail" - TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate" - TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline" - TypeMessageSendOptions = "messageSendOptions" - TypeMessageCopyOptions = "messageCopyOptions" - TypeInputMessageText = "inputMessageText" - TypeInputMessageAnimation = "inputMessageAnimation" - TypeInputMessageAudio = "inputMessageAudio" - TypeInputMessageDocument = "inputMessageDocument" - TypeInputMessagePhoto = "inputMessagePhoto" - TypeInputMessageSticker = "inputMessageSticker" - TypeInputMessageVideo = "inputMessageVideo" - TypeInputMessageVideoNote = "inputMessageVideoNote" - TypeInputMessageVoiceNote = "inputMessageVoiceNote" - TypeInputMessageLocation = "inputMessageLocation" - TypeInputMessageVenue = "inputMessageVenue" - TypeInputMessageContact = "inputMessageContact" - TypeInputMessageDice = "inputMessageDice" - TypeInputMessageGame = "inputMessageGame" - TypeInputMessageInvoice = "inputMessageInvoice" - TypeInputMessagePoll = "inputMessagePoll" - TypeInputMessageForwarded = "inputMessageForwarded" - TypeSearchMessagesFilterEmpty = "searchMessagesFilterEmpty" - TypeSearchMessagesFilterAnimation = "searchMessagesFilterAnimation" - TypeSearchMessagesFilterAudio = "searchMessagesFilterAudio" - TypeSearchMessagesFilterDocument = "searchMessagesFilterDocument" - TypeSearchMessagesFilterPhoto = "searchMessagesFilterPhoto" - TypeSearchMessagesFilterVideo = "searchMessagesFilterVideo" - TypeSearchMessagesFilterVoiceNote = "searchMessagesFilterVoiceNote" - TypeSearchMessagesFilterPhotoAndVideo = "searchMessagesFilterPhotoAndVideo" - TypeSearchMessagesFilterUrl = "searchMessagesFilterUrl" - TypeSearchMessagesFilterChatPhoto = "searchMessagesFilterChatPhoto" - TypeSearchMessagesFilterVideoNote = "searchMessagesFilterVideoNote" - TypeSearchMessagesFilterVoiceAndVideoNote = "searchMessagesFilterVoiceAndVideoNote" - TypeSearchMessagesFilterMention = "searchMessagesFilterMention" - TypeSearchMessagesFilterUnreadMention = "searchMessagesFilterUnreadMention" - TypeSearchMessagesFilterFailedToSend = "searchMessagesFilterFailedToSend" - TypeSearchMessagesFilterPinned = "searchMessagesFilterPinned" - TypeChatActionTyping = "chatActionTyping" - TypeChatActionRecordingVideo = "chatActionRecordingVideo" - TypeChatActionUploadingVideo = "chatActionUploadingVideo" - TypeChatActionRecordingVoiceNote = "chatActionRecordingVoiceNote" - TypeChatActionUploadingVoiceNote = "chatActionUploadingVoiceNote" - TypeChatActionUploadingPhoto = "chatActionUploadingPhoto" - TypeChatActionUploadingDocument = "chatActionUploadingDocument" - TypeChatActionChoosingSticker = "chatActionChoosingSticker" - TypeChatActionChoosingLocation = "chatActionChoosingLocation" - TypeChatActionChoosingContact = "chatActionChoosingContact" - TypeChatActionStartPlayingGame = "chatActionStartPlayingGame" - TypeChatActionRecordingVideoNote = "chatActionRecordingVideoNote" - TypeChatActionUploadingVideoNote = "chatActionUploadingVideoNote" - TypeChatActionWatchingAnimations = "chatActionWatchingAnimations" - TypeChatActionCancel = "chatActionCancel" - TypeUserStatusEmpty = "userStatusEmpty" - TypeUserStatusOnline = "userStatusOnline" - TypeUserStatusOffline = "userStatusOffline" - TypeUserStatusRecently = "userStatusRecently" - TypeUserStatusLastWeek = "userStatusLastWeek" - TypeUserStatusLastMonth = "userStatusLastMonth" - TypeStickers = "stickers" - TypeEmojis = "emojis" - TypeStickerSet = "stickerSet" - TypeStickerSetInfo = "stickerSetInfo" - TypeStickerSets = "stickerSets" - TypeCallDiscardReasonEmpty = "callDiscardReasonEmpty" - TypeCallDiscardReasonMissed = "callDiscardReasonMissed" - TypeCallDiscardReasonDeclined = "callDiscardReasonDeclined" - TypeCallDiscardReasonDisconnected = "callDiscardReasonDisconnected" - TypeCallDiscardReasonHungUp = "callDiscardReasonHungUp" - TypeCallProtocol = "callProtocol" - TypeCallServerTypeTelegramReflector = "callServerTypeTelegramReflector" - TypeCallServerTypeWebrtc = "callServerTypeWebrtc" - TypeCallServer = "callServer" - TypeCallId = "callId" - TypeGroupCallId = "groupCallId" - TypeCallStatePending = "callStatePending" - TypeCallStateExchangingKeys = "callStateExchangingKeys" - TypeCallStateReady = "callStateReady" - TypeCallStateHangingUp = "callStateHangingUp" - TypeCallStateDiscarded = "callStateDiscarded" - TypeCallStateError = "callStateError" - TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" - TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" - TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" - TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker" - TypeGroupCall = "groupCall" - TypeGroupCallVideoSourceGroup = "groupCallVideoSourceGroup" - TypeGroupCallParticipantVideoInfo = "groupCallParticipantVideoInfo" - TypeGroupCallParticipant = "groupCallParticipant" - TypeCallProblemEcho = "callProblemEcho" - TypeCallProblemNoise = "callProblemNoise" - TypeCallProblemInterruptions = "callProblemInterruptions" - TypeCallProblemDistortedSpeech = "callProblemDistortedSpeech" - TypeCallProblemSilentLocal = "callProblemSilentLocal" - TypeCallProblemSilentRemote = "callProblemSilentRemote" - TypeCallProblemDropped = "callProblemDropped" - TypeCallProblemDistortedVideo = "callProblemDistortedVideo" - TypeCallProblemPixelatedVideo = "callProblemPixelatedVideo" - TypeCall = "call" - TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings" - TypeAnimations = "animations" - TypeDiceStickersRegular = "diceStickersRegular" - TypeDiceStickersSlotMachine = "diceStickersSlotMachine" - TypeImportedContacts = "importedContacts" - TypeHttpUrl = "httpUrl" - TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation" - TypeInputInlineQueryResultArticle = "inputInlineQueryResultArticle" - TypeInputInlineQueryResultAudio = "inputInlineQueryResultAudio" - TypeInputInlineQueryResultContact = "inputInlineQueryResultContact" - TypeInputInlineQueryResultDocument = "inputInlineQueryResultDocument" - TypeInputInlineQueryResultGame = "inputInlineQueryResultGame" - TypeInputInlineQueryResultLocation = "inputInlineQueryResultLocation" - TypeInputInlineQueryResultPhoto = "inputInlineQueryResultPhoto" - TypeInputInlineQueryResultSticker = "inputInlineQueryResultSticker" - TypeInputInlineQueryResultVenue = "inputInlineQueryResultVenue" - TypeInputInlineQueryResultVideo = "inputInlineQueryResultVideo" - TypeInputInlineQueryResultVoiceNote = "inputInlineQueryResultVoiceNote" - TypeInlineQueryResultArticle = "inlineQueryResultArticle" - TypeInlineQueryResultContact = "inlineQueryResultContact" - TypeInlineQueryResultLocation = "inlineQueryResultLocation" - TypeInlineQueryResultVenue = "inlineQueryResultVenue" - TypeInlineQueryResultGame = "inlineQueryResultGame" - TypeInlineQueryResultAnimation = "inlineQueryResultAnimation" - TypeInlineQueryResultAudio = "inlineQueryResultAudio" - TypeInlineQueryResultDocument = "inlineQueryResultDocument" - TypeInlineQueryResultPhoto = "inlineQueryResultPhoto" - TypeInlineQueryResultSticker = "inlineQueryResultSticker" - TypeInlineQueryResultVideo = "inlineQueryResultVideo" - TypeInlineQueryResultVoiceNote = "inlineQueryResultVoiceNote" - TypeInlineQueryResults = "inlineQueryResults" - TypeCallbackQueryPayloadData = "callbackQueryPayloadData" - TypeCallbackQueryPayloadDataWithPassword = "callbackQueryPayloadDataWithPassword" - TypeCallbackQueryPayloadGame = "callbackQueryPayloadGame" - TypeCallbackQueryAnswer = "callbackQueryAnswer" - TypeCustomRequestResult = "customRequestResult" - TypeGameHighScore = "gameHighScore" - TypeGameHighScores = "gameHighScores" - TypeChatEventMessageEdited = "chatEventMessageEdited" - TypeChatEventMessageDeleted = "chatEventMessageDeleted" - TypeChatEventPollStopped = "chatEventPollStopped" - TypeChatEventMessagePinned = "chatEventMessagePinned" - TypeChatEventMessageUnpinned = "chatEventMessageUnpinned" - TypeChatEventMemberJoined = "chatEventMemberJoined" - TypeChatEventMemberJoinedByInviteLink = "chatEventMemberJoinedByInviteLink" - TypeChatEventMemberJoinedByRequest = "chatEventMemberJoinedByRequest" - TypeChatEventMemberLeft = "chatEventMemberLeft" - TypeChatEventMemberInvited = "chatEventMemberInvited" - TypeChatEventMemberPromoted = "chatEventMemberPromoted" - TypeChatEventMemberRestricted = "chatEventMemberRestricted" - TypeChatEventTitleChanged = "chatEventTitleChanged" - TypeChatEventPermissionsChanged = "chatEventPermissionsChanged" - TypeChatEventDescriptionChanged = "chatEventDescriptionChanged" - TypeChatEventUsernameChanged = "chatEventUsernameChanged" - TypeChatEventPhotoChanged = "chatEventPhotoChanged" - TypeChatEventInvitesToggled = "chatEventInvitesToggled" - TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" - TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" - TypeChatEventMessageTtlChanged = "chatEventMessageTtlChanged" - TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" - TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" - TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" - TypeChatEventLocationChanged = "chatEventLocationChanged" - TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" - TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited" - TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked" - TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted" - TypeChatEventVideoChatCreated = "chatEventVideoChatCreated" - TypeChatEventVideoChatEnded = "chatEventVideoChatEnded" - TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled" - TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged" - TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" - TypeChatEvent = "chatEvent" - TypeChatEvents = "chatEvents" - TypeChatEventLogFilters = "chatEventLogFilters" - TypeLanguagePackStringValueOrdinary = "languagePackStringValueOrdinary" - TypeLanguagePackStringValuePluralized = "languagePackStringValuePluralized" - TypeLanguagePackStringValueDeleted = "languagePackStringValueDeleted" - TypeLanguagePackString = "languagePackString" - TypeLanguagePackStrings = "languagePackStrings" - TypeLanguagePackInfo = "languagePackInfo" - TypeLocalizationTargetInfo = "localizationTargetInfo" - TypeDeviceTokenFirebaseCloudMessaging = "deviceTokenFirebaseCloudMessaging" - TypeDeviceTokenApplePush = "deviceTokenApplePush" - TypeDeviceTokenApplePushVoIP = "deviceTokenApplePushVoIP" - TypeDeviceTokenWindowsPush = "deviceTokenWindowsPush" - TypeDeviceTokenMicrosoftPush = "deviceTokenMicrosoftPush" - TypeDeviceTokenMicrosoftPushVoIP = "deviceTokenMicrosoftPushVoIP" - TypeDeviceTokenWebPush = "deviceTokenWebPush" - TypeDeviceTokenSimplePush = "deviceTokenSimplePush" - TypeDeviceTokenUbuntuPush = "deviceTokenUbuntuPush" - TypeDeviceTokenBlackBerryPush = "deviceTokenBlackBerryPush" - TypeDeviceTokenTizenPush = "deviceTokenTizenPush" - TypePushReceiverId = "pushReceiverId" - TypeBackgroundFillSolid = "backgroundFillSolid" - TypeBackgroundFillGradient = "backgroundFillGradient" - TypeBackgroundFillFreeformGradient = "backgroundFillFreeformGradient" - TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper" - TypeBackgroundTypePattern = "backgroundTypePattern" - TypeBackgroundTypeFill = "backgroundTypeFill" - TypeBackground = "background" - TypeBackgrounds = "backgrounds" - TypeInputBackgroundLocal = "inputBackgroundLocal" - TypeInputBackgroundRemote = "inputBackgroundRemote" - TypeThemeSettings = "themeSettings" - TypeChatTheme = "chatTheme" - TypeHashtags = "hashtags" - TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" - TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" - TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" - TypeCanTransferOwnershipResultSessionTooFresh = "canTransferOwnershipResultSessionTooFresh" - TypeCheckChatUsernameResultOk = "checkChatUsernameResultOk" - TypeCheckChatUsernameResultUsernameInvalid = "checkChatUsernameResultUsernameInvalid" - TypeCheckChatUsernameResultUsernameOccupied = "checkChatUsernameResultUsernameOccupied" - TypeCheckChatUsernameResultPublicChatsTooMuch = "checkChatUsernameResultPublicChatsTooMuch" - TypeCheckChatUsernameResultPublicGroupsUnavailable = "checkChatUsernameResultPublicGroupsUnavailable" - TypeCheckStickerSetNameResultOk = "checkStickerSetNameResultOk" - TypeCheckStickerSetNameResultNameInvalid = "checkStickerSetNameResultNameInvalid" - TypeCheckStickerSetNameResultNameOccupied = "checkStickerSetNameResultNameOccupied" - TypeResetPasswordResultOk = "resetPasswordResultOk" - TypeResetPasswordResultPending = "resetPasswordResultPending" - TypeResetPasswordResultDeclined = "resetPasswordResultDeclined" - TypeMessageFileTypePrivate = "messageFileTypePrivate" - TypeMessageFileTypeGroup = "messageFileTypeGroup" - TypeMessageFileTypeUnknown = "messageFileTypeUnknown" - TypePushMessageContentHidden = "pushMessageContentHidden" - TypePushMessageContentAnimation = "pushMessageContentAnimation" - TypePushMessageContentAudio = "pushMessageContentAudio" - TypePushMessageContentContact = "pushMessageContentContact" - TypePushMessageContentContactRegistered = "pushMessageContentContactRegistered" - TypePushMessageContentDocument = "pushMessageContentDocument" - TypePushMessageContentGame = "pushMessageContentGame" - TypePushMessageContentGameScore = "pushMessageContentGameScore" - TypePushMessageContentInvoice = "pushMessageContentInvoice" - TypePushMessageContentLocation = "pushMessageContentLocation" - TypePushMessageContentPhoto = "pushMessageContentPhoto" - TypePushMessageContentPoll = "pushMessageContentPoll" - TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken" - TypePushMessageContentSticker = "pushMessageContentSticker" - TypePushMessageContentText = "pushMessageContentText" - TypePushMessageContentVideo = "pushMessageContentVideo" - TypePushMessageContentVideoNote = "pushMessageContentVideoNote" - TypePushMessageContentVoiceNote = "pushMessageContentVoiceNote" - TypePushMessageContentBasicGroupChatCreate = "pushMessageContentBasicGroupChatCreate" - TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers" - TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto" - TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle" - TypePushMessageContentChatSetTheme = "pushMessageContentChatSetTheme" - TypePushMessageContentChatDeleteMember = "pushMessageContentChatDeleteMember" - TypePushMessageContentChatJoinByLink = "pushMessageContentChatJoinByLink" - TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest" - TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards" - TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum" - TypeNotificationTypeNewMessage = "notificationTypeNewMessage" - TypeNotificationTypeNewSecretChat = "notificationTypeNewSecretChat" - TypeNotificationTypeNewCall = "notificationTypeNewCall" - TypeNotificationTypeNewPushMessage = "notificationTypeNewPushMessage" - TypeNotificationGroupTypeMessages = "notificationGroupTypeMessages" - TypeNotificationGroupTypeMentions = "notificationGroupTypeMentions" - TypeNotificationGroupTypeSecretChat = "notificationGroupTypeSecretChat" - TypeNotificationGroupTypeCalls = "notificationGroupTypeCalls" - TypeNotification = "notification" - TypeNotificationGroup = "notificationGroup" - TypeOptionValueBoolean = "optionValueBoolean" - TypeOptionValueEmpty = "optionValueEmpty" - TypeOptionValueInteger = "optionValueInteger" - TypeOptionValueString = "optionValueString" - TypeJsonObjectMember = "jsonObjectMember" - TypeJsonValueNull = "jsonValueNull" - TypeJsonValueBoolean = "jsonValueBoolean" - TypeJsonValueNumber = "jsonValueNumber" - TypeJsonValueString = "jsonValueString" - TypeJsonValueArray = "jsonValueArray" - TypeJsonValueObject = "jsonValueObject" - TypeUserPrivacySettingRuleAllowAll = "userPrivacySettingRuleAllowAll" - TypeUserPrivacySettingRuleAllowContacts = "userPrivacySettingRuleAllowContacts" - TypeUserPrivacySettingRuleAllowUsers = "userPrivacySettingRuleAllowUsers" - TypeUserPrivacySettingRuleAllowChatMembers = "userPrivacySettingRuleAllowChatMembers" - TypeUserPrivacySettingRuleRestrictAll = "userPrivacySettingRuleRestrictAll" - TypeUserPrivacySettingRuleRestrictContacts = "userPrivacySettingRuleRestrictContacts" - TypeUserPrivacySettingRuleRestrictUsers = "userPrivacySettingRuleRestrictUsers" - TypeUserPrivacySettingRuleRestrictChatMembers = "userPrivacySettingRuleRestrictChatMembers" - TypeUserPrivacySettingRules = "userPrivacySettingRules" - TypeUserPrivacySettingShowStatus = "userPrivacySettingShowStatus" - TypeUserPrivacySettingShowProfilePhoto = "userPrivacySettingShowProfilePhoto" - TypeUserPrivacySettingShowLinkInForwardedMessages = "userPrivacySettingShowLinkInForwardedMessages" - TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" - TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" - TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" - TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" - TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber" - TypeAccountTtl = "accountTtl" - TypeSession = "session" - TypeSessions = "sessions" - TypeConnectedWebsite = "connectedWebsite" - TypeConnectedWebsites = "connectedWebsites" - TypeChatReportReasonSpam = "chatReportReasonSpam" - TypeChatReportReasonViolence = "chatReportReasonViolence" - TypeChatReportReasonPornography = "chatReportReasonPornography" - TypeChatReportReasonChildAbuse = "chatReportReasonChildAbuse" - TypeChatReportReasonCopyright = "chatReportReasonCopyright" - TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation" - TypeChatReportReasonFake = "chatReportReasonFake" - TypeChatReportReasonCustom = "chatReportReasonCustom" - TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" - TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" - TypeInternalLinkTypeBackground = "internalLinkTypeBackground" - TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" - TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" - TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" - TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" - TypeInternalLinkTypeFilterSettings = "internalLinkTypeFilterSettings" - TypeInternalLinkTypeGame = "internalLinkTypeGame" - TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" - TypeInternalLinkTypeMessage = "internalLinkTypeMessage" - TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" - TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" - TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" - TypeInternalLinkTypeProxy = "internalLinkTypeProxy" - TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" - TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" - TypeInternalLinkTypeSettings = "internalLinkTypeSettings" - TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" - TypeInternalLinkTypeTheme = "internalLinkTypeTheme" - TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" - TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" - TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" - TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat" - TypeMessageLink = "messageLink" - TypeMessageLinkInfo = "messageLinkInfo" - TypeFilePart = "filePart" - TypeFileTypeNone = "fileTypeNone" - TypeFileTypeAnimation = "fileTypeAnimation" - TypeFileTypeAudio = "fileTypeAudio" - TypeFileTypeDocument = "fileTypeDocument" - TypeFileTypePhoto = "fileTypePhoto" - TypeFileTypeProfilePhoto = "fileTypeProfilePhoto" - TypeFileTypeSecret = "fileTypeSecret" - TypeFileTypeSecretThumbnail = "fileTypeSecretThumbnail" - TypeFileTypeSecure = "fileTypeSecure" - TypeFileTypeSticker = "fileTypeSticker" - TypeFileTypeThumbnail = "fileTypeThumbnail" - TypeFileTypeUnknown = "fileTypeUnknown" - TypeFileTypeVideo = "fileTypeVideo" - TypeFileTypeVideoNote = "fileTypeVideoNote" - TypeFileTypeVoiceNote = "fileTypeVoiceNote" - TypeFileTypeWallpaper = "fileTypeWallpaper" - TypeStorageStatisticsByFileType = "storageStatisticsByFileType" - TypeStorageStatisticsByChat = "storageStatisticsByChat" - TypeStorageStatistics = "storageStatistics" - TypeStorageStatisticsFast = "storageStatisticsFast" - TypeDatabaseStatistics = "databaseStatistics" - TypeNetworkTypeNone = "networkTypeNone" - TypeNetworkTypeMobile = "networkTypeMobile" - TypeNetworkTypeMobileRoaming = "networkTypeMobileRoaming" - TypeNetworkTypeWiFi = "networkTypeWiFi" - TypeNetworkTypeOther = "networkTypeOther" - TypeNetworkStatisticsEntryFile = "networkStatisticsEntryFile" - TypeNetworkStatisticsEntryCall = "networkStatisticsEntryCall" - TypeNetworkStatistics = "networkStatistics" - TypeAutoDownloadSettings = "autoDownloadSettings" - TypeAutoDownloadSettingsPresets = "autoDownloadSettingsPresets" - TypeConnectionStateWaitingForNetwork = "connectionStateWaitingForNetwork" - TypeConnectionStateConnectingToProxy = "connectionStateConnectingToProxy" - TypeConnectionStateConnecting = "connectionStateConnecting" - TypeConnectionStateUpdating = "connectionStateUpdating" - TypeConnectionStateReady = "connectionStateReady" - TypeTopChatCategoryUsers = "topChatCategoryUsers" - TypeTopChatCategoryBots = "topChatCategoryBots" - TypeTopChatCategoryGroups = "topChatCategoryGroups" - TypeTopChatCategoryChannels = "topChatCategoryChannels" - TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots" - TypeTopChatCategoryCalls = "topChatCategoryCalls" - TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats" - TypeTMeUrlTypeUser = "tMeUrlTypeUser" - TypeTMeUrlTypeSupergroup = "tMeUrlTypeSupergroup" - TypeTMeUrlTypeChatInvite = "tMeUrlTypeChatInvite" - TypeTMeUrlTypeStickerSet = "tMeUrlTypeStickerSet" - TypeTMeUrl = "tMeUrl" - TypeTMeUrls = "tMeUrls" - TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats" - TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword" - TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber" - TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint" - TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup" - TypeSuggestedActionSetPassword = "suggestedActionSetPassword" - TypeCount = "count" - TypeText = "text" - TypeSeconds = "seconds" - TypeDeepLinkInfo = "deepLinkInfo" - TypeTextParseModeMarkdown = "textParseModeMarkdown" - TypeTextParseModeHTML = "textParseModeHTML" - TypeProxyTypeSocks5 = "proxyTypeSocks5" - TypeProxyTypeHttp = "proxyTypeHttp" - TypeProxyTypeMtproto = "proxyTypeMtproto" - TypeProxy = "proxy" - TypeProxies = "proxies" - TypeInputStickerStatic = "inputStickerStatic" - TypeInputStickerAnimated = "inputStickerAnimated" - TypeDateRange = "dateRange" - TypeStatisticalValue = "statisticalValue" - TypeStatisticalGraphData = "statisticalGraphData" - TypeStatisticalGraphAsync = "statisticalGraphAsync" - TypeStatisticalGraphError = "statisticalGraphError" - TypeChatStatisticsMessageInteractionInfo = "chatStatisticsMessageInteractionInfo" - TypeChatStatisticsMessageSenderInfo = "chatStatisticsMessageSenderInfo" - TypeChatStatisticsAdministratorActionsInfo = "chatStatisticsAdministratorActionsInfo" - TypeChatStatisticsInviterInfo = "chatStatisticsInviterInfo" - TypeChatStatisticsSupergroup = "chatStatisticsSupergroup" - TypeChatStatisticsChannel = "chatStatisticsChannel" - TypeMessageStatistics = "messageStatistics" - TypePoint = "point" - TypeVectorPathCommandLine = "vectorPathCommandLine" - TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" - TypeBotCommandScopeDefault = "botCommandScopeDefault" - TypeBotCommandScopeAllPrivateChats = "botCommandScopeAllPrivateChats" - TypeBotCommandScopeAllGroupChats = "botCommandScopeAllGroupChats" - TypeBotCommandScopeAllChatAdministrators = "botCommandScopeAllChatAdministrators" - TypeBotCommandScopeChat = "botCommandScopeChat" - TypeBotCommandScopeChatAdministrators = "botCommandScopeChatAdministrators" - TypeBotCommandScopeChatMember = "botCommandScopeChatMember" - TypeUpdateAuthorizationState = "updateAuthorizationState" - TypeUpdateNewMessage = "updateNewMessage" - TypeUpdateMessageSendAcknowledged = "updateMessageSendAcknowledged" - TypeUpdateMessageSendSucceeded = "updateMessageSendSucceeded" - TypeUpdateMessageSendFailed = "updateMessageSendFailed" - TypeUpdateMessageContent = "updateMessageContent" - TypeUpdateMessageEdited = "updateMessageEdited" - TypeUpdateMessageIsPinned = "updateMessageIsPinned" - TypeUpdateMessageInteractionInfo = "updateMessageInteractionInfo" - TypeUpdateMessageContentOpened = "updateMessageContentOpened" - TypeUpdateMessageMentionRead = "updateMessageMentionRead" - TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed" - TypeUpdateNewChat = "updateNewChat" - TypeUpdateChatTitle = "updateChatTitle" - TypeUpdateChatPhoto = "updateChatPhoto" - TypeUpdateChatPermissions = "updateChatPermissions" - TypeUpdateChatLastMessage = "updateChatLastMessage" - TypeUpdateChatPosition = "updateChatPosition" - TypeUpdateChatReadInbox = "updateChatReadInbox" - TypeUpdateChatReadOutbox = "updateChatReadOutbox" - TypeUpdateChatActionBar = "updateChatActionBar" - TypeUpdateChatDraftMessage = "updateChatDraftMessage" - TypeUpdateChatMessageSender = "updateChatMessageSender" - TypeUpdateChatMessageTtl = "updateChatMessageTtl" - TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" - TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests" - TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" - TypeUpdateChatTheme = "updateChatTheme" - TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" - TypeUpdateChatVideoChat = "updateChatVideoChat" - TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" - TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" - TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" - TypeUpdateChatIsBlocked = "updateChatIsBlocked" - TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" - TypeUpdateChatFilters = "updateChatFilters" - TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" - TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" - TypeUpdateNotification = "updateNotification" - TypeUpdateNotificationGroup = "updateNotificationGroup" - TypeUpdateActiveNotifications = "updateActiveNotifications" - TypeUpdateHavePendingNotifications = "updateHavePendingNotifications" - TypeUpdateDeleteMessages = "updateDeleteMessages" - TypeUpdateChatAction = "updateChatAction" - TypeUpdateUserStatus = "updateUserStatus" - TypeUpdateUser = "updateUser" - TypeUpdateBasicGroup = "updateBasicGroup" - TypeUpdateSupergroup = "updateSupergroup" - TypeUpdateSecretChat = "updateSecretChat" - TypeUpdateUserFullInfo = "updateUserFullInfo" - TypeUpdateBasicGroupFullInfo = "updateBasicGroupFullInfo" - TypeUpdateSupergroupFullInfo = "updateSupergroupFullInfo" - TypeUpdateServiceNotification = "updateServiceNotification" - TypeUpdateFile = "updateFile" - TypeUpdateFileGenerationStart = "updateFileGenerationStart" - TypeUpdateFileGenerationStop = "updateFileGenerationStop" - TypeUpdateCall = "updateCall" - TypeUpdateGroupCall = "updateGroupCall" - TypeUpdateGroupCallParticipant = "updateGroupCallParticipant" - TypeUpdateNewCallSignalingData = "updateNewCallSignalingData" - TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" - TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" - TypeUpdateUnreadChatCount = "updateUnreadChatCount" - TypeUpdateOption = "updateOption" - TypeUpdateStickerSet = "updateStickerSet" - TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" - TypeUpdateTrendingStickerSets = "updateTrendingStickerSets" - TypeUpdateRecentStickers = "updateRecentStickers" - TypeUpdateFavoriteStickers = "updateFavoriteStickers" - TypeUpdateSavedAnimations = "updateSavedAnimations" - TypeUpdateSelectedBackground = "updateSelectedBackground" - TypeUpdateChatThemes = "updateChatThemes" - TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" - TypeUpdateConnectionState = "updateConnectionState" - TypeUpdateTermsOfService = "updateTermsOfService" - TypeUpdateUsersNearby = "updateUsersNearby" - TypeUpdateDiceEmojis = "updateDiceEmojis" - TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" - TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" - TypeUpdateSuggestedActions = "updateSuggestedActions" - TypeUpdateNewInlineQuery = "updateNewInlineQuery" - TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult" - TypeUpdateNewCallbackQuery = "updateNewCallbackQuery" - TypeUpdateNewInlineCallbackQuery = "updateNewInlineCallbackQuery" - TypeUpdateNewShippingQuery = "updateNewShippingQuery" - TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery" - TypeUpdateNewCustomEvent = "updateNewCustomEvent" - TypeUpdateNewCustomQuery = "updateNewCustomQuery" - TypeUpdatePoll = "updatePoll" - TypeUpdatePollAnswer = "updatePollAnswer" - TypeUpdateChatMember = "updateChatMember" - TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest" - TypeUpdates = "updates" - TypeLogStreamDefault = "logStreamDefault" - TypeLogStreamFile = "logStreamFile" - TypeLogStreamEmpty = "logStreamEmpty" - TypeLogVerbosityLevel = "logVerbosityLevel" - TypeLogTags = "logTags" - TypeTestInt = "testInt" - TypeTestString = "testString" - TypeTestBytes = "testBytes" - TypeTestVectorInt = "testVectorInt" - TypeTestVectorIntObject = "testVectorIntObject" - TypeTestVectorString = "testVectorString" - TypeTestVectorStringObject = "testVectorStringObject" + TypeError = "error" + TypeOk = "ok" + TypeAuthenticationCodeTypeTelegramMessage = "authenticationCodeTypeTelegramMessage" + TypeAuthenticationCodeTypeSms = "authenticationCodeTypeSms" + TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall" + TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall" + TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall" + TypeAuthenticationCodeTypeFragment = "authenticationCodeTypeFragment" + TypeAuthenticationCodeTypeFirebaseAndroid = "authenticationCodeTypeFirebaseAndroid" + TypeAuthenticationCodeTypeFirebaseIos = "authenticationCodeTypeFirebaseIos" + TypeAuthenticationCodeInfo = "authenticationCodeInfo" + TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo" + TypeEmailAddressAuthenticationCode = "emailAddressAuthenticationCode" + TypeEmailAddressAuthenticationAppleId = "emailAddressAuthenticationAppleId" + TypeEmailAddressAuthenticationGoogleId = "emailAddressAuthenticationGoogleId" + TypeEmailAddressResetStateAvailable = "emailAddressResetStateAvailable" + TypeEmailAddressResetStatePending = "emailAddressResetStatePending" + TypeTextEntity = "textEntity" + TypeTextEntities = "textEntities" + TypeFormattedText = "formattedText" + TypeTermsOfService = "termsOfService" + TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" + TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" + TypeAuthorizationStateWaitEmailAddress = "authorizationStateWaitEmailAddress" + TypeAuthorizationStateWaitEmailCode = "authorizationStateWaitEmailCode" + TypeAuthorizationStateWaitCode = "authorizationStateWaitCode" + TypeAuthorizationStateWaitOtherDeviceConfirmation = "authorizationStateWaitOtherDeviceConfirmation" + TypeAuthorizationStateWaitRegistration = "authorizationStateWaitRegistration" + TypeAuthorizationStateWaitPassword = "authorizationStateWaitPassword" + TypeAuthorizationStateReady = "authorizationStateReady" + TypeAuthorizationStateLoggingOut = "authorizationStateLoggingOut" + TypeAuthorizationStateClosing = "authorizationStateClosing" + TypeAuthorizationStateClosed = "authorizationStateClosed" + TypePasswordState = "passwordState" + TypeRecoveryEmailAddress = "recoveryEmailAddress" + TypeTemporaryPasswordState = "temporaryPasswordState" + TypeLocalFile = "localFile" + TypeRemoteFile = "remoteFile" + TypeFile = "file" + TypeInputFileId = "inputFileId" + TypeInputFileRemote = "inputFileRemote" + TypeInputFileLocal = "inputFileLocal" + TypeInputFileGenerated = "inputFileGenerated" + TypePhotoSize = "photoSize" + TypeMinithumbnail = "minithumbnail" + TypeThumbnailFormatJpeg = "thumbnailFormatJpeg" + TypeThumbnailFormatGif = "thumbnailFormatGif" + TypeThumbnailFormatMpeg4 = "thumbnailFormatMpeg4" + TypeThumbnailFormatPng = "thumbnailFormatPng" + TypeThumbnailFormatTgs = "thumbnailFormatTgs" + TypeThumbnailFormatWebm = "thumbnailFormatWebm" + TypeThumbnailFormatWebp = "thumbnailFormatWebp" + TypeThumbnail = "thumbnail" + TypeMaskPointForehead = "maskPointForehead" + TypeMaskPointEyes = "maskPointEyes" + TypeMaskPointMouth = "maskPointMouth" + TypeMaskPointChin = "maskPointChin" + TypeMaskPosition = "maskPosition" + TypeStickerFormatWebp = "stickerFormatWebp" + TypeStickerFormatTgs = "stickerFormatTgs" + TypeStickerFormatWebm = "stickerFormatWebm" + TypeStickerTypeRegular = "stickerTypeRegular" + TypeStickerTypeMask = "stickerTypeMask" + TypeStickerTypeCustomEmoji = "stickerTypeCustomEmoji" + TypeStickerFullTypeRegular = "stickerFullTypeRegular" + TypeStickerFullTypeMask = "stickerFullTypeMask" + TypeStickerFullTypeCustomEmoji = "stickerFullTypeCustomEmoji" + TypeClosedVectorPath = "closedVectorPath" + TypePollOption = "pollOption" + TypePollTypeRegular = "pollTypeRegular" + TypePollTypeQuiz = "pollTypeQuiz" + TypeAnimation = "animation" + TypeAudio = "audio" + TypeDocument = "document" + TypePhoto = "photo" + TypeSticker = "sticker" + TypeVideo = "video" + TypeVideoNote = "videoNote" + TypeVoiceNote = "voiceNote" + TypeAnimatedEmoji = "animatedEmoji" + TypeContact = "contact" + TypeLocation = "location" + TypeVenue = "venue" + TypeGame = "game" + TypeWebApp = "webApp" + TypePoll = "poll" + TypeBackground = "background" + TypeBackgrounds = "backgrounds" + TypeChatBackground = "chatBackground" + TypeProfilePhoto = "profilePhoto" + TypeChatPhotoInfo = "chatPhotoInfo" + TypeUserTypeRegular = "userTypeRegular" + TypeUserTypeDeleted = "userTypeDeleted" + TypeUserTypeBot = "userTypeBot" + TypeUserTypeUnknown = "userTypeUnknown" + TypeBotCommand = "botCommand" + TypeBotCommands = "botCommands" + TypeBotMenuButton = "botMenuButton" + TypeChatLocation = "chatLocation" + TypeChatPhotoStickerTypeRegularOrMask = "chatPhotoStickerTypeRegularOrMask" + TypeChatPhotoStickerTypeCustomEmoji = "chatPhotoStickerTypeCustomEmoji" + TypeChatPhotoSticker = "chatPhotoSticker" + TypeAnimatedChatPhoto = "animatedChatPhoto" + TypeChatPhoto = "chatPhoto" + TypeChatPhotos = "chatPhotos" + TypeInputChatPhotoPrevious = "inputChatPhotoPrevious" + TypeInputChatPhotoStatic = "inputChatPhotoStatic" + TypeInputChatPhotoAnimation = "inputChatPhotoAnimation" + TypeInputChatPhotoSticker = "inputChatPhotoSticker" + TypeChatPermissions = "chatPermissions" + TypeChatAdministratorRights = "chatAdministratorRights" + TypePremiumPaymentOption = "premiumPaymentOption" + TypePremiumStatePaymentOption = "premiumStatePaymentOption" + TypePremiumGiftCodePaymentOption = "premiumGiftCodePaymentOption" + TypePremiumGiftCodePaymentOptions = "premiumGiftCodePaymentOptions" + TypePremiumGiftCodeInfo = "premiumGiftCodeInfo" + TypePremiumGiveawayParticipantStatusEligible = "premiumGiveawayParticipantStatusEligible" + TypePremiumGiveawayParticipantStatusParticipating = "premiumGiveawayParticipantStatusParticipating" + TypePremiumGiveawayParticipantStatusAlreadyWasMember = "premiumGiveawayParticipantStatusAlreadyWasMember" + TypePremiumGiveawayParticipantStatusAdministrator = "premiumGiveawayParticipantStatusAdministrator" + TypePremiumGiveawayParticipantStatusDisallowedCountry = "premiumGiveawayParticipantStatusDisallowedCountry" + TypePremiumGiveawayInfoOngoing = "premiumGiveawayInfoOngoing" + TypePremiumGiveawayInfoCompleted = "premiumGiveawayInfoCompleted" + TypeAccentColor = "accentColor" + TypeEmojiStatus = "emojiStatus" + TypeEmojiStatuses = "emojiStatuses" + TypeUsernames = "usernames" + TypeUser = "user" + TypeBotInfo = "botInfo" + TypeUserFullInfo = "userFullInfo" + TypeUsers = "users" + TypeChatAdministrator = "chatAdministrator" + TypeChatAdministrators = "chatAdministrators" + TypeChatMemberStatusCreator = "chatMemberStatusCreator" + TypeChatMemberStatusAdministrator = "chatMemberStatusAdministrator" + TypeChatMemberStatusMember = "chatMemberStatusMember" + TypeChatMemberStatusRestricted = "chatMemberStatusRestricted" + TypeChatMemberStatusLeft = "chatMemberStatusLeft" + TypeChatMemberStatusBanned = "chatMemberStatusBanned" + TypeChatMember = "chatMember" + TypeChatMembers = "chatMembers" + TypeChatMembersFilterContacts = "chatMembersFilterContacts" + TypeChatMembersFilterAdministrators = "chatMembersFilterAdministrators" + TypeChatMembersFilterMembers = "chatMembersFilterMembers" + TypeChatMembersFilterMention = "chatMembersFilterMention" + TypeChatMembersFilterRestricted = "chatMembersFilterRestricted" + TypeChatMembersFilterBanned = "chatMembersFilterBanned" + TypeChatMembersFilterBots = "chatMembersFilterBots" + TypeSupergroupMembersFilterRecent = "supergroupMembersFilterRecent" + TypeSupergroupMembersFilterContacts = "supergroupMembersFilterContacts" + TypeSupergroupMembersFilterAdministrators = "supergroupMembersFilterAdministrators" + TypeSupergroupMembersFilterSearch = "supergroupMembersFilterSearch" + TypeSupergroupMembersFilterRestricted = "supergroupMembersFilterRestricted" + TypeSupergroupMembersFilterBanned = "supergroupMembersFilterBanned" + TypeSupergroupMembersFilterMention = "supergroupMembersFilterMention" + TypeSupergroupMembersFilterBots = "supergroupMembersFilterBots" + TypeChatInviteLink = "chatInviteLink" + TypeChatInviteLinks = "chatInviteLinks" + TypeChatInviteLinkCount = "chatInviteLinkCount" + TypeChatInviteLinkCounts = "chatInviteLinkCounts" + TypeChatInviteLinkMember = "chatInviteLinkMember" + TypeChatInviteLinkMembers = "chatInviteLinkMembers" + TypeInviteLinkChatTypeBasicGroup = "inviteLinkChatTypeBasicGroup" + TypeInviteLinkChatTypeSupergroup = "inviteLinkChatTypeSupergroup" + TypeInviteLinkChatTypeChannel = "inviteLinkChatTypeChannel" + TypeChatInviteLinkInfo = "chatInviteLinkInfo" + TypeChatJoinRequest = "chatJoinRequest" + TypeChatJoinRequests = "chatJoinRequests" + TypeChatJoinRequestsInfo = "chatJoinRequestsInfo" + TypeBasicGroup = "basicGroup" + TypeBasicGroupFullInfo = "basicGroupFullInfo" + TypeSupergroup = "supergroup" + TypeSupergroupFullInfo = "supergroupFullInfo" + TypeSecretChatStatePending = "secretChatStatePending" + TypeSecretChatStateReady = "secretChatStateReady" + TypeSecretChatStateClosed = "secretChatStateClosed" + TypeSecretChat = "secretChat" + TypeMessageSenderUser = "messageSenderUser" + TypeMessageSenderChat = "messageSenderChat" + TypeMessageSenders = "messageSenders" + TypeChatMessageSender = "chatMessageSender" + TypeChatMessageSenders = "chatMessageSenders" + TypeMessageViewer = "messageViewer" + TypeMessageViewers = "messageViewers" + TypeMessageOriginUser = "messageOriginUser" + TypeMessageOriginHiddenUser = "messageOriginHiddenUser" + TypeMessageOriginChat = "messageOriginChat" + TypeMessageOriginChannel = "messageOriginChannel" + TypeReactionTypeEmoji = "reactionTypeEmoji" + TypeReactionTypeCustomEmoji = "reactionTypeCustomEmoji" + TypeMessageForwardInfo = "messageForwardInfo" + TypeMessageImportInfo = "messageImportInfo" + TypeMessageReplyInfo = "messageReplyInfo" + TypeMessageReaction = "messageReaction" + TypeMessageInteractionInfo = "messageInteractionInfo" + TypeUnreadReaction = "unreadReaction" + TypeMessageSendingStatePending = "messageSendingStatePending" + TypeMessageSendingStateFailed = "messageSendingStateFailed" + TypeMessageReplyToMessage = "messageReplyToMessage" + TypeMessageReplyToStory = "messageReplyToStory" + TypeInputMessageReplyToMessage = "inputMessageReplyToMessage" + TypeInputMessageReplyToStory = "inputMessageReplyToStory" + TypeMessage = "message" + TypeMessages = "messages" + TypeFoundMessages = "foundMessages" + TypeFoundChatMessages = "foundChatMessages" + TypeMessagePosition = "messagePosition" + TypeMessagePositions = "messagePositions" + TypeMessageCalendarDay = "messageCalendarDay" + TypeMessageCalendar = "messageCalendar" + TypeMessageSourceChatHistory = "messageSourceChatHistory" + TypeMessageSourceMessageThreadHistory = "messageSourceMessageThreadHistory" + TypeMessageSourceForumTopicHistory = "messageSourceForumTopicHistory" + TypeMessageSourceHistoryPreview = "messageSourceHistoryPreview" + TypeMessageSourceChatList = "messageSourceChatList" + TypeMessageSourceSearch = "messageSourceSearch" + TypeMessageSourceChatEventLog = "messageSourceChatEventLog" + TypeMessageSourceNotification = "messageSourceNotification" + TypeMessageSourceScreenshot = "messageSourceScreenshot" + TypeMessageSourceOther = "messageSourceOther" + TypeMessageSponsorTypeBot = "messageSponsorTypeBot" + TypeMessageSponsorTypePublicChannel = "messageSponsorTypePublicChannel" + TypeMessageSponsorTypePrivateChannel = "messageSponsorTypePrivateChannel" + TypeMessageSponsorTypeWebsite = "messageSponsorTypeWebsite" + TypeMessageSponsor = "messageSponsor" + TypeSponsoredMessage = "sponsoredMessage" + TypeSponsoredMessages = "sponsoredMessages" + TypeFileDownload = "fileDownload" + TypeDownloadedFileCounts = "downloadedFileCounts" + TypeFoundFileDownloads = "foundFileDownloads" + TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats" + TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats" + TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats" + TypeChatNotificationSettings = "chatNotificationSettings" + TypeScopeNotificationSettings = "scopeNotificationSettings" + TypeDraftMessage = "draftMessage" + TypeChatTypePrivate = "chatTypePrivate" + TypeChatTypeBasicGroup = "chatTypeBasicGroup" + TypeChatTypeSupergroup = "chatTypeSupergroup" + TypeChatTypeSecret = "chatTypeSecret" + TypeChatFolderIcon = "chatFolderIcon" + TypeChatFolder = "chatFolder" + TypeChatFolderInfo = "chatFolderInfo" + TypeChatFolderInviteLink = "chatFolderInviteLink" + TypeChatFolderInviteLinks = "chatFolderInviteLinks" + TypeChatFolderInviteLinkInfo = "chatFolderInviteLinkInfo" + TypeRecommendedChatFolder = "recommendedChatFolder" + TypeRecommendedChatFolders = "recommendedChatFolders" + TypeArchiveChatListSettings = "archiveChatListSettings" + TypeChatListMain = "chatListMain" + TypeChatListArchive = "chatListArchive" + TypeChatListFolder = "chatListFolder" + TypeChatLists = "chatLists" + TypeChatSourceMtprotoProxy = "chatSourceMtprotoProxy" + TypeChatSourcePublicServiceAnnouncement = "chatSourcePublicServiceAnnouncement" + TypeChatPosition = "chatPosition" + TypeChatAvailableReactionsAll = "chatAvailableReactionsAll" + TypeChatAvailableReactionsSome = "chatAvailableReactionsSome" + TypeVideoChat = "videoChat" + TypeChat = "chat" + TypeChats = "chats" + TypeChatNearby = "chatNearby" + TypeChatsNearby = "chatsNearby" + TypePublicChatTypeHasUsername = "publicChatTypeHasUsername" + TypePublicChatTypeIsLocationBased = "publicChatTypeIsLocationBased" + TypeChatActionBarReportSpam = "chatActionBarReportSpam" + TypeChatActionBarReportUnrelatedLocation = "chatActionBarReportUnrelatedLocation" + TypeChatActionBarInviteMembers = "chatActionBarInviteMembers" + TypeChatActionBarReportAddBlock = "chatActionBarReportAddBlock" + TypeChatActionBarAddContact = "chatActionBarAddContact" + TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber" + TypeChatActionBarJoinRequest = "chatActionBarJoinRequest" + TypeKeyboardButtonTypeText = "keyboardButtonTypeText" + TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" + TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" + TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll" + TypeKeyboardButtonTypeRequestUser = "keyboardButtonTypeRequestUser" + TypeKeyboardButtonTypeRequestChat = "keyboardButtonTypeRequestChat" + TypeKeyboardButtonTypeWebApp = "keyboardButtonTypeWebApp" + TypeKeyboardButton = "keyboardButton" + TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" + TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl" + TypeInlineKeyboardButtonTypeWebApp = "inlineKeyboardButtonTypeWebApp" + TypeInlineKeyboardButtonTypeCallback = "inlineKeyboardButtonTypeCallback" + TypeInlineKeyboardButtonTypeCallbackWithPassword = "inlineKeyboardButtonTypeCallbackWithPassword" + TypeInlineKeyboardButtonTypeCallbackGame = "inlineKeyboardButtonTypeCallbackGame" + TypeInlineKeyboardButtonTypeSwitchInline = "inlineKeyboardButtonTypeSwitchInline" + TypeInlineKeyboardButtonTypeBuy = "inlineKeyboardButtonTypeBuy" + TypeInlineKeyboardButtonTypeUser = "inlineKeyboardButtonTypeUser" + TypeInlineKeyboardButton = "inlineKeyboardButton" + TypeReplyMarkupRemoveKeyboard = "replyMarkupRemoveKeyboard" + TypeReplyMarkupForceReply = "replyMarkupForceReply" + TypeReplyMarkupShowKeyboard = "replyMarkupShowKeyboard" + TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard" + TypeLoginUrlInfoOpen = "loginUrlInfoOpen" + TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation" + TypeFoundWebApp = "foundWebApp" + TypeWebAppInfo = "webAppInfo" + TypeMessageThreadInfo = "messageThreadInfo" + TypeForumTopicIcon = "forumTopicIcon" + TypeForumTopicInfo = "forumTopicInfo" + TypeForumTopic = "forumTopic" + TypeForumTopics = "forumTopics" + TypeLinkPreviewOptions = "linkPreviewOptions" + TypeRichTextPlain = "richTextPlain" + TypeRichTextBold = "richTextBold" + TypeRichTextItalic = "richTextItalic" + TypeRichTextUnderline = "richTextUnderline" + TypeRichTextStrikethrough = "richTextStrikethrough" + TypeRichTextFixed = "richTextFixed" + TypeRichTextUrl = "richTextUrl" + TypeRichTextEmailAddress = "richTextEmailAddress" + TypeRichTextSubscript = "richTextSubscript" + TypeRichTextSuperscript = "richTextSuperscript" + TypeRichTextMarked = "richTextMarked" + TypeRichTextPhoneNumber = "richTextPhoneNumber" + TypeRichTextIcon = "richTextIcon" + TypeRichTextReference = "richTextReference" + TypeRichTextAnchor = "richTextAnchor" + TypeRichTextAnchorLink = "richTextAnchorLink" + TypeRichTexts = "richTexts" + TypePageBlockCaption = "pageBlockCaption" + TypePageBlockListItem = "pageBlockListItem" + TypePageBlockHorizontalAlignmentLeft = "pageBlockHorizontalAlignmentLeft" + TypePageBlockHorizontalAlignmentCenter = "pageBlockHorizontalAlignmentCenter" + TypePageBlockHorizontalAlignmentRight = "pageBlockHorizontalAlignmentRight" + TypePageBlockVerticalAlignmentTop = "pageBlockVerticalAlignmentTop" + TypePageBlockVerticalAlignmentMiddle = "pageBlockVerticalAlignmentMiddle" + TypePageBlockVerticalAlignmentBottom = "pageBlockVerticalAlignmentBottom" + TypePageBlockTableCell = "pageBlockTableCell" + TypePageBlockRelatedArticle = "pageBlockRelatedArticle" + TypePageBlockTitle = "pageBlockTitle" + TypePageBlockSubtitle = "pageBlockSubtitle" + TypePageBlockAuthorDate = "pageBlockAuthorDate" + TypePageBlockHeader = "pageBlockHeader" + TypePageBlockSubheader = "pageBlockSubheader" + TypePageBlockKicker = "pageBlockKicker" + TypePageBlockParagraph = "pageBlockParagraph" + TypePageBlockPreformatted = "pageBlockPreformatted" + TypePageBlockFooter = "pageBlockFooter" + TypePageBlockDivider = "pageBlockDivider" + TypePageBlockAnchor = "pageBlockAnchor" + TypePageBlockList = "pageBlockList" + TypePageBlockBlockQuote = "pageBlockBlockQuote" + TypePageBlockPullQuote = "pageBlockPullQuote" + TypePageBlockAnimation = "pageBlockAnimation" + TypePageBlockAudio = "pageBlockAudio" + TypePageBlockPhoto = "pageBlockPhoto" + TypePageBlockVideo = "pageBlockVideo" + TypePageBlockVoiceNote = "pageBlockVoiceNote" + TypePageBlockCover = "pageBlockCover" + TypePageBlockEmbedded = "pageBlockEmbedded" + TypePageBlockEmbeddedPost = "pageBlockEmbeddedPost" + TypePageBlockCollage = "pageBlockCollage" + TypePageBlockSlideshow = "pageBlockSlideshow" + TypePageBlockChatLink = "pageBlockChatLink" + TypePageBlockTable = "pageBlockTable" + TypePageBlockDetails = "pageBlockDetails" + TypePageBlockRelatedArticles = "pageBlockRelatedArticles" + TypePageBlockMap = "pageBlockMap" + TypeWebPageInstantView = "webPageInstantView" + TypeWebPage = "webPage" + TypeCountryInfo = "countryInfo" + TypeCountries = "countries" + TypePhoneNumberInfo = "phoneNumberInfo" + TypeBankCardActionOpenUrl = "bankCardActionOpenUrl" + TypeBankCardInfo = "bankCardInfo" + TypeAddress = "address" + TypeThemeParameters = "themeParameters" + TypeLabeledPricePart = "labeledPricePart" + TypeInvoice = "invoice" + TypeOrderInfo = "orderInfo" + TypeShippingOption = "shippingOption" + TypeSavedCredentials = "savedCredentials" + TypeInputCredentialsSaved = "inputCredentialsSaved" + TypeInputCredentialsNew = "inputCredentialsNew" + TypeInputCredentialsApplePay = "inputCredentialsApplePay" + TypeInputCredentialsGooglePay = "inputCredentialsGooglePay" + TypePaymentProviderSmartGlocal = "paymentProviderSmartGlocal" + TypePaymentProviderStripe = "paymentProviderStripe" + TypePaymentProviderOther = "paymentProviderOther" + TypePaymentOption = "paymentOption" + TypePaymentForm = "paymentForm" + TypeValidatedOrderInfo = "validatedOrderInfo" + TypePaymentResult = "paymentResult" + TypePaymentReceipt = "paymentReceipt" + TypeInputInvoiceMessage = "inputInvoiceMessage" + TypeInputInvoiceName = "inputInvoiceName" + TypeInputInvoiceTelegram = "inputInvoiceTelegram" + TypeMessageExtendedMediaPreview = "messageExtendedMediaPreview" + TypeMessageExtendedMediaPhoto = "messageExtendedMediaPhoto" + TypeMessageExtendedMediaVideo = "messageExtendedMediaVideo" + TypeMessageExtendedMediaUnsupported = "messageExtendedMediaUnsupported" + TypePremiumGiveawayParameters = "premiumGiveawayParameters" + TypeDatedFile = "datedFile" + TypePassportElementTypePersonalDetails = "passportElementTypePersonalDetails" + TypePassportElementTypePassport = "passportElementTypePassport" + TypePassportElementTypeDriverLicense = "passportElementTypeDriverLicense" + TypePassportElementTypeIdentityCard = "passportElementTypeIdentityCard" + TypePassportElementTypeInternalPassport = "passportElementTypeInternalPassport" + TypePassportElementTypeAddress = "passportElementTypeAddress" + TypePassportElementTypeUtilityBill = "passportElementTypeUtilityBill" + TypePassportElementTypeBankStatement = "passportElementTypeBankStatement" + TypePassportElementTypeRentalAgreement = "passportElementTypeRentalAgreement" + TypePassportElementTypePassportRegistration = "passportElementTypePassportRegistration" + TypePassportElementTypeTemporaryRegistration = "passportElementTypeTemporaryRegistration" + TypePassportElementTypePhoneNumber = "passportElementTypePhoneNumber" + TypePassportElementTypeEmailAddress = "passportElementTypeEmailAddress" + TypeDate = "date" + TypePersonalDetails = "personalDetails" + TypeIdentityDocument = "identityDocument" + TypeInputIdentityDocument = "inputIdentityDocument" + TypePersonalDocument = "personalDocument" + TypeInputPersonalDocument = "inputPersonalDocument" + TypePassportElementPersonalDetails = "passportElementPersonalDetails" + TypePassportElementPassport = "passportElementPassport" + TypePassportElementDriverLicense = "passportElementDriverLicense" + TypePassportElementIdentityCard = "passportElementIdentityCard" + TypePassportElementInternalPassport = "passportElementInternalPassport" + TypePassportElementAddress = "passportElementAddress" + TypePassportElementUtilityBill = "passportElementUtilityBill" + TypePassportElementBankStatement = "passportElementBankStatement" + TypePassportElementRentalAgreement = "passportElementRentalAgreement" + TypePassportElementPassportRegistration = "passportElementPassportRegistration" + TypePassportElementTemporaryRegistration = "passportElementTemporaryRegistration" + TypePassportElementPhoneNumber = "passportElementPhoneNumber" + TypePassportElementEmailAddress = "passportElementEmailAddress" + TypeInputPassportElementPersonalDetails = "inputPassportElementPersonalDetails" + TypeInputPassportElementPassport = "inputPassportElementPassport" + TypeInputPassportElementDriverLicense = "inputPassportElementDriverLicense" + TypeInputPassportElementIdentityCard = "inputPassportElementIdentityCard" + TypeInputPassportElementInternalPassport = "inputPassportElementInternalPassport" + TypeInputPassportElementAddress = "inputPassportElementAddress" + TypeInputPassportElementUtilityBill = "inputPassportElementUtilityBill" + TypeInputPassportElementBankStatement = "inputPassportElementBankStatement" + TypeInputPassportElementRentalAgreement = "inputPassportElementRentalAgreement" + TypeInputPassportElementPassportRegistration = "inputPassportElementPassportRegistration" + TypeInputPassportElementTemporaryRegistration = "inputPassportElementTemporaryRegistration" + TypeInputPassportElementPhoneNumber = "inputPassportElementPhoneNumber" + TypeInputPassportElementEmailAddress = "inputPassportElementEmailAddress" + TypePassportElements = "passportElements" + TypePassportElementErrorSourceUnspecified = "passportElementErrorSourceUnspecified" + TypePassportElementErrorSourceDataField = "passportElementErrorSourceDataField" + TypePassportElementErrorSourceFrontSide = "passportElementErrorSourceFrontSide" + TypePassportElementErrorSourceReverseSide = "passportElementErrorSourceReverseSide" + TypePassportElementErrorSourceSelfie = "passportElementErrorSourceSelfie" + TypePassportElementErrorSourceTranslationFile = "passportElementErrorSourceTranslationFile" + TypePassportElementErrorSourceTranslationFiles = "passportElementErrorSourceTranslationFiles" + TypePassportElementErrorSourceFile = "passportElementErrorSourceFile" + TypePassportElementErrorSourceFiles = "passportElementErrorSourceFiles" + TypePassportElementError = "passportElementError" + TypePassportSuitableElement = "passportSuitableElement" + TypePassportRequiredElement = "passportRequiredElement" + TypePassportAuthorizationForm = "passportAuthorizationForm" + TypePassportElementsWithErrors = "passportElementsWithErrors" + TypeEncryptedCredentials = "encryptedCredentials" + TypeEncryptedPassportElement = "encryptedPassportElement" + TypeInputPassportElementErrorSourceUnspecified = "inputPassportElementErrorSourceUnspecified" + TypeInputPassportElementErrorSourceDataField = "inputPassportElementErrorSourceDataField" + TypeInputPassportElementErrorSourceFrontSide = "inputPassportElementErrorSourceFrontSide" + TypeInputPassportElementErrorSourceReverseSide = "inputPassportElementErrorSourceReverseSide" + TypeInputPassportElementErrorSourceSelfie = "inputPassportElementErrorSourceSelfie" + TypeInputPassportElementErrorSourceTranslationFile = "inputPassportElementErrorSourceTranslationFile" + TypeInputPassportElementErrorSourceTranslationFiles = "inputPassportElementErrorSourceTranslationFiles" + TypeInputPassportElementErrorSourceFile = "inputPassportElementErrorSourceFile" + TypeInputPassportElementErrorSourceFiles = "inputPassportElementErrorSourceFiles" + TypeInputPassportElementError = "inputPassportElementError" + TypeMessageText = "messageText" + TypeMessageAnimation = "messageAnimation" + TypeMessageAudio = "messageAudio" + TypeMessageDocument = "messageDocument" + TypeMessagePhoto = "messagePhoto" + TypeMessageExpiredPhoto = "messageExpiredPhoto" + TypeMessageSticker = "messageSticker" + TypeMessageVideo = "messageVideo" + TypeMessageExpiredVideo = "messageExpiredVideo" + TypeMessageVideoNote = "messageVideoNote" + TypeMessageVoiceNote = "messageVoiceNote" + TypeMessageLocation = "messageLocation" + TypeMessageVenue = "messageVenue" + TypeMessageContact = "messageContact" + TypeMessageAnimatedEmoji = "messageAnimatedEmoji" + TypeMessageDice = "messageDice" + TypeMessageGame = "messageGame" + TypeMessagePoll = "messagePoll" + TypeMessageStory = "messageStory" + TypeMessageInvoice = "messageInvoice" + TypeMessageCall = "messageCall" + TypeMessageVideoChatScheduled = "messageVideoChatScheduled" + TypeMessageVideoChatStarted = "messageVideoChatStarted" + TypeMessageVideoChatEnded = "messageVideoChatEnded" + TypeMessageInviteVideoChatParticipants = "messageInviteVideoChatParticipants" + TypeMessageBasicGroupChatCreate = "messageBasicGroupChatCreate" + TypeMessageSupergroupChatCreate = "messageSupergroupChatCreate" + TypeMessageChatChangeTitle = "messageChatChangeTitle" + TypeMessageChatChangePhoto = "messageChatChangePhoto" + TypeMessageChatDeletePhoto = "messageChatDeletePhoto" + TypeMessageChatAddMembers = "messageChatAddMembers" + TypeMessageChatJoinByLink = "messageChatJoinByLink" + TypeMessageChatJoinByRequest = "messageChatJoinByRequest" + TypeMessageChatDeleteMember = "messageChatDeleteMember" + TypeMessageChatUpgradeTo = "messageChatUpgradeTo" + TypeMessageChatUpgradeFrom = "messageChatUpgradeFrom" + TypeMessagePinMessage = "messagePinMessage" + TypeMessageScreenshotTaken = "messageScreenshotTaken" + TypeMessageChatSetBackground = "messageChatSetBackground" + TypeMessageChatSetTheme = "messageChatSetTheme" + TypeMessageChatSetMessageAutoDeleteTime = "messageChatSetMessageAutoDeleteTime" + TypeMessageForumTopicCreated = "messageForumTopicCreated" + TypeMessageForumTopicEdited = "messageForumTopicEdited" + TypeMessageForumTopicIsClosedToggled = "messageForumTopicIsClosedToggled" + TypeMessageForumTopicIsHiddenToggled = "messageForumTopicIsHiddenToggled" + TypeMessageSuggestProfilePhoto = "messageSuggestProfilePhoto" + TypeMessageCustomServiceAction = "messageCustomServiceAction" + TypeMessageGameScore = "messageGameScore" + TypeMessagePaymentSuccessful = "messagePaymentSuccessful" + TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" + TypeMessageGiftedPremium = "messageGiftedPremium" + TypeMessagePremiumGiftCode = "messagePremiumGiftCode" + TypeMessagePremiumGiveawayCreated = "messagePremiumGiveawayCreated" + TypeMessagePremiumGiveaway = "messagePremiumGiveaway" + TypeMessageContactRegistered = "messageContactRegistered" + TypeMessageUserShared = "messageUserShared" + TypeMessageChatShared = "messageChatShared" + TypeMessageBotWriteAccessAllowed = "messageBotWriteAccessAllowed" + TypeMessageWebAppDataSent = "messageWebAppDataSent" + TypeMessageWebAppDataReceived = "messageWebAppDataReceived" + TypeMessagePassportDataSent = "messagePassportDataSent" + TypeMessagePassportDataReceived = "messagePassportDataReceived" + TypeMessageProximityAlertTriggered = "messageProximityAlertTriggered" + TypeMessageUnsupported = "messageUnsupported" + TypeTextEntityTypeMention = "textEntityTypeMention" + TypeTextEntityTypeHashtag = "textEntityTypeHashtag" + TypeTextEntityTypeCashtag = "textEntityTypeCashtag" + TypeTextEntityTypeBotCommand = "textEntityTypeBotCommand" + TypeTextEntityTypeUrl = "textEntityTypeUrl" + TypeTextEntityTypeEmailAddress = "textEntityTypeEmailAddress" + TypeTextEntityTypePhoneNumber = "textEntityTypePhoneNumber" + TypeTextEntityTypeBankCardNumber = "textEntityTypeBankCardNumber" + TypeTextEntityTypeBold = "textEntityTypeBold" + TypeTextEntityTypeItalic = "textEntityTypeItalic" + TypeTextEntityTypeUnderline = "textEntityTypeUnderline" + TypeTextEntityTypeStrikethrough = "textEntityTypeStrikethrough" + TypeTextEntityTypeSpoiler = "textEntityTypeSpoiler" + TypeTextEntityTypeCode = "textEntityTypeCode" + TypeTextEntityTypePre = "textEntityTypePre" + TypeTextEntityTypePreCode = "textEntityTypePreCode" + TypeTextEntityTypeBlockQuote = "textEntityTypeBlockQuote" + TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl" + TypeTextEntityTypeMentionName = "textEntityTypeMentionName" + TypeTextEntityTypeCustomEmoji = "textEntityTypeCustomEmoji" + TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp" + TypeInputThumbnail = "inputThumbnail" + TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate" + TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline" + TypeMessageSelfDestructTypeTimer = "messageSelfDestructTypeTimer" + TypeMessageSelfDestructTypeImmediately = "messageSelfDestructTypeImmediately" + TypeMessageSendOptions = "messageSendOptions" + TypeMessageCopyOptions = "messageCopyOptions" + TypeInputMessageText = "inputMessageText" + TypeInputMessageAnimation = "inputMessageAnimation" + TypeInputMessageAudio = "inputMessageAudio" + TypeInputMessageDocument = "inputMessageDocument" + TypeInputMessagePhoto = "inputMessagePhoto" + TypeInputMessageSticker = "inputMessageSticker" + TypeInputMessageVideo = "inputMessageVideo" + TypeInputMessageVideoNote = "inputMessageVideoNote" + TypeInputMessageVoiceNote = "inputMessageVoiceNote" + TypeInputMessageLocation = "inputMessageLocation" + TypeInputMessageVenue = "inputMessageVenue" + TypeInputMessageContact = "inputMessageContact" + TypeInputMessageDice = "inputMessageDice" + TypeInputMessageGame = "inputMessageGame" + TypeInputMessageInvoice = "inputMessageInvoice" + TypeInputMessagePoll = "inputMessagePoll" + TypeInputMessageStory = "inputMessageStory" + TypeInputMessageForwarded = "inputMessageForwarded" + TypeSearchMessagesFilterEmpty = "searchMessagesFilterEmpty" + TypeSearchMessagesFilterAnimation = "searchMessagesFilterAnimation" + TypeSearchMessagesFilterAudio = "searchMessagesFilterAudio" + TypeSearchMessagesFilterDocument = "searchMessagesFilterDocument" + TypeSearchMessagesFilterPhoto = "searchMessagesFilterPhoto" + TypeSearchMessagesFilterVideo = "searchMessagesFilterVideo" + TypeSearchMessagesFilterVoiceNote = "searchMessagesFilterVoiceNote" + TypeSearchMessagesFilterPhotoAndVideo = "searchMessagesFilterPhotoAndVideo" + TypeSearchMessagesFilterUrl = "searchMessagesFilterUrl" + TypeSearchMessagesFilterChatPhoto = "searchMessagesFilterChatPhoto" + TypeSearchMessagesFilterVideoNote = "searchMessagesFilterVideoNote" + TypeSearchMessagesFilterVoiceAndVideoNote = "searchMessagesFilterVoiceAndVideoNote" + TypeSearchMessagesFilterMention = "searchMessagesFilterMention" + TypeSearchMessagesFilterUnreadMention = "searchMessagesFilterUnreadMention" + TypeSearchMessagesFilterUnreadReaction = "searchMessagesFilterUnreadReaction" + TypeSearchMessagesFilterFailedToSend = "searchMessagesFilterFailedToSend" + TypeSearchMessagesFilterPinned = "searchMessagesFilterPinned" + TypeChatActionTyping = "chatActionTyping" + TypeChatActionRecordingVideo = "chatActionRecordingVideo" + TypeChatActionUploadingVideo = "chatActionUploadingVideo" + TypeChatActionRecordingVoiceNote = "chatActionRecordingVoiceNote" + TypeChatActionUploadingVoiceNote = "chatActionUploadingVoiceNote" + TypeChatActionUploadingPhoto = "chatActionUploadingPhoto" + TypeChatActionUploadingDocument = "chatActionUploadingDocument" + TypeChatActionChoosingSticker = "chatActionChoosingSticker" + TypeChatActionChoosingLocation = "chatActionChoosingLocation" + TypeChatActionChoosingContact = "chatActionChoosingContact" + TypeChatActionStartPlayingGame = "chatActionStartPlayingGame" + TypeChatActionRecordingVideoNote = "chatActionRecordingVideoNote" + TypeChatActionUploadingVideoNote = "chatActionUploadingVideoNote" + TypeChatActionWatchingAnimations = "chatActionWatchingAnimations" + TypeChatActionCancel = "chatActionCancel" + TypeUserStatusEmpty = "userStatusEmpty" + TypeUserStatusOnline = "userStatusOnline" + TypeUserStatusOffline = "userStatusOffline" + TypeUserStatusRecently = "userStatusRecently" + TypeUserStatusLastWeek = "userStatusLastWeek" + TypeUserStatusLastMonth = "userStatusLastMonth" + TypeStickers = "stickers" + TypeEmojis = "emojis" + TypeStickerSet = "stickerSet" + TypeStickerSetInfo = "stickerSetInfo" + TypeStickerSets = "stickerSets" + TypeTrendingStickerSets = "trendingStickerSets" + TypeEmojiCategory = "emojiCategory" + TypeEmojiCategories = "emojiCategories" + TypeEmojiCategoryTypeDefault = "emojiCategoryTypeDefault" + TypeEmojiCategoryTypeEmojiStatus = "emojiCategoryTypeEmojiStatus" + TypeEmojiCategoryTypeChatPhoto = "emojiCategoryTypeChatPhoto" + TypeStoryViewer = "storyViewer" + TypeStoryViewers = "storyViewers" + TypeStoryAreaPosition = "storyAreaPosition" + TypeStoryAreaTypeLocation = "storyAreaTypeLocation" + TypeStoryAreaTypeVenue = "storyAreaTypeVenue" + TypeStoryAreaTypeSuggestedReaction = "storyAreaTypeSuggestedReaction" + TypeStoryArea = "storyArea" + TypeInputStoryAreaTypeLocation = "inputStoryAreaTypeLocation" + TypeInputStoryAreaTypeFoundVenue = "inputStoryAreaTypeFoundVenue" + TypeInputStoryAreaTypePreviousVenue = "inputStoryAreaTypePreviousVenue" + TypeInputStoryAreaTypeSuggestedReaction = "inputStoryAreaTypeSuggestedReaction" + TypeInputStoryArea = "inputStoryArea" + TypeInputStoryAreas = "inputStoryAreas" + TypeStoryVideo = "storyVideo" + TypeStoryContentPhoto = "storyContentPhoto" + TypeStoryContentVideo = "storyContentVideo" + TypeStoryContentUnsupported = "storyContentUnsupported" + TypeInputStoryContentPhoto = "inputStoryContentPhoto" + TypeInputStoryContentVideo = "inputStoryContentVideo" + TypeStoryListMain = "storyListMain" + TypeStoryListArchive = "storyListArchive" + TypeStoryInteractionInfo = "storyInteractionInfo" + TypeStory = "story" + TypeStories = "stories" + TypeStoryInfo = "storyInfo" + TypeChatActiveStories = "chatActiveStories" + TypeChatBoostSourceGiftCode = "chatBoostSourceGiftCode" + TypeChatBoostSourceGiveaway = "chatBoostSourceGiveaway" + TypeChatBoostSourcePremium = "chatBoostSourcePremium" + TypePrepaidPremiumGiveaway = "prepaidPremiumGiveaway" + TypeChatBoostStatus = "chatBoostStatus" + TypeChatBoost = "chatBoost" + TypeFoundChatBoosts = "foundChatBoosts" + TypeChatBoostSlot = "chatBoostSlot" + TypeChatBoostSlots = "chatBoostSlots" + TypeCallDiscardReasonEmpty = "callDiscardReasonEmpty" + TypeCallDiscardReasonMissed = "callDiscardReasonMissed" + TypeCallDiscardReasonDeclined = "callDiscardReasonDeclined" + TypeCallDiscardReasonDisconnected = "callDiscardReasonDisconnected" + TypeCallDiscardReasonHungUp = "callDiscardReasonHungUp" + TypeCallProtocol = "callProtocol" + TypeCallServerTypeTelegramReflector = "callServerTypeTelegramReflector" + TypeCallServerTypeWebrtc = "callServerTypeWebrtc" + TypeCallServer = "callServer" + TypeCallId = "callId" + TypeGroupCallId = "groupCallId" + TypeCallStatePending = "callStatePending" + TypeCallStateExchangingKeys = "callStateExchangingKeys" + TypeCallStateReady = "callStateReady" + TypeCallStateHangingUp = "callStateHangingUp" + TypeCallStateDiscarded = "callStateDiscarded" + TypeCallStateError = "callStateError" + TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" + TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" + TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" + TypeGroupCallStream = "groupCallStream" + TypeGroupCallStreams = "groupCallStreams" + TypeRtmpUrl = "rtmpUrl" + TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker" + TypeGroupCall = "groupCall" + TypeGroupCallVideoSourceGroup = "groupCallVideoSourceGroup" + TypeGroupCallParticipantVideoInfo = "groupCallParticipantVideoInfo" + TypeGroupCallParticipant = "groupCallParticipant" + TypeCallProblemEcho = "callProblemEcho" + TypeCallProblemNoise = "callProblemNoise" + TypeCallProblemInterruptions = "callProblemInterruptions" + TypeCallProblemDistortedSpeech = "callProblemDistortedSpeech" + TypeCallProblemSilentLocal = "callProblemSilentLocal" + TypeCallProblemSilentRemote = "callProblemSilentRemote" + TypeCallProblemDropped = "callProblemDropped" + TypeCallProblemDistortedVideo = "callProblemDistortedVideo" + TypeCallProblemPixelatedVideo = "callProblemPixelatedVideo" + TypeCall = "call" + TypeFirebaseAuthenticationSettingsAndroid = "firebaseAuthenticationSettingsAndroid" + TypeFirebaseAuthenticationSettingsIos = "firebaseAuthenticationSettingsIos" + TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings" + TypeAddedReaction = "addedReaction" + TypeAddedReactions = "addedReactions" + TypeAvailableReaction = "availableReaction" + TypeAvailableReactions = "availableReactions" + TypeEmojiReaction = "emojiReaction" + TypeAnimations = "animations" + TypeDiceStickersRegular = "diceStickersRegular" + TypeDiceStickersSlotMachine = "diceStickersSlotMachine" + TypeImportedContacts = "importedContacts" + TypeSpeechRecognitionResultPending = "speechRecognitionResultPending" + TypeSpeechRecognitionResultText = "speechRecognitionResultText" + TypeSpeechRecognitionResultError = "speechRecognitionResultError" + TypeAttachmentMenuBotColor = "attachmentMenuBotColor" + TypeAttachmentMenuBot = "attachmentMenuBot" + TypeSentWebAppMessage = "sentWebAppMessage" + TypeBotWriteAccessAllowReasonConnectedWebsite = "botWriteAccessAllowReasonConnectedWebsite" + TypeBotWriteAccessAllowReasonAddedToAttachmentMenu = "botWriteAccessAllowReasonAddedToAttachmentMenu" + TypeBotWriteAccessAllowReasonLaunchedWebApp = "botWriteAccessAllowReasonLaunchedWebApp" + TypeBotWriteAccessAllowReasonAcceptedRequest = "botWriteAccessAllowReasonAcceptedRequest" + TypeHttpUrl = "httpUrl" + TypeUserLink = "userLink" + TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation" + TypeInputInlineQueryResultArticle = "inputInlineQueryResultArticle" + TypeInputInlineQueryResultAudio = "inputInlineQueryResultAudio" + TypeInputInlineQueryResultContact = "inputInlineQueryResultContact" + TypeInputInlineQueryResultDocument = "inputInlineQueryResultDocument" + TypeInputInlineQueryResultGame = "inputInlineQueryResultGame" + TypeInputInlineQueryResultLocation = "inputInlineQueryResultLocation" + TypeInputInlineQueryResultPhoto = "inputInlineQueryResultPhoto" + TypeInputInlineQueryResultSticker = "inputInlineQueryResultSticker" + TypeInputInlineQueryResultVenue = "inputInlineQueryResultVenue" + TypeInputInlineQueryResultVideo = "inputInlineQueryResultVideo" + TypeInputInlineQueryResultVoiceNote = "inputInlineQueryResultVoiceNote" + TypeInlineQueryResultArticle = "inlineQueryResultArticle" + TypeInlineQueryResultContact = "inlineQueryResultContact" + TypeInlineQueryResultLocation = "inlineQueryResultLocation" + TypeInlineQueryResultVenue = "inlineQueryResultVenue" + TypeInlineQueryResultGame = "inlineQueryResultGame" + TypeInlineQueryResultAnimation = "inlineQueryResultAnimation" + TypeInlineQueryResultAudio = "inlineQueryResultAudio" + TypeInlineQueryResultDocument = "inlineQueryResultDocument" + TypeInlineQueryResultPhoto = "inlineQueryResultPhoto" + TypeInlineQueryResultSticker = "inlineQueryResultSticker" + TypeInlineQueryResultVideo = "inlineQueryResultVideo" + TypeInlineQueryResultVoiceNote = "inlineQueryResultVoiceNote" + TypeInlineQueryResultsButtonTypeStartBot = "inlineQueryResultsButtonTypeStartBot" + TypeInlineQueryResultsButtonTypeWebApp = "inlineQueryResultsButtonTypeWebApp" + TypeInlineQueryResultsButton = "inlineQueryResultsButton" + TypeInlineQueryResults = "inlineQueryResults" + TypeCallbackQueryPayloadData = "callbackQueryPayloadData" + TypeCallbackQueryPayloadDataWithPassword = "callbackQueryPayloadDataWithPassword" + TypeCallbackQueryPayloadGame = "callbackQueryPayloadGame" + TypeCallbackQueryAnswer = "callbackQueryAnswer" + TypeCustomRequestResult = "customRequestResult" + TypeGameHighScore = "gameHighScore" + TypeGameHighScores = "gameHighScores" + TypeChatEventMessageEdited = "chatEventMessageEdited" + TypeChatEventMessageDeleted = "chatEventMessageDeleted" + TypeChatEventMessagePinned = "chatEventMessagePinned" + TypeChatEventMessageUnpinned = "chatEventMessageUnpinned" + TypeChatEventPollStopped = "chatEventPollStopped" + TypeChatEventMemberJoined = "chatEventMemberJoined" + TypeChatEventMemberJoinedByInviteLink = "chatEventMemberJoinedByInviteLink" + TypeChatEventMemberJoinedByRequest = "chatEventMemberJoinedByRequest" + TypeChatEventMemberInvited = "chatEventMemberInvited" + TypeChatEventMemberLeft = "chatEventMemberLeft" + TypeChatEventMemberPromoted = "chatEventMemberPromoted" + TypeChatEventMemberRestricted = "chatEventMemberRestricted" + TypeChatEventAvailableReactionsChanged = "chatEventAvailableReactionsChanged" + TypeChatEventDescriptionChanged = "chatEventDescriptionChanged" + TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" + TypeChatEventLocationChanged = "chatEventLocationChanged" + TypeChatEventMessageAutoDeleteTimeChanged = "chatEventMessageAutoDeleteTimeChanged" + TypeChatEventPermissionsChanged = "chatEventPermissionsChanged" + TypeChatEventPhotoChanged = "chatEventPhotoChanged" + TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" + TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" + TypeChatEventTitleChanged = "chatEventTitleChanged" + TypeChatEventUsernameChanged = "chatEventUsernameChanged" + TypeChatEventActiveUsernamesChanged = "chatEventActiveUsernamesChanged" + TypeChatEventAccentColorChanged = "chatEventAccentColorChanged" + TypeChatEventBackgroundCustomEmojiChanged = "chatEventBackgroundCustomEmojiChanged" + TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" + TypeChatEventInvitesToggled = "chatEventInvitesToggled" + TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" + TypeChatEventHasAggressiveAntiSpamEnabledToggled = "chatEventHasAggressiveAntiSpamEnabledToggled" + TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" + TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited" + TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked" + TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted" + TypeChatEventVideoChatCreated = "chatEventVideoChatCreated" + TypeChatEventVideoChatEnded = "chatEventVideoChatEnded" + TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" + TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled" + TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged" + TypeChatEventIsForumToggled = "chatEventIsForumToggled" + TypeChatEventForumTopicCreated = "chatEventForumTopicCreated" + TypeChatEventForumTopicEdited = "chatEventForumTopicEdited" + TypeChatEventForumTopicToggleIsClosed = "chatEventForumTopicToggleIsClosed" + TypeChatEventForumTopicToggleIsHidden = "chatEventForumTopicToggleIsHidden" + TypeChatEventForumTopicDeleted = "chatEventForumTopicDeleted" + TypeChatEventForumTopicPinned = "chatEventForumTopicPinned" + TypeChatEvent = "chatEvent" + TypeChatEvents = "chatEvents" + TypeChatEventLogFilters = "chatEventLogFilters" + TypeLanguagePackStringValueOrdinary = "languagePackStringValueOrdinary" + TypeLanguagePackStringValuePluralized = "languagePackStringValuePluralized" + TypeLanguagePackStringValueDeleted = "languagePackStringValueDeleted" + TypeLanguagePackString = "languagePackString" + TypeLanguagePackStrings = "languagePackStrings" + TypeLanguagePackInfo = "languagePackInfo" + TypeLocalizationTargetInfo = "localizationTargetInfo" + TypePremiumLimitTypeSupergroupCount = "premiumLimitTypeSupergroupCount" + TypePremiumLimitTypePinnedChatCount = "premiumLimitTypePinnedChatCount" + TypePremiumLimitTypeCreatedPublicChatCount = "premiumLimitTypeCreatedPublicChatCount" + TypePremiumLimitTypeSavedAnimationCount = "premiumLimitTypeSavedAnimationCount" + TypePremiumLimitTypeFavoriteStickerCount = "premiumLimitTypeFavoriteStickerCount" + TypePremiumLimitTypeChatFolderCount = "premiumLimitTypeChatFolderCount" + TypePremiumLimitTypeChatFolderChosenChatCount = "premiumLimitTypeChatFolderChosenChatCount" + TypePremiumLimitTypePinnedArchivedChatCount = "premiumLimitTypePinnedArchivedChatCount" + TypePremiumLimitTypeCaptionLength = "premiumLimitTypeCaptionLength" + TypePremiumLimitTypeBioLength = "premiumLimitTypeBioLength" + TypePremiumLimitTypeChatFolderInviteLinkCount = "premiumLimitTypeChatFolderInviteLinkCount" + TypePremiumLimitTypeShareableChatFolderCount = "premiumLimitTypeShareableChatFolderCount" + TypePremiumLimitTypeActiveStoryCount = "premiumLimitTypeActiveStoryCount" + TypePremiumLimitTypeWeeklySentStoryCount = "premiumLimitTypeWeeklySentStoryCount" + TypePremiumLimitTypeMonthlySentStoryCount = "premiumLimitTypeMonthlySentStoryCount" + TypePremiumLimitTypeStoryCaptionLength = "premiumLimitTypeStoryCaptionLength" + TypePremiumLimitTypeStorySuggestedReactionAreaCount = "premiumLimitTypeStorySuggestedReactionAreaCount" + TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits" + TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize" + TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed" + TypePremiumFeatureVoiceRecognition = "premiumFeatureVoiceRecognition" + TypePremiumFeatureDisabledAds = "premiumFeatureDisabledAds" + TypePremiumFeatureUniqueReactions = "premiumFeatureUniqueReactions" + TypePremiumFeatureUniqueStickers = "premiumFeatureUniqueStickers" + TypePremiumFeatureCustomEmoji = "premiumFeatureCustomEmoji" + TypePremiumFeatureAdvancedChatManagement = "premiumFeatureAdvancedChatManagement" + TypePremiumFeatureProfileBadge = "premiumFeatureProfileBadge" + TypePremiumFeatureEmojiStatus = "premiumFeatureEmojiStatus" + TypePremiumFeatureAnimatedProfilePhoto = "premiumFeatureAnimatedProfilePhoto" + TypePremiumFeatureForumTopicIcon = "premiumFeatureForumTopicIcon" + TypePremiumFeatureAppIcons = "premiumFeatureAppIcons" + TypePremiumFeatureRealTimeChatTranslation = "premiumFeatureRealTimeChatTranslation" + TypePremiumFeatureUpgradedStories = "premiumFeatureUpgradedStories" + TypePremiumFeatureChatBoost = "premiumFeatureChatBoost" + TypePremiumFeatureAccentColor = "premiumFeatureAccentColor" + TypePremiumStoryFeaturePriorityOrder = "premiumStoryFeaturePriorityOrder" + TypePremiumStoryFeatureStealthMode = "premiumStoryFeatureStealthMode" + TypePremiumStoryFeaturePermanentViewsHistory = "premiumStoryFeaturePermanentViewsHistory" + TypePremiumStoryFeatureCustomExpirationDuration = "premiumStoryFeatureCustomExpirationDuration" + TypePremiumStoryFeatureSaveStories = "premiumStoryFeatureSaveStories" + TypePremiumStoryFeatureLinksAndFormatting = "premiumStoryFeatureLinksAndFormatting" + TypePremiumLimit = "premiumLimit" + TypePremiumFeatures = "premiumFeatures" + TypePremiumSourceLimitExceeded = "premiumSourceLimitExceeded" + TypePremiumSourceFeature = "premiumSourceFeature" + TypePremiumSourceStoryFeature = "premiumSourceStoryFeature" + TypePremiumSourceLink = "premiumSourceLink" + TypePremiumSourceSettings = "premiumSourceSettings" + TypePremiumFeaturePromotionAnimation = "premiumFeaturePromotionAnimation" + TypePremiumState = "premiumState" + TypeStorePaymentPurposePremiumSubscription = "storePaymentPurposePremiumSubscription" + TypeStorePaymentPurposeGiftedPremium = "storePaymentPurposeGiftedPremium" + TypeStorePaymentPurposePremiumGiftCodes = "storePaymentPurposePremiumGiftCodes" + TypeStorePaymentPurposePremiumGiveaway = "storePaymentPurposePremiumGiveaway" + TypeTelegramPaymentPurposePremiumGiftCodes = "telegramPaymentPurposePremiumGiftCodes" + TypeTelegramPaymentPurposePremiumGiveaway = "telegramPaymentPurposePremiumGiveaway" + TypeDeviceTokenFirebaseCloudMessaging = "deviceTokenFirebaseCloudMessaging" + TypeDeviceTokenApplePush = "deviceTokenApplePush" + TypeDeviceTokenApplePushVoIP = "deviceTokenApplePushVoIP" + TypeDeviceTokenWindowsPush = "deviceTokenWindowsPush" + TypeDeviceTokenMicrosoftPush = "deviceTokenMicrosoftPush" + TypeDeviceTokenMicrosoftPushVoIP = "deviceTokenMicrosoftPushVoIP" + TypeDeviceTokenWebPush = "deviceTokenWebPush" + TypeDeviceTokenSimplePush = "deviceTokenSimplePush" + TypeDeviceTokenUbuntuPush = "deviceTokenUbuntuPush" + TypeDeviceTokenBlackBerryPush = "deviceTokenBlackBerryPush" + TypeDeviceTokenTizenPush = "deviceTokenTizenPush" + TypeDeviceTokenHuaweiPush = "deviceTokenHuaweiPush" + TypePushReceiverId = "pushReceiverId" + TypeBackgroundFillSolid = "backgroundFillSolid" + TypeBackgroundFillGradient = "backgroundFillGradient" + TypeBackgroundFillFreeformGradient = "backgroundFillFreeformGradient" + TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper" + TypeBackgroundTypePattern = "backgroundTypePattern" + TypeBackgroundTypeFill = "backgroundTypeFill" + TypeInputBackgroundLocal = "inputBackgroundLocal" + TypeInputBackgroundRemote = "inputBackgroundRemote" + TypeInputBackgroundPrevious = "inputBackgroundPrevious" + TypeThemeSettings = "themeSettings" + TypeChatTheme = "chatTheme" + TypeHashtags = "hashtags" + TypeCanSendStoryResultOk = "canSendStoryResultOk" + TypeCanSendStoryResultPremiumNeeded = "canSendStoryResultPremiumNeeded" + TypeCanSendStoryResultBoostNeeded = "canSendStoryResultBoostNeeded" + TypeCanSendStoryResultActiveStoryLimitExceeded = "canSendStoryResultActiveStoryLimitExceeded" + TypeCanSendStoryResultWeeklyLimitExceeded = "canSendStoryResultWeeklyLimitExceeded" + TypeCanSendStoryResultMonthlyLimitExceeded = "canSendStoryResultMonthlyLimitExceeded" + TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" + TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" + TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" + TypeCanTransferOwnershipResultSessionTooFresh = "canTransferOwnershipResultSessionTooFresh" + TypeCheckChatUsernameResultOk = "checkChatUsernameResultOk" + TypeCheckChatUsernameResultUsernameInvalid = "checkChatUsernameResultUsernameInvalid" + TypeCheckChatUsernameResultUsernameOccupied = "checkChatUsernameResultUsernameOccupied" + TypeCheckChatUsernameResultUsernamePurchasable = "checkChatUsernameResultUsernamePurchasable" + TypeCheckChatUsernameResultPublicChatsTooMany = "checkChatUsernameResultPublicChatsTooMany" + TypeCheckChatUsernameResultPublicGroupsUnavailable = "checkChatUsernameResultPublicGroupsUnavailable" + TypeCheckStickerSetNameResultOk = "checkStickerSetNameResultOk" + TypeCheckStickerSetNameResultNameInvalid = "checkStickerSetNameResultNameInvalid" + TypeCheckStickerSetNameResultNameOccupied = "checkStickerSetNameResultNameOccupied" + TypeResetPasswordResultOk = "resetPasswordResultOk" + TypeResetPasswordResultPending = "resetPasswordResultPending" + TypeResetPasswordResultDeclined = "resetPasswordResultDeclined" + TypeMessageFileTypePrivate = "messageFileTypePrivate" + TypeMessageFileTypeGroup = "messageFileTypeGroup" + TypeMessageFileTypeUnknown = "messageFileTypeUnknown" + TypePushMessageContentHidden = "pushMessageContentHidden" + TypePushMessageContentAnimation = "pushMessageContentAnimation" + TypePushMessageContentAudio = "pushMessageContentAudio" + TypePushMessageContentContact = "pushMessageContentContact" + TypePushMessageContentContactRegistered = "pushMessageContentContactRegistered" + TypePushMessageContentDocument = "pushMessageContentDocument" + TypePushMessageContentGame = "pushMessageContentGame" + TypePushMessageContentGameScore = "pushMessageContentGameScore" + TypePushMessageContentInvoice = "pushMessageContentInvoice" + TypePushMessageContentLocation = "pushMessageContentLocation" + TypePushMessageContentPhoto = "pushMessageContentPhoto" + TypePushMessageContentPoll = "pushMessageContentPoll" + TypePushMessageContentPremiumGiftCode = "pushMessageContentPremiumGiftCode" + TypePushMessageContentPremiumGiveaway = "pushMessageContentPremiumGiveaway" + TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken" + TypePushMessageContentSticker = "pushMessageContentSticker" + TypePushMessageContentStory = "pushMessageContentStory" + TypePushMessageContentText = "pushMessageContentText" + TypePushMessageContentVideo = "pushMessageContentVideo" + TypePushMessageContentVideoNote = "pushMessageContentVideoNote" + TypePushMessageContentVoiceNote = "pushMessageContentVoiceNote" + TypePushMessageContentBasicGroupChatCreate = "pushMessageContentBasicGroupChatCreate" + TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers" + TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto" + TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle" + TypePushMessageContentChatSetBackground = "pushMessageContentChatSetBackground" + TypePushMessageContentChatSetTheme = "pushMessageContentChatSetTheme" + TypePushMessageContentChatDeleteMember = "pushMessageContentChatDeleteMember" + TypePushMessageContentChatJoinByLink = "pushMessageContentChatJoinByLink" + TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest" + TypePushMessageContentRecurringPayment = "pushMessageContentRecurringPayment" + TypePushMessageContentSuggestProfilePhoto = "pushMessageContentSuggestProfilePhoto" + TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards" + TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum" + TypeNotificationTypeNewMessage = "notificationTypeNewMessage" + TypeNotificationTypeNewSecretChat = "notificationTypeNewSecretChat" + TypeNotificationTypeNewCall = "notificationTypeNewCall" + TypeNotificationTypeNewPushMessage = "notificationTypeNewPushMessage" + TypeNotificationGroupTypeMessages = "notificationGroupTypeMessages" + TypeNotificationGroupTypeMentions = "notificationGroupTypeMentions" + TypeNotificationGroupTypeSecretChat = "notificationGroupTypeSecretChat" + TypeNotificationGroupTypeCalls = "notificationGroupTypeCalls" + TypeNotificationSound = "notificationSound" + TypeNotificationSounds = "notificationSounds" + TypeNotification = "notification" + TypeNotificationGroup = "notificationGroup" + TypeOptionValueBoolean = "optionValueBoolean" + TypeOptionValueEmpty = "optionValueEmpty" + TypeOptionValueInteger = "optionValueInteger" + TypeOptionValueString = "optionValueString" + TypeJsonObjectMember = "jsonObjectMember" + TypeJsonValueNull = "jsonValueNull" + TypeJsonValueBoolean = "jsonValueBoolean" + TypeJsonValueNumber = "jsonValueNumber" + TypeJsonValueString = "jsonValueString" + TypeJsonValueArray = "jsonValueArray" + TypeJsonValueObject = "jsonValueObject" + TypeStoryPrivacySettingsEveryone = "storyPrivacySettingsEveryone" + TypeStoryPrivacySettingsContacts = "storyPrivacySettingsContacts" + TypeStoryPrivacySettingsCloseFriends = "storyPrivacySettingsCloseFriends" + TypeStoryPrivacySettingsSelectedUsers = "storyPrivacySettingsSelectedUsers" + 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" + TypeUserPrivacySettingShowBio = "userPrivacySettingShowBio" + TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" + TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" + TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" + TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber" + TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages" + TypeAccountTtl = "accountTtl" + TypeMessageAutoDeleteTime = "messageAutoDeleteTime" + TypeSessionTypeAndroid = "sessionTypeAndroid" + TypeSessionTypeApple = "sessionTypeApple" + TypeSessionTypeBrave = "sessionTypeBrave" + TypeSessionTypeChrome = "sessionTypeChrome" + TypeSessionTypeEdge = "sessionTypeEdge" + TypeSessionTypeFirefox = "sessionTypeFirefox" + TypeSessionTypeIpad = "sessionTypeIpad" + TypeSessionTypeIphone = "sessionTypeIphone" + TypeSessionTypeLinux = "sessionTypeLinux" + TypeSessionTypeMac = "sessionTypeMac" + TypeSessionTypeOpera = "sessionTypeOpera" + TypeSessionTypeSafari = "sessionTypeSafari" + TypeSessionTypeUbuntu = "sessionTypeUbuntu" + TypeSessionTypeUnknown = "sessionTypeUnknown" + TypeSessionTypeVivaldi = "sessionTypeVivaldi" + TypeSessionTypeWindows = "sessionTypeWindows" + TypeSessionTypeXbox = "sessionTypeXbox" + TypeSession = "session" + TypeSessions = "sessions" + TypeUnconfirmedSession = "unconfirmedSession" + TypeConnectedWebsite = "connectedWebsite" + TypeConnectedWebsites = "connectedWebsites" + TypeReportReasonSpam = "reportReasonSpam" + TypeReportReasonViolence = "reportReasonViolence" + TypeReportReasonPornography = "reportReasonPornography" + TypeReportReasonChildAbuse = "reportReasonChildAbuse" + TypeReportReasonCopyright = "reportReasonCopyright" + TypeReportReasonUnrelatedLocation = "reportReasonUnrelatedLocation" + TypeReportReasonFake = "reportReasonFake" + TypeReportReasonIllegalDrugs = "reportReasonIllegalDrugs" + TypeReportReasonPersonalDetails = "reportReasonPersonalDetails" + TypeReportReasonCustom = "reportReasonCustom" + TypeTargetChatCurrent = "targetChatCurrent" + TypeTargetChatChosen = "targetChatChosen" + TypeTargetChatInternalLink = "targetChatInternalLink" + TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" + TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot" + TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" + TypeInternalLinkTypeBackground = "internalLinkTypeBackground" + TypeInternalLinkTypeBotAddToChannel = "internalLinkTypeBotAddToChannel" + TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" + TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" + TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" + TypeInternalLinkTypeChatBoost = "internalLinkTypeChatBoost" + TypeInternalLinkTypeChatFolderInvite = "internalLinkTypeChatFolderInvite" + TypeInternalLinkTypeChatFolderSettings = "internalLinkTypeChatFolderSettings" + TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" + TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings" + TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings" + TypeInternalLinkTypeGame = "internalLinkTypeGame" + TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView" + TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice" + TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" + TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" + TypeInternalLinkTypeMessage = "internalLinkTypeMessage" + TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" + TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" + TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" + TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures" + TypeInternalLinkTypePremiumGiftCode = "internalLinkTypePremiumGiftCode" + TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" + TypeInternalLinkTypeProxy = "internalLinkTypeProxy" + TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" + TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" + TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases" + TypeInternalLinkTypeSettings = "internalLinkTypeSettings" + TypeInternalLinkTypeSideMenuBot = "internalLinkTypeSideMenuBot" + TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" + TypeInternalLinkTypeStory = "internalLinkTypeStory" + TypeInternalLinkTypeTheme = "internalLinkTypeTheme" + TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" + TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" + TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" + TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber" + TypeInternalLinkTypeUserToken = "internalLinkTypeUserToken" + TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat" + TypeInternalLinkTypeWebApp = "internalLinkTypeWebApp" + TypeMessageLink = "messageLink" + TypeMessageLinkInfo = "messageLinkInfo" + TypeChatBoostLink = "chatBoostLink" + TypeChatBoostLinkInfo = "chatBoostLinkInfo" + TypeBlockListMain = "blockListMain" + TypeBlockListStories = "blockListStories" + TypeFilePart = "filePart" + TypeFileTypeNone = "fileTypeNone" + TypeFileTypeAnimation = "fileTypeAnimation" + TypeFileTypeAudio = "fileTypeAudio" + TypeFileTypeDocument = "fileTypeDocument" + TypeFileTypeNotificationSound = "fileTypeNotificationSound" + TypeFileTypePhoto = "fileTypePhoto" + TypeFileTypePhotoStory = "fileTypePhotoStory" + TypeFileTypeProfilePhoto = "fileTypeProfilePhoto" + TypeFileTypeSecret = "fileTypeSecret" + TypeFileTypeSecretThumbnail = "fileTypeSecretThumbnail" + TypeFileTypeSecure = "fileTypeSecure" + TypeFileTypeSticker = "fileTypeSticker" + TypeFileTypeThumbnail = "fileTypeThumbnail" + TypeFileTypeUnknown = "fileTypeUnknown" + TypeFileTypeVideo = "fileTypeVideo" + TypeFileTypeVideoNote = "fileTypeVideoNote" + TypeFileTypeVideoStory = "fileTypeVideoStory" + TypeFileTypeVoiceNote = "fileTypeVoiceNote" + TypeFileTypeWallpaper = "fileTypeWallpaper" + TypeStorageStatisticsByFileType = "storageStatisticsByFileType" + TypeStorageStatisticsByChat = "storageStatisticsByChat" + TypeStorageStatistics = "storageStatistics" + TypeStorageStatisticsFast = "storageStatisticsFast" + TypeDatabaseStatistics = "databaseStatistics" + TypeNetworkTypeNone = "networkTypeNone" + TypeNetworkTypeMobile = "networkTypeMobile" + TypeNetworkTypeMobileRoaming = "networkTypeMobileRoaming" + TypeNetworkTypeWiFi = "networkTypeWiFi" + TypeNetworkTypeOther = "networkTypeOther" + TypeNetworkStatisticsEntryFile = "networkStatisticsEntryFile" + TypeNetworkStatisticsEntryCall = "networkStatisticsEntryCall" + TypeNetworkStatistics = "networkStatistics" + TypeAutoDownloadSettings = "autoDownloadSettings" + TypeAutoDownloadSettingsPresets = "autoDownloadSettingsPresets" + TypeAutosaveSettingsScopePrivateChats = "autosaveSettingsScopePrivateChats" + TypeAutosaveSettingsScopeGroupChats = "autosaveSettingsScopeGroupChats" + TypeAutosaveSettingsScopeChannelChats = "autosaveSettingsScopeChannelChats" + TypeAutosaveSettingsScopeChat = "autosaveSettingsScopeChat" + TypeScopeAutosaveSettings = "scopeAutosaveSettings" + TypeAutosaveSettingsException = "autosaveSettingsException" + TypeAutosaveSettings = "autosaveSettings" + TypeConnectionStateWaitingForNetwork = "connectionStateWaitingForNetwork" + TypeConnectionStateConnectingToProxy = "connectionStateConnectingToProxy" + TypeConnectionStateConnecting = "connectionStateConnecting" + TypeConnectionStateUpdating = "connectionStateUpdating" + TypeConnectionStateReady = "connectionStateReady" + TypeTopChatCategoryUsers = "topChatCategoryUsers" + TypeTopChatCategoryBots = "topChatCategoryBots" + TypeTopChatCategoryGroups = "topChatCategoryGroups" + TypeTopChatCategoryChannels = "topChatCategoryChannels" + TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots" + TypeTopChatCategoryCalls = "topChatCategoryCalls" + TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats" + TypeFoundPosition = "foundPosition" + TypeFoundPositions = "foundPositions" + TypeTMeUrlTypeUser = "tMeUrlTypeUser" + TypeTMeUrlTypeSupergroup = "tMeUrlTypeSupergroup" + TypeTMeUrlTypeChatInvite = "tMeUrlTypeChatInvite" + TypeTMeUrlTypeStickerSet = "tMeUrlTypeStickerSet" + TypeTMeUrl = "tMeUrl" + TypeTMeUrls = "tMeUrls" + TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats" + TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword" + TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber" + TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint" + TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup" + TypeSuggestedActionSetPassword = "suggestedActionSetPassword" + TypeSuggestedActionUpgradePremium = "suggestedActionUpgradePremium" + TypeSuggestedActionRestorePremium = "suggestedActionRestorePremium" + TypeSuggestedActionSubscribeToAnnualPremium = "suggestedActionSubscribeToAnnualPremium" + TypeCount = "count" + TypeText = "text" + TypeSeconds = "seconds" + TypeFileDownloadedPrefixSize = "fileDownloadedPrefixSize" + TypeDeepLinkInfo = "deepLinkInfo" + TypeTextParseModeMarkdown = "textParseModeMarkdown" + TypeTextParseModeHTML = "textParseModeHTML" + TypeProxyTypeSocks5 = "proxyTypeSocks5" + TypeProxyTypeHttp = "proxyTypeHttp" + TypeProxyTypeMtproto = "proxyTypeMtproto" + TypeProxy = "proxy" + TypeProxies = "proxies" + TypeInputSticker = "inputSticker" + TypeDateRange = "dateRange" + TypeStatisticalValue = "statisticalValue" + TypeStatisticalGraphData = "statisticalGraphData" + TypeStatisticalGraphAsync = "statisticalGraphAsync" + TypeStatisticalGraphError = "statisticalGraphError" + TypeChatStatisticsMessageInteractionInfo = "chatStatisticsMessageInteractionInfo" + TypeChatStatisticsMessageSenderInfo = "chatStatisticsMessageSenderInfo" + TypeChatStatisticsAdministratorActionsInfo = "chatStatisticsAdministratorActionsInfo" + TypeChatStatisticsInviterInfo = "chatStatisticsInviterInfo" + TypeChatStatisticsSupergroup = "chatStatisticsSupergroup" + TypeChatStatisticsChannel = "chatStatisticsChannel" + TypeMessageStatistics = "messageStatistics" + TypePoint = "point" + TypeVectorPathCommandLine = "vectorPathCommandLine" + TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" + TypeBotCommandScopeDefault = "botCommandScopeDefault" + TypeBotCommandScopeAllPrivateChats = "botCommandScopeAllPrivateChats" + TypeBotCommandScopeAllGroupChats = "botCommandScopeAllGroupChats" + TypeBotCommandScopeAllChatAdministrators = "botCommandScopeAllChatAdministrators" + TypeBotCommandScopeChat = "botCommandScopeChat" + TypeBotCommandScopeChatAdministrators = "botCommandScopeChatAdministrators" + TypeBotCommandScopeChatMember = "botCommandScopeChatMember" + TypeUpdateAuthorizationState = "updateAuthorizationState" + TypeUpdateNewMessage = "updateNewMessage" + TypeUpdateMessageSendAcknowledged = "updateMessageSendAcknowledged" + TypeUpdateMessageSendSucceeded = "updateMessageSendSucceeded" + TypeUpdateMessageSendFailed = "updateMessageSendFailed" + TypeUpdateMessageContent = "updateMessageContent" + TypeUpdateMessageEdited = "updateMessageEdited" + TypeUpdateMessageIsPinned = "updateMessageIsPinned" + TypeUpdateMessageInteractionInfo = "updateMessageInteractionInfo" + TypeUpdateMessageContentOpened = "updateMessageContentOpened" + TypeUpdateMessageMentionRead = "updateMessageMentionRead" + TypeUpdateMessageUnreadReactions = "updateMessageUnreadReactions" + TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed" + TypeUpdateNewChat = "updateNewChat" + TypeUpdateChatTitle = "updateChatTitle" + TypeUpdateChatPhoto = "updateChatPhoto" + TypeUpdateChatAccentColor = "updateChatAccentColor" + TypeUpdateChatBackgroundCustomEmoji = "updateChatBackgroundCustomEmoji" + TypeUpdateChatPermissions = "updateChatPermissions" + TypeUpdateChatLastMessage = "updateChatLastMessage" + TypeUpdateChatPosition = "updateChatPosition" + TypeUpdateChatReadInbox = "updateChatReadInbox" + TypeUpdateChatReadOutbox = "updateChatReadOutbox" + TypeUpdateChatActionBar = "updateChatActionBar" + TypeUpdateChatAvailableReactions = "updateChatAvailableReactions" + TypeUpdateChatDraftMessage = "updateChatDraftMessage" + TypeUpdateChatMessageSender = "updateChatMessageSender" + TypeUpdateChatMessageAutoDeleteTime = "updateChatMessageAutoDeleteTime" + TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" + TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests" + TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" + TypeUpdateChatBackground = "updateChatBackground" + TypeUpdateChatTheme = "updateChatTheme" + TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" + TypeUpdateChatUnreadReactionCount = "updateChatUnreadReactionCount" + TypeUpdateChatVideoChat = "updateChatVideoChat" + TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" + TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" + TypeUpdateChatIsTranslatable = "updateChatIsTranslatable" + TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" + TypeUpdateChatBlockList = "updateChatBlockList" + TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" + TypeUpdateChatFolders = "updateChatFolders" + TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" + TypeUpdateForumTopicInfo = "updateForumTopicInfo" + TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" + TypeUpdateNotification = "updateNotification" + TypeUpdateNotificationGroup = "updateNotificationGroup" + TypeUpdateActiveNotifications = "updateActiveNotifications" + TypeUpdateHavePendingNotifications = "updateHavePendingNotifications" + TypeUpdateDeleteMessages = "updateDeleteMessages" + TypeUpdateChatAction = "updateChatAction" + TypeUpdateUserStatus = "updateUserStatus" + TypeUpdateUser = "updateUser" + TypeUpdateBasicGroup = "updateBasicGroup" + TypeUpdateSupergroup = "updateSupergroup" + TypeUpdateSecretChat = "updateSecretChat" + TypeUpdateUserFullInfo = "updateUserFullInfo" + TypeUpdateBasicGroupFullInfo = "updateBasicGroupFullInfo" + TypeUpdateSupergroupFullInfo = "updateSupergroupFullInfo" + TypeUpdateServiceNotification = "updateServiceNotification" + TypeUpdateFile = "updateFile" + TypeUpdateFileGenerationStart = "updateFileGenerationStart" + TypeUpdateFileGenerationStop = "updateFileGenerationStop" + TypeUpdateFileDownloads = "updateFileDownloads" + TypeUpdateFileAddedToDownloads = "updateFileAddedToDownloads" + TypeUpdateFileDownload = "updateFileDownload" + TypeUpdateFileRemovedFromDownloads = "updateFileRemovedFromDownloads" + TypeUpdateCall = "updateCall" + TypeUpdateGroupCall = "updateGroupCall" + TypeUpdateGroupCallParticipant = "updateGroupCallParticipant" + TypeUpdateNewCallSignalingData = "updateNewCallSignalingData" + TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" + TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" + TypeUpdateUnreadChatCount = "updateUnreadChatCount" + TypeUpdateStory = "updateStory" + TypeUpdateStoryDeleted = "updateStoryDeleted" + TypeUpdateStorySendSucceeded = "updateStorySendSucceeded" + TypeUpdateStorySendFailed = "updateStorySendFailed" + TypeUpdateChatActiveStories = "updateChatActiveStories" + TypeUpdateStoryListChatCount = "updateStoryListChatCount" + TypeUpdateStoryStealthMode = "updateStoryStealthMode" + TypeUpdateOption = "updateOption" + TypeUpdateStickerSet = "updateStickerSet" + TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" + TypeUpdateTrendingStickerSets = "updateTrendingStickerSets" + TypeUpdateRecentStickers = "updateRecentStickers" + TypeUpdateFavoriteStickers = "updateFavoriteStickers" + TypeUpdateSavedAnimations = "updateSavedAnimations" + TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds" + TypeUpdateSelectedBackground = "updateSelectedBackground" + TypeUpdateChatThemes = "updateChatThemes" + TypeUpdateAccentColors = "updateAccentColors" + TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" + TypeUpdateConnectionState = "updateConnectionState" + TypeUpdateTermsOfService = "updateTermsOfService" + TypeUpdateUsersNearby = "updateUsersNearby" + TypeUpdateUnconfirmedSession = "updateUnconfirmedSession" + TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots" + TypeUpdateWebAppMessageSent = "updateWebAppMessageSent" + TypeUpdateActiveEmojiReactions = "updateActiveEmojiReactions" + TypeUpdateDefaultReactionType = "updateDefaultReactionType" + TypeUpdateDiceEmojis = "updateDiceEmojis" + TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" + TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" + TypeUpdateSuggestedActions = "updateSuggestedActions" + TypeUpdateAddChatMembersPrivacyForbidden = "updateAddChatMembersPrivacyForbidden" + TypeUpdateAutosaveSettings = "updateAutosaveSettings" + TypeUpdateNewInlineQuery = "updateNewInlineQuery" + TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult" + TypeUpdateNewCallbackQuery = "updateNewCallbackQuery" + TypeUpdateNewInlineCallbackQuery = "updateNewInlineCallbackQuery" + TypeUpdateNewShippingQuery = "updateNewShippingQuery" + TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery" + TypeUpdateNewCustomEvent = "updateNewCustomEvent" + TypeUpdateNewCustomQuery = "updateNewCustomQuery" + TypeUpdatePoll = "updatePoll" + TypeUpdatePollAnswer = "updatePollAnswer" + TypeUpdateChatMember = "updateChatMember" + TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest" + TypeUpdateChatBoost = "updateChatBoost" + TypeUpdates = "updates" + TypeLogStreamDefault = "logStreamDefault" + TypeLogStreamFile = "logStreamFile" + TypeLogStreamEmpty = "logStreamEmpty" + TypeLogVerbosityLevel = "logVerbosityLevel" + TypeLogTags = "logTags" + TypeUserSupportInfo = "userSupportInfo" + TypeTestInt = "testInt" + TypeTestString = "testString" + TypeTestBytes = "testBytes" + TypeTestVectorInt = "testVectorInt" + TypeTestVectorIntObject = "testVectorIntObject" + TypeTestVectorString = "testVectorString" + TypeTestVectorStringObject = "testVectorStringObject" ) // Provides information about the method by which an authentication code is delivered to the user @@ -1274,6 +1783,16 @@ type AuthenticationCodeType interface { AuthenticationCodeTypeType() string } +// Contains authentication data for a email address +type EmailAddressAuthentication interface { + EmailAddressAuthenticationType() string +} + +// Describes reset state of a email address +type EmailAddressResetState interface { + EmailAddressResetStateType() string +} + // Represents the current authorization state of the TDLib client type AuthorizationState interface { AuthorizationStateType() string @@ -1284,7 +1803,7 @@ type InputFile interface { InputFileType() string } -// Describes format of the thumbnail +// Describes format of a thumbnail type ThumbnailFormat interface { ThumbnailFormatType() string } @@ -1294,6 +1813,21 @@ type MaskPoint interface { MaskPointType() string } +// Describes format of a sticker +type StickerFormat interface { + StickerFormatType() string +} + +// Describes type of a sticker +type StickerType interface { + StickerTypeType() string +} + +// Contains full information about sticker type +type StickerFullType interface { + StickerFullTypeType() string +} + // Describes the type of a poll type PollType interface { PollTypeType() string @@ -1304,11 +1838,26 @@ type UserType interface { UserTypeType() string } +// Describes type of a sticker, which was used to create a chat photo +type ChatPhotoStickerType interface { + ChatPhotoStickerTypeType() string +} + // Describes a photo to be set as a user profile or chat photo type InputChatPhoto interface { InputChatPhotoType() string } +// Contains information about status of a user in a Telegram Premium giveaway +type PremiumGiveawayParticipantStatus interface { + PremiumGiveawayParticipantStatusType() string +} + +// Contains information about Telegram Premium giveaway +type PremiumGiveawayInfo interface { + PremiumGiveawayInfoType() string +} + // Provides information about the status of a member in a chat type ChatMemberStatus interface { ChatMemberStatusType() string @@ -1324,6 +1873,11 @@ type SupergroupMembersFilter interface { SupergroupMembersFilterType() string } +// Describes the type of a chat to which points an invite link +type InviteLinkChatType interface { + InviteLinkChatTypeType() string +} + // Describes the current secret chat state type SecretChatState interface { SecretChatStateType() string @@ -1334,9 +1888,14 @@ type MessageSender interface { MessageSenderType() string } -// Contains information about the origin of a forwarded message -type MessageForwardOrigin interface { - MessageForwardOriginType() string +// Contains information about the origin of a message +type MessageOrigin interface { + MessageOriginType() string +} + +// Describes type of message reaction +type ReactionType interface { + ReactionTypeType() string } // Contains information about the sending state of the message @@ -1344,6 +1903,26 @@ type MessageSendingState interface { MessageSendingStateType() string } +// Contains information about the message or the story a message is replying to +type MessageReplyTo interface { + MessageReplyToType() string +} + +// Contains information about the message or the story to be replied +type InputMessageReplyTo interface { + InputMessageReplyToType() string +} + +// Describes source of a message +type MessageSource interface { + MessageSourceType() string +} + +// Describes type of a message sponsor +type MessageSponsorType interface { + MessageSponsorTypeType() string +} + // Describes the types of chats to which notification settings are relevant type NotificationSettingsScope interface { NotificationSettingsScopeType() string @@ -1364,6 +1943,11 @@ type ChatSource interface { ChatSourceType() string } +// Describes reactions available in the chat +type ChatAvailableReactions interface { + ChatAvailableReactionsType() string +} + // Describes a type of public chats type PublicChatType interface { PublicChatTypeType() string @@ -1419,6 +2003,21 @@ type InputCredentials interface { InputCredentialsType() string } +// Contains information about a payment provider +type PaymentProvider interface { + PaymentProviderType() string +} + +// Describes an invoice to process +type InputInvoice interface { + InputInvoiceType() string +} + +// Describes a media, which is attached to an invoice +type MessageExtendedMedia interface { + MessageExtendedMediaType() string +} + // Contains the type of a Telegram Passport element type PassportElementType interface { PassportElementTypeType() string @@ -1459,6 +2058,11 @@ type MessageSchedulingState interface { MessageSchedulingStateType() string } +// Describes when a message will be self-destructed +type MessageSelfDestructType interface { + MessageSelfDestructTypeType() string +} + // The content of a message to send type InputMessageContent interface { InputMessageContentType() string @@ -1479,6 +2083,41 @@ type UserStatus interface { UserStatusType() string } +// Describes type of an emoji category +type EmojiCategoryType interface { + EmojiCategoryTypeType() string +} + +// Describes type of a clickable rectangle area on a story media +type StoryAreaType interface { + StoryAreaTypeType() string +} + +// Describes type of a clickable rectangle area on a story media to be added +type InputStoryAreaType interface { + InputStoryAreaTypeType() string +} + +// Contains the content of a story +type StoryContent interface { + StoryContentType() string +} + +// The content of a story to send +type InputStoryContent interface { + InputStoryContentType() string +} + +// Describes a list of stories +type StoryList interface { + StoryListType() string +} + +// Describes source of a chat boost +type ChatBoostSource interface { + ChatBoostSourceType() string +} + // Describes the reason why a call was discarded type CallDiscardReason interface { CallDiscardReasonType() string @@ -1504,11 +2143,26 @@ type CallProblem interface { CallProblemType() string } +// Contains settings for Firebase Authentication in the official applications +type FirebaseAuthenticationSettings interface { + FirebaseAuthenticationSettingsType() string +} + // Contains animated stickers which must be used for dice animation rendering type DiceStickers interface { DiceStickersType() string } +// Describes result of speech recognition in a voice note +type SpeechRecognitionResult interface { + SpeechRecognitionResultType() string +} + +// Describes a reason why a bot was allowed to write messages to the current user +type BotWriteAccessAllowReason interface { + BotWriteAccessAllowReasonType() string +} + // Represents a single result of an inline query; for bots only type InputInlineQueryResult interface { InputInlineQueryResultType() string @@ -1519,6 +2173,11 @@ type InlineQueryResult interface { InlineQueryResultType() string } +// Represents a type of a button in results of inline query +type InlineQueryResultsButtonType interface { + InlineQueryResultsButtonTypeType() string +} + // Represents a payload of a callback query type CallbackQueryPayload interface { CallbackQueryPayloadType() string @@ -1534,6 +2193,36 @@ type LanguagePackStringValue interface { LanguagePackStringValueType() string } +// Describes type of a limit, increased for Premium users +type PremiumLimitType interface { + PremiumLimitTypeType() string +} + +// Describes a feature available to Premium users +type PremiumFeature interface { + PremiumFeatureType() string +} + +// Describes a story feature available to Premium users +type PremiumStoryFeature interface { + PremiumStoryFeatureType() string +} + +// Describes a source from which the Premium features screen is opened +type PremiumSource interface { + PremiumSourceType() string +} + +// Describes a purpose of an in-store payment +type StorePaymentPurpose interface { + StorePaymentPurposeType() string +} + +// Describes a purpose of a payment toward Telegram +type TelegramPaymentPurpose interface { + TelegramPaymentPurposeType() string +} + // Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org type DeviceToken interface { DeviceTokenType() string @@ -1554,6 +2243,11 @@ type InputBackground interface { InputBackgroundType() string } +// Represents result of checking whether the current user can send a story in the specific chat +type CanSendStoryResult interface { + CanSendStoryResultType() 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 @@ -1604,7 +2298,12 @@ type JsonValue interface { JsonValueType() string } -// Represents a single rule for managing privacy settings +// Describes privacy settings of a story +type StoryPrivacySettings interface { + StoryPrivacySettingsType() string +} + +// Represents a single rule for managing user privacy settings type UserPrivacySettingRule interface { UserPrivacySettingRuleType() string } @@ -1614,16 +2313,31 @@ type UserPrivacySetting interface { UserPrivacySettingType() string } -// Describes the reason why a chat is reported -type ChatReportReason interface { - ChatReportReasonType() string +// Represents the type of a session +type SessionType interface { + SessionTypeType() string } -// Describes an internal https://t.me or tg: link, which must be processed by the app in a special way +// Describes the reason why a chat is reported +type ReportReason interface { + ReportReasonType() string +} + +// Describes the target chat to be opened +type TargetChat interface { + TargetChatType() string +} + +// Describes an internal https://t.me or tg: link, which must be processed by the application in a special way type InternalLinkType interface { InternalLinkTypeType() string } +// Describes a type of a block list +type BlockList interface { + BlockListType() string +} + // Represents the type of a file type FileType interface { FileTypeType() string @@ -1639,6 +2353,11 @@ type NetworkStatisticsEntry interface { NetworkStatisticsEntryType() string } +// Describes scope of autosave settings +type AutosaveSettingsScope interface { + AutosaveSettingsScopeType() string +} + // Describes the current state of the connection to Telegram servers type ConnectionState interface { ConnectionStateType() string @@ -1659,7 +2378,7 @@ type SuggestedAction interface { SuggestedActionType() string } -// Describes the way the text needs to be parsed for TextEntities +// Describes the way the text needs to be parsed for text entities type TextParseMode interface { TextParseModeType() string } @@ -1669,11 +2388,6 @@ type ProxyType interface { ProxyTypeType() string } -// Describes a sticker that needs to be added to a sticker set -type InputSticker interface { - InputStickerType() string -} - // Describes a statistical graph type StatisticalGraph interface { StatisticalGraphType() string @@ -1750,57 +2464,6 @@ func (*Ok) GetType() string { return TypeOk } -// Contains parameters for TDLib initialization -type TdlibParameters struct { - meta - // If set to true, the Telegram test environment will be used instead of the production environment - UseTestDc bool `json:"use_test_dc"` - // The path to the directory for the persistent database; if empty, the current working directory will be used - DatabaseDirectory string `json:"database_directory"` - // The path to the directory for storing files; if empty, database_directory will be used - FilesDirectory string `json:"files_directory"` - // If set to true, information about downloaded and uploaded files will be saved between application restarts - UseFileDatabase bool `json:"use_file_database"` - // If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database - UseChatInfoDatabase bool `json:"use_chat_info_database"` - // If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database - UseMessageDatabase bool `json:"use_message_database"` - // If set to true, support for secret chats will be enabled - UseSecretChats bool `json:"use_secret_chats"` - // Application identifier for Telegram API access, which can be obtained at https://my.telegram.org - ApiId int32 `json:"api_id"` - // Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org - ApiHash string `json:"api_hash"` - // IETF language tag of the user's operating system language; must be non-empty - SystemLanguageCode string `json:"system_language_code"` - // Model of the device the application is being run on; must be non-empty - DeviceModel string `json:"device_model"` - // Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib - SystemVersion string `json:"system_version"` - // Application version; must be non-empty - ApplicationVersion string `json:"application_version"` - // If set to true, old files will automatically be deleted - EnableStorageOptimizer bool `json:"enable_storage_optimizer"` - // If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name - IgnoreFileNames bool `json:"ignore_file_names"` -} - -func (entity *TdlibParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TdlibParameters - - return json.Marshal((*stub)(entity)) -} - -func (*TdlibParameters) GetClass() string { - return ClassTdlibParameters -} - -func (*TdlibParameters) GetType() string { - return TypeTdlibParameters -} - // An authentication code is delivered via a private Telegram message, which can be viewed from another active session type AuthenticationCodeTypeTelegramMessage struct { meta @@ -1828,7 +2491,7 @@ func (*AuthenticationCodeTypeTelegramMessage) AuthenticationCodeTypeType() strin return TypeAuthenticationCodeTypeTelegramMessage } -// An authentication code is delivered via an SMS message to the specified phone number +// An authentication code is delivered via an SMS message to the specified phone number; applications may not receive this type of code type AuthenticationCodeTypeSms struct { meta // Length of the code @@ -1938,6 +2601,95 @@ func (*AuthenticationCodeTypeMissedCall) AuthenticationCodeTypeType() string { return TypeAuthenticationCodeTypeMissedCall } +// An authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT +type AuthenticationCodeTypeFragment struct { + meta + // URL to open to receive the code + Url string `json:"url"` + // Length of the code + Length int32 `json:"length"` +} + +func (entity *AuthenticationCodeTypeFragment) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthenticationCodeTypeFragment + + return json.Marshal((*stub)(entity)) +} + +func (*AuthenticationCodeTypeFragment) GetClass() string { + return ClassAuthenticationCodeType +} + +func (*AuthenticationCodeTypeFragment) GetType() string { + return TypeAuthenticationCodeTypeFragment +} + +func (*AuthenticationCodeTypeFragment) AuthenticationCodeTypeType() string { + return TypeAuthenticationCodeTypeFragment +} + +// An authentication code is delivered via Firebase Authentication to the official Android application +type AuthenticationCodeTypeFirebaseAndroid struct { + meta + // Nonce to pass to the SafetyNet Attestation API + Nonce []byte `json:"nonce"` + // Length of the code + Length int32 `json:"length"` +} + +func (entity *AuthenticationCodeTypeFirebaseAndroid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthenticationCodeTypeFirebaseAndroid + + return json.Marshal((*stub)(entity)) +} + +func (*AuthenticationCodeTypeFirebaseAndroid) GetClass() string { + return ClassAuthenticationCodeType +} + +func (*AuthenticationCodeTypeFirebaseAndroid) GetType() string { + return TypeAuthenticationCodeTypeFirebaseAndroid +} + +func (*AuthenticationCodeTypeFirebaseAndroid) AuthenticationCodeTypeType() string { + return TypeAuthenticationCodeTypeFirebaseAndroid +} + +// An authentication code is delivered via Firebase Authentication to the official iOS application +type AuthenticationCodeTypeFirebaseIos struct { + meta + // Receipt of successful application token validation to compare with receipt from push notification + Receipt string `json:"receipt"` + // Time after the next authentication method is supposed to be used if verification push notification isn't received, in seconds + PushTimeout int32 `json:"push_timeout"` + // Length of the code + Length int32 `json:"length"` +} + +func (entity *AuthenticationCodeTypeFirebaseIos) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthenticationCodeTypeFirebaseIos + + return json.Marshal((*stub)(entity)) +} + +func (*AuthenticationCodeTypeFirebaseIos) GetClass() string { + return ClassAuthenticationCodeType +} + +func (*AuthenticationCodeTypeFirebaseIos) GetType() string { + return TypeAuthenticationCodeTypeFirebaseIos +} + +func (*AuthenticationCodeTypeFirebaseIos) AuthenticationCodeTypeType() string { + return TypeAuthenticationCodeTypeFirebaseIos +} + // Information about the authentication code that was sent type AuthenticationCodeInfo struct { meta @@ -2017,6 +2769,141 @@ func (*EmailAddressAuthenticationCodeInfo) GetType() string { return TypeEmailAddressAuthenticationCodeInfo } +// An authentication code delivered to a user's email address +type EmailAddressAuthenticationCode struct { + meta + // The code + Code string `json:"code"` +} + +func (entity *EmailAddressAuthenticationCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmailAddressAuthenticationCode + + return json.Marshal((*stub)(entity)) +} + +func (*EmailAddressAuthenticationCode) GetClass() string { + return ClassEmailAddressAuthentication +} + +func (*EmailAddressAuthenticationCode) GetType() string { + return TypeEmailAddressAuthenticationCode +} + +func (*EmailAddressAuthenticationCode) EmailAddressAuthenticationType() string { + return TypeEmailAddressAuthenticationCode +} + +// An authentication token received through Apple ID +type EmailAddressAuthenticationAppleId struct { + meta + // The token + Token string `json:"token"` +} + +func (entity *EmailAddressAuthenticationAppleId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmailAddressAuthenticationAppleId + + return json.Marshal((*stub)(entity)) +} + +func (*EmailAddressAuthenticationAppleId) GetClass() string { + return ClassEmailAddressAuthentication +} + +func (*EmailAddressAuthenticationAppleId) GetType() string { + return TypeEmailAddressAuthenticationAppleId +} + +func (*EmailAddressAuthenticationAppleId) EmailAddressAuthenticationType() string { + return TypeEmailAddressAuthenticationAppleId +} + +// An authentication token received through Google ID +type EmailAddressAuthenticationGoogleId struct { + meta + // The token + Token string `json:"token"` +} + +func (entity *EmailAddressAuthenticationGoogleId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmailAddressAuthenticationGoogleId + + return json.Marshal((*stub)(entity)) +} + +func (*EmailAddressAuthenticationGoogleId) GetClass() string { + return ClassEmailAddressAuthentication +} + +func (*EmailAddressAuthenticationGoogleId) GetType() string { + return TypeEmailAddressAuthenticationGoogleId +} + +func (*EmailAddressAuthenticationGoogleId) EmailAddressAuthenticationType() string { + return TypeEmailAddressAuthenticationGoogleId +} + +// 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 +type EmailAddressResetStateAvailable struct { + meta + // Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium + WaitPeriod int32 `json:"wait_period"` +} + +func (entity *EmailAddressResetStateAvailable) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmailAddressResetStateAvailable + + return json.Marshal((*stub)(entity)) +} + +func (*EmailAddressResetStateAvailable) GetClass() string { + return ClassEmailAddressResetState +} + +func (*EmailAddressResetStateAvailable) GetType() string { + return TypeEmailAddressResetStateAvailable +} + +func (*EmailAddressResetStateAvailable) EmailAddressResetStateType() string { + return TypeEmailAddressResetStateAvailable +} + +// Email address reset has already been requested. Call resetAuthenticationEmailAddress to check whether immediate reset is possible +type EmailAddressResetStatePending struct { + meta + // Left time before the email address will be reset, in seconds. updateAuthorizationState is not sent when this field changes + ResetIn int32 `json:"reset_in"` +} + +func (entity *EmailAddressResetStatePending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmailAddressResetStatePending + + return json.Marshal((*stub)(entity)) +} + +func (*EmailAddressResetStatePending) GetClass() string { + return ClassEmailAddressResetState +} + +func (*EmailAddressResetStatePending) GetType() string { + return TypeEmailAddressResetStatePending +} + +func (*EmailAddressResetStatePending) EmailAddressResetStateType() string { + return TypeEmailAddressResetStatePending +} + // Represents a part of the text that needs to be formatted in some unusual way type TextEntity struct { meta @@ -2093,7 +2980,7 @@ type FormattedText struct { meta // The text Text string `json:"text"` - // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other + // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other Entities []*TextEntity `json:"entities"` } @@ -2118,7 +3005,7 @@ type TermsOfService struct { meta // Text of the terms of service Text *FormattedText `json:"text"` - // The minimum age of a user to be able to accept the terms; 0 if any + // The minimum age of a user to be able to accept the terms; 0 if age isn't restricted MinUserAge int32 `json:"min_user_age"` // True, if a blocking popup with terms of service must be shown to the user ShowPopup bool `json:"show_popup"` @@ -2140,7 +3027,7 @@ func (*TermsOfService) GetType() string { return TypeTermsOfService } -// TDLib needs TdlibParameters for initialization +// Initialization parameters are needed. Call setTdlibParameters to provide them type AuthorizationStateWaitTdlibParameters struct { meta } @@ -2165,34 +3052,7 @@ func (*AuthorizationStateWaitTdlibParameters) AuthorizationStateType() string { return TypeAuthorizationStateWaitTdlibParameters } -// TDLib needs an encryption key to decrypt the local database -type AuthorizationStateWaitEncryptionKey struct { - meta - // True, if the database is currently encrypted - IsEncrypted bool `json:"is_encrypted"` -} - -func (entity *AuthorizationStateWaitEncryptionKey) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AuthorizationStateWaitEncryptionKey - - return json.Marshal((*stub)(entity)) -} - -func (*AuthorizationStateWaitEncryptionKey) GetClass() string { - return ClassAuthorizationState -} - -func (*AuthorizationStateWaitEncryptionKey) GetType() string { - return TypeAuthorizationStateWaitEncryptionKey -} - -func (*AuthorizationStateWaitEncryptionKey) AuthorizationStateType() string { - return TypeAuthorizationStateWaitEncryptionKey -} - -// TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options +// TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options type AuthorizationStateWaitPhoneNumber struct { meta } @@ -2217,7 +3077,92 @@ func (*AuthorizationStateWaitPhoneNumber) AuthorizationStateType() string { return TypeAuthorizationStateWaitPhoneNumber } -// TDLib needs the user's authentication code to authorize +// TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed +type AuthorizationStateWaitEmailAddress struct { + meta + // True, if authorization through Apple ID is allowed + AllowAppleId bool `json:"allow_apple_id"` + // True, if authorization through Google ID is allowed + AllowGoogleId bool `json:"allow_google_id"` +} + +func (entity *AuthorizationStateWaitEmailAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthorizationStateWaitEmailAddress + + return json.Marshal((*stub)(entity)) +} + +func (*AuthorizationStateWaitEmailAddress) GetClass() string { + return ClassAuthorizationState +} + +func (*AuthorizationStateWaitEmailAddress) GetType() string { + return TypeAuthorizationStateWaitEmailAddress +} + +func (*AuthorizationStateWaitEmailAddress) AuthorizationStateType() string { + return TypeAuthorizationStateWaitEmailAddress +} + +// TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code +type AuthorizationStateWaitEmailCode struct { + meta + // True, if authorization through Apple ID is allowed + AllowAppleId bool `json:"allow_apple_id"` + // True, if authorization through Google ID is allowed + AllowGoogleId bool `json:"allow_google_id"` + // Information about the sent authentication code + CodeInfo *EmailAddressAuthenticationCodeInfo `json:"code_info"` + // Reset state of the email address; may be null if the email address can't be reset + EmailAddressResetState EmailAddressResetState `json:"email_address_reset_state"` +} + +func (entity *AuthorizationStateWaitEmailCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthorizationStateWaitEmailCode + + return json.Marshal((*stub)(entity)) +} + +func (*AuthorizationStateWaitEmailCode) GetClass() string { + return ClassAuthorizationState +} + +func (*AuthorizationStateWaitEmailCode) GetType() string { + return TypeAuthorizationStateWaitEmailCode +} + +func (*AuthorizationStateWaitEmailCode) AuthorizationStateType() string { + return TypeAuthorizationStateWaitEmailCode +} + +func (authorizationStateWaitEmailCode *AuthorizationStateWaitEmailCode) UnmarshalJSON(data []byte) error { + var tmp struct { + AllowAppleId bool `json:"allow_apple_id"` + AllowGoogleId bool `json:"allow_google_id"` + CodeInfo *EmailAddressAuthenticationCodeInfo `json:"code_info"` + EmailAddressResetState json.RawMessage `json:"email_address_reset_state"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + authorizationStateWaitEmailCode.AllowAppleId = tmp.AllowAppleId + authorizationStateWaitEmailCode.AllowGoogleId = tmp.AllowGoogleId + authorizationStateWaitEmailCode.CodeInfo = tmp.CodeInfo + + fieldEmailAddressResetState, _ := UnmarshalEmailAddressResetState(tmp.EmailAddressResetState) + authorizationStateWaitEmailCode.EmailAddressResetState = fieldEmailAddressResetState + + return nil +} + +// TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code type AuthorizationStateWaitCode struct { meta // Information about the authorization code that was sent @@ -2271,7 +3216,7 @@ func (*AuthorizationStateWaitOtherDeviceConfirmation) AuthorizationStateType() s return TypeAuthorizationStateWaitOtherDeviceConfirmation } -// The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration +// The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data type AuthorizationStateWaitRegistration struct { meta // Telegram terms of service @@ -2298,13 +3243,15 @@ func (*AuthorizationStateWaitRegistration) AuthorizationStateType() string { return TypeAuthorizationStateWaitRegistration } -// The user has been authorized, but needs to enter a password to start using the application +// The user has been authorized, but needs to enter a 2-step verification password to start using the application. Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week type AuthorizationStateWaitPassword struct { meta // Hint for the password; may be empty PasswordHint string `json:"password_hint"` // True, if a recovery email address has been set up HasRecoveryEmailAddress bool `json:"has_recovery_email_address"` + // True, if some Telegram Passport elements were saved + HasPassportData bool `json:"has_passport_data"` // Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent RecoveryEmailAddressPattern string `json:"recovery_email_address_pattern"` } @@ -2329,7 +3276,7 @@ func (*AuthorizationStateWaitPassword) AuthorizationStateType() string { return TypeAuthorizationStateWaitPassword } -// The user has been successfully authorized. TDLib is now ready to answer queries +// The user has been successfully authorized. TDLib is now ready to answer general requests type AuthorizationStateReady struct { meta } @@ -2442,7 +3389,9 @@ type PasswordState struct { HasPassportData bool `json:"has_passport_data"` // Information about the recovery email address to which the confirmation email was sent; may be null RecoveryEmailAddressCodeInfo *EmailAddressAuthenticationCodeInfo `json:"recovery_email_address_code_info"` - // If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword + // Pattern of the email address set up for logging in + LoginEmailAddressPattern string `json:"login_email_address_pattern"` + // If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword PendingResetDate int32 `json:"pending_reset_date"` } @@ -2524,11 +3473,11 @@ type LocalFile struct { // True, if the local copy is fully available IsDownloadingCompleted bool `json:"is_downloading_completed"` // Download will be started from this offset. downloaded_prefix_size is calculated from this offset - DownloadOffset int32 `json:"download_offset"` + DownloadOffset int64 `json:"download_offset"` // If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes - DownloadedPrefixSize int32 `json:"downloaded_prefix_size"` + DownloadedPrefixSize int64 `json:"downloaded_prefix_size"` // Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage - DownloadedSize int32 `json:"downloaded_size"` + DownloadedSize int64 `json:"downloaded_size"` } func (entity *LocalFile) MarshalJSON() ([]byte, error) { @@ -2550,7 +3499,7 @@ func (*LocalFile) GetType() string { // Represents a remote file type RemoteFile struct { meta - // Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location + // Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the identifier starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location Id string `json:"id"` // Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time UniqueId string `json:"unique_id"` @@ -2559,7 +3508,7 @@ type RemoteFile struct { // True, if a remote copy is fully available IsUploadingCompleted bool `json:"is_uploading_completed"` // Size of the remote available part of the file, in bytes; 0 if unknown - UploadedSize int32 `json:"uploaded_size"` + UploadedSize int64 `json:"uploaded_size"` } func (entity *RemoteFile) MarshalJSON() ([]byte, error) { @@ -2584,9 +3533,9 @@ type File struct { // Unique file identifier Id int32 `json:"id"` // File size, in bytes; 0 if unknown - Size int32 `json:"size"` + Size int64 `json:"size"` // Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress - ExpectedSize int32 `json:"expected_size"` + ExpectedSize int64 `json:"expected_size"` // Information about the local copy of the file Local *LocalFile `json:"local"` // Information about the remote copy of the file @@ -2609,7 +3558,7 @@ func (*File) GetType() string { return TypeFile } -// A file defined by its unique ID +// A file defined by its unique identifier type InputFileId struct { meta // Unique file identifier @@ -2636,7 +3585,7 @@ func (*InputFileId) InputFileType() string { return TypeInputFileId } -// A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application +// A file defined by its remote identifier. The remote identifier is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application type InputFileRemote struct { meta // Remote file identifier @@ -2698,7 +3647,7 @@ type InputFileGenerated struct { // String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage Conversion string `json:"conversion"` // Expected size of the generated file, in bytes; 0 if unknown - ExpectedSize int32 `json:"expected_size"` + ExpectedSize int64 `json:"expected_size"` } func (entity *InputFileGenerated) MarshalJSON() ([]byte, error) { @@ -2804,57 +3753,7 @@ func (*ThumbnailFormatJpeg) ThumbnailFormatType() string { return TypeThumbnailFormatJpeg } -// The thumbnail is in PNG format. It will be used only for background patterns -type ThumbnailFormatPng struct { - meta -} - -func (entity *ThumbnailFormatPng) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThumbnailFormatPng - - return json.Marshal((*stub)(entity)) -} - -func (*ThumbnailFormatPng) GetClass() string { - return ClassThumbnailFormat -} - -func (*ThumbnailFormatPng) GetType() string { - return TypeThumbnailFormatPng -} - -func (*ThumbnailFormatPng) ThumbnailFormatType() string { - return TypeThumbnailFormatPng -} - -// The thumbnail is in WEBP format. It will be used only for some stickers -type ThumbnailFormatWebp struct { - meta -} - -func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThumbnailFormatWebp - - return json.Marshal((*stub)(entity)) -} - -func (*ThumbnailFormatWebp) GetClass() string { - return ClassThumbnailFormat -} - -func (*ThumbnailFormatWebp) GetType() string { - return TypeThumbnailFormatWebp -} - -func (*ThumbnailFormatWebp) ThumbnailFormatType() string { - return TypeThumbnailFormatWebp -} - -// The thumbnail is in static GIF format. It will be used only for some bot inline results +// The thumbnail is in static GIF format. It will be used only for some bot inline query results type ThumbnailFormatGif struct { meta } @@ -2879,31 +3778,6 @@ func (*ThumbnailFormatGif) ThumbnailFormatType() string { return TypeThumbnailFormatGif } -// The thumbnail is in TGS format. It will be used only for animated sticker sets -type ThumbnailFormatTgs struct { - meta -} - -func (entity *ThumbnailFormatTgs) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThumbnailFormatTgs - - return json.Marshal((*stub)(entity)) -} - -func (*ThumbnailFormatTgs) GetClass() string { - return ClassThumbnailFormat -} - -func (*ThumbnailFormatTgs) GetType() string { - return TypeThumbnailFormatTgs -} - -func (*ThumbnailFormatTgs) ThumbnailFormatType() string { - return TypeThumbnailFormatTgs -} - // The thumbnail is in MPEG4 format. It will be used only for some animations and videos type ThumbnailFormatMpeg4 struct { meta @@ -2929,6 +3803,106 @@ func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string { return TypeThumbnailFormatMpeg4 } +// The thumbnail is in PNG format. It will be used only for background patterns +type ThumbnailFormatPng struct { + meta +} + +func (entity *ThumbnailFormatPng) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatPng + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatPng) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatPng) GetType() string { + return TypeThumbnailFormatPng +} + +func (*ThumbnailFormatPng) ThumbnailFormatType() string { + return TypeThumbnailFormatPng +} + +// The thumbnail is in TGS format. It will be used only for TGS sticker sets +type ThumbnailFormatTgs struct { + meta +} + +func (entity *ThumbnailFormatTgs) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatTgs + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatTgs) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatTgs) GetType() string { + return TypeThumbnailFormatTgs +} + +func (*ThumbnailFormatTgs) ThumbnailFormatType() string { + return TypeThumbnailFormatTgs +} + +// The thumbnail is in WEBM format. It will be used only for WEBM sticker sets +type ThumbnailFormatWebm struct { + meta +} + +func (entity *ThumbnailFormatWebm) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatWebm + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatWebm) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatWebm) GetType() string { + return TypeThumbnailFormatWebm +} + +func (*ThumbnailFormatWebm) ThumbnailFormatType() string { + return TypeThumbnailFormatWebm +} + +// The thumbnail is in WEBP format. It will be used only for some stickers +type ThumbnailFormatWebp struct { + meta +} + +func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThumbnailFormatWebp + + return json.Marshal((*stub)(entity)) +} + +func (*ThumbnailFormatWebp) GetClass() string { + return ClassThumbnailFormat +} + +func (*ThumbnailFormatWebp) GetType() string { + return TypeThumbnailFormatWebp +} + +func (*ThumbnailFormatWebp) ThumbnailFormatType() string { + return TypeThumbnailFormatWebp +} + // Represents a thumbnail type Thumbnail struct { meta @@ -3133,6 +4107,239 @@ func (maskPosition *MaskPosition) UnmarshalJSON(data []byte) error { return nil } +// The sticker is an image in WEBP format +type StickerFormatWebp struct { + meta +} + +func (entity *StickerFormatWebp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFormatWebp + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFormatWebp) GetClass() string { + return ClassStickerFormat +} + +func (*StickerFormatWebp) GetType() string { + return TypeStickerFormatWebp +} + +func (*StickerFormatWebp) StickerFormatType() string { + return TypeStickerFormatWebp +} + +// The sticker is an animation in TGS format +type StickerFormatTgs struct { + meta +} + +func (entity *StickerFormatTgs) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFormatTgs + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFormatTgs) GetClass() string { + return ClassStickerFormat +} + +func (*StickerFormatTgs) GetType() string { + return TypeStickerFormatTgs +} + +func (*StickerFormatTgs) StickerFormatType() string { + return TypeStickerFormatTgs +} + +// The sticker is a video in WEBM format +type StickerFormatWebm struct { + meta +} + +func (entity *StickerFormatWebm) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFormatWebm + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFormatWebm) GetClass() string { + return ClassStickerFormat +} + +func (*StickerFormatWebm) GetType() string { + return TypeStickerFormatWebm +} + +func (*StickerFormatWebm) StickerFormatType() string { + return TypeStickerFormatWebm +} + +// The sticker is a regular sticker +type StickerTypeRegular struct { + meta +} + +func (entity *StickerTypeRegular) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerTypeRegular + + return json.Marshal((*stub)(entity)) +} + +func (*StickerTypeRegular) GetClass() string { + return ClassStickerType +} + +func (*StickerTypeRegular) GetType() string { + return TypeStickerTypeRegular +} + +func (*StickerTypeRegular) StickerTypeType() string { + return TypeStickerTypeRegular +} + +// The sticker is a mask in WEBP format to be placed on photos or videos +type StickerTypeMask struct { + meta +} + +func (entity *StickerTypeMask) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerTypeMask + + return json.Marshal((*stub)(entity)) +} + +func (*StickerTypeMask) GetClass() string { + return ClassStickerType +} + +func (*StickerTypeMask) GetType() string { + return TypeStickerTypeMask +} + +func (*StickerTypeMask) StickerTypeType() string { + return TypeStickerTypeMask +} + +// The sticker is a custom emoji to be used inside message text and caption +type StickerTypeCustomEmoji struct { + meta +} + +func (entity *StickerTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*StickerTypeCustomEmoji) GetClass() string { + return ClassStickerType +} + +func (*StickerTypeCustomEmoji) GetType() string { + return TypeStickerTypeCustomEmoji +} + +func (*StickerTypeCustomEmoji) StickerTypeType() string { + return TypeStickerTypeCustomEmoji +} + +// The sticker is a regular sticker +type StickerFullTypeRegular struct { + meta + // Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker + PremiumAnimation *File `json:"premium_animation"` +} + +func (entity *StickerFullTypeRegular) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFullTypeRegular + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFullTypeRegular) GetClass() string { + return ClassStickerFullType +} + +func (*StickerFullTypeRegular) GetType() string { + return TypeStickerFullTypeRegular +} + +func (*StickerFullTypeRegular) StickerFullTypeType() string { + return TypeStickerFullTypeRegular +} + +// The sticker is a mask in WEBP format to be placed on photos or videos +type StickerFullTypeMask struct { + meta + // Position where the mask is placed; may be null + MaskPosition *MaskPosition `json:"mask_position"` +} + +func (entity *StickerFullTypeMask) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFullTypeMask + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFullTypeMask) GetClass() string { + return ClassStickerFullType +} + +func (*StickerFullTypeMask) GetType() string { + return TypeStickerFullTypeMask +} + +func (*StickerFullTypeMask) StickerFullTypeType() string { + return TypeStickerFullTypeMask +} + +// The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji +type StickerFullTypeCustomEmoji struct { + meta + // Identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` + // True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places + NeedsRepainting bool `json:"needs_repainting"` +} + +func (entity *StickerFullTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerFullTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*StickerFullTypeCustomEmoji) GetClass() string { + return ClassStickerFullType +} + +func (*StickerFullTypeCustomEmoji) GetType() string { + return TypeStickerFullTypeCustomEmoji +} + +func (*StickerFullTypeCustomEmoji) StickerFullTypeType() string { + return TypeStickerFullTypeCustomEmoji +} + // Represents a closed vector path. The path begins at the end point of the last command type ClosedVectorPath struct { meta @@ -3313,8 +4520,10 @@ type Audio struct { MimeType string `json:"mime_type"` // The minithumbnail of the album cover; may be null AlbumCoverMinithumbnail *Minithumbnail `json:"album_cover_minithumbnail"` - // The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null + // The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null AlbumCoverThumbnail *Thumbnail `json:"album_cover_thumbnail"` + // Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate + ExternalAlbumCovers []*Thumbnail `json:"external_album_covers"` // File containing the audio Audio *File `json:"audio"` } @@ -3396,7 +4605,9 @@ func (*Photo) GetType() string { // Describes a sticker type Sticker struct { meta - // The identifier of the sticker set to which the sticker belongs; 0 if none + // Unique sticker identifier within the set; 0 if none + Id JsonInt64 `json:"id"` + // Identifier of the sticker set to which the sticker belongs; 0 if none SetId JsonInt64 `json:"set_id"` // Sticker width; as defined by the sender Width int32 `json:"width"` @@ -3404,12 +4615,10 @@ type Sticker struct { Height int32 `json:"height"` // Emoji corresponding to the sticker Emoji string `json:"emoji"` - // True, if the sticker is an animated sticker in TGS format - IsAnimated bool `json:"is_animated"` - // True, if the sticker is a mask - IsMask bool `json:"is_mask"` - // Position where the mask is placed; may be null - MaskPosition *MaskPosition `json:"mask_position"` + // Sticker format + Format StickerFormat `json:"format"` + // Sticker's full type + FullType StickerFullType `json:"full_type"` // Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner Outline []*ClosedVectorPath `json:"outline"` // Sticker thumbnail in WEBP or JPEG format; may be null @@ -3434,6 +4643,43 @@ func (*Sticker) GetType() string { return TypeSticker } +func (sticker *Sticker) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + SetId JsonInt64 `json:"set_id"` + Width int32 `json:"width"` + Height int32 `json:"height"` + Emoji string `json:"emoji"` + Format json.RawMessage `json:"format"` + FullType json.RawMessage `json:"full_type"` + Outline []*ClosedVectorPath `json:"outline"` + Thumbnail *Thumbnail `json:"thumbnail"` + Sticker *File `json:"sticker"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + sticker.Id = tmp.Id + sticker.SetId = tmp.SetId + sticker.Width = tmp.Width + sticker.Height = tmp.Height + sticker.Emoji = tmp.Emoji + sticker.Outline = tmp.Outline + sticker.Thumbnail = tmp.Thumbnail + sticker.Sticker = tmp.Sticker + + fieldFormat, _ := UnmarshalStickerFormat(tmp.Format) + sticker.Format = fieldFormat + + fieldFullType, _ := UnmarshalStickerFullType(tmp.FullType) + sticker.FullType = fieldFullType + + return nil +} + // Describes a video file type Video struct { meta @@ -3480,12 +4726,16 @@ type VideoNote struct { meta // Duration of the video, in seconds; as defined by the sender Duration int32 `json:"duration"` + // A waveform representation of the video note's audio in 5-bit format; may be empty if unknown + Waveform []byte `json:"waveform"` // Video width and height; as defined by the sender Length int32 `json:"length"` // Video minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` // Video thumbnail in JPEG format; as defined by the sender; may be null Thumbnail *Thumbnail `json:"thumbnail"` + // Result of speech recognition in the video note; may be null + SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"` // File containing the video Video *File `json:"video"` } @@ -3506,6 +4756,35 @@ func (*VideoNote) GetType() string { return TypeVideoNote } +func (videoNote *VideoNote) UnmarshalJSON(data []byte) error { + var tmp struct { + Duration int32 `json:"duration"` + Waveform []byte `json:"waveform"` + Length int32 `json:"length"` + Minithumbnail *Minithumbnail `json:"minithumbnail"` + Thumbnail *Thumbnail `json:"thumbnail"` + SpeechRecognitionResult json.RawMessage `json:"speech_recognition_result"` + Video *File `json:"video"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + videoNote.Duration = tmp.Duration + videoNote.Waveform = tmp.Waveform + videoNote.Length = tmp.Length + videoNote.Minithumbnail = tmp.Minithumbnail + videoNote.Thumbnail = tmp.Thumbnail + videoNote.Video = tmp.Video + + fieldSpeechRecognitionResult, _ := UnmarshalSpeechRecognitionResult(tmp.SpeechRecognitionResult) + videoNote.SpeechRecognitionResult = fieldSpeechRecognitionResult + + return nil +} + // Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel type VoiceNote struct { meta @@ -3515,6 +4794,8 @@ type VoiceNote struct { Waveform []byte `json:"waveform"` // MIME type of the file; as defined by the sender MimeType string `json:"mime_type"` + // Result of speech recognition in the voice note; may be null + SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"` // File containing the voice note Voice *File `json:"voice"` } @@ -3535,14 +4816,43 @@ func (*VoiceNote) GetType() string { return TypeVoiceNote } -// Describes an animated representation of an emoji +func (voiceNote *VoiceNote) UnmarshalJSON(data []byte) error { + var tmp struct { + Duration int32 `json:"duration"` + Waveform []byte `json:"waveform"` + MimeType string `json:"mime_type"` + SpeechRecognitionResult json.RawMessage `json:"speech_recognition_result"` + Voice *File `json:"voice"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + voiceNote.Duration = tmp.Duration + voiceNote.Waveform = tmp.Waveform + voiceNote.MimeType = tmp.MimeType + voiceNote.Voice = tmp.Voice + + fieldSpeechRecognitionResult, _ := UnmarshalSpeechRecognitionResult(tmp.SpeechRecognitionResult) + voiceNote.SpeechRecognitionResult = fieldSpeechRecognitionResult + + return nil +} + +// Describes an animated or custom representation of an emoji type AnimatedEmoji struct { meta - // Animated sticker for the emoji + // Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs Sticker *Sticker `json:"sticker"` + // Expected width of the sticker, which can be used if the sticker is null + StickerWidth int32 `json:"sticker_width"` + // Expected height of the sticker, which can be used if the sticker is null + StickerHeight int32 `json:"sticker_height"` // Emoji modifier fitzpatrick type; 0-6; 0 if none FitzpatrickType int32 `json:"fitzpatrick_type"` - // File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container + // File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container Sound *File `json:"sound"` } @@ -3573,7 +4883,7 @@ type Contact struct { LastName string `json:"last_name"` // Additional data about the user in a form of vCard; 0-2048 bytes in length Vcard string `json:"vcard"` - // Identifier of the user, if known; otherwise 0 + // Identifier of the user, if known; 0 otherwise UserId int64 `json:"user_id"` } @@ -3653,12 +4963,12 @@ func (*Venue) GetType() string { return TypeVenue } -// Describes a game +// Describes a game. Use getInternalLink with internalLinkTypeGame to share the game type Game struct { meta - // Game ID + // Unique game identifier Id JsonInt64 `json:"id"` - // Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name} + // Game short name ShortName string `json:"short_name"` // Game title Title string `json:"title"` @@ -3688,6 +4998,37 @@ func (*Game) GetType() string { return TypeGame } +// Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App +type WebApp struct { + meta + // Web App short name + ShortName string `json:"short_name"` + // Web App title + Title string `json:"title"` + // Web App description + Description string `json:"description"` + // Web App photo + Photo *Photo `json:"photo"` + // Web App animation; may be null + Animation *Animation `json:"animation"` +} + +func (entity *WebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebApp + + return json.Marshal((*stub)(entity)) +} + +func (*WebApp) GetClass() string { + return ClassWebApp +} + +func (*WebApp) GetType() string { + return TypeWebApp +} + // Describes a poll type Poll struct { meta @@ -3699,8 +5040,8 @@ 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 []int64 `json:"recent_voter_user_ids"` + // Identifiers of recent voters, if the poll is non-anonymous + RecentVoterIds []MessageSender `json:"recent_voter_ids"` // True, if the poll is anonymous IsAnonymous bool `json:"is_anonymous"` // Type of the poll @@ -3731,16 +5072,16 @@ func (*Poll) GetType() string { 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 []int64 `json:"recent_voter_user_ids"` - IsAnonymous bool `json:"is_anonymous"` - Type json.RawMessage `json:"type"` - OpenPeriod int32 `json:"open_period"` - CloseDate int32 `json:"close_date"` - IsClosed bool `json:"is_closed"` + Id JsonInt64 `json:"id"` + Question string `json:"question"` + Options []*PollOption `json:"options"` + TotalVoterCount int32 `json:"total_voter_count"` + RecentVoterIds []json.RawMessage `json:"recent_voter_ids"` + IsAnonymous bool `json:"is_anonymous"` + Type json.RawMessage `json:"type"` + OpenPeriod int32 `json:"open_period"` + CloseDate int32 `json:"close_date"` + IsClosed bool `json:"is_closed"` } err := json.Unmarshal(data, &tmp) @@ -3752,18 +5093,128 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { poll.Question = tmp.Question poll.Options = tmp.Options poll.TotalVoterCount = tmp.TotalVoterCount - poll.RecentVoterUserIds = tmp.RecentVoterUserIds poll.IsAnonymous = tmp.IsAnonymous poll.OpenPeriod = tmp.OpenPeriod poll.CloseDate = tmp.CloseDate poll.IsClosed = tmp.IsClosed + fieldRecentVoterIds, _ := UnmarshalListOfMessageSender(tmp.RecentVoterIds) + poll.RecentVoterIds = fieldRecentVoterIds + fieldType, _ := UnmarshalPollType(tmp.Type) poll.Type = fieldType return nil } +// Describes a chat background +type Background struct { + meta + // Unique background identifier + Id JsonInt64 `json:"id"` + // True, if this is one of default backgrounds + IsDefault bool `json:"is_default"` + // True, if the background is dark and is recommended to be used with dark theme + IsDark bool `json:"is_dark"` + // Unique background name + Name string `json:"name"` + // Document with the background; may be null. Null only for filled backgrounds + Document *Document `json:"document"` + // Type of the background + Type BackgroundType `json:"type"` +} + +func (entity *Background) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Background + + return json.Marshal((*stub)(entity)) +} + +func (*Background) GetClass() string { + return ClassBackground +} + +func (*Background) GetType() string { + return TypeBackground +} + +func (background *Background) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + IsDefault bool `json:"is_default"` + IsDark bool `json:"is_dark"` + Name string `json:"name"` + Document *Document `json:"document"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + background.Id = tmp.Id + background.IsDefault = tmp.IsDefault + background.IsDark = tmp.IsDark + background.Name = tmp.Name + background.Document = tmp.Document + + fieldType, _ := UnmarshalBackgroundType(tmp.Type) + background.Type = fieldType + + return nil +} + +// Contains a list of backgrounds +type Backgrounds struct { + meta + // A list of backgrounds + Backgrounds []*Background `json:"backgrounds"` +} + +func (entity *Backgrounds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Backgrounds + + return json.Marshal((*stub)(entity)) +} + +func (*Backgrounds) GetClass() string { + return ClassBackgrounds +} + +func (*Backgrounds) GetType() string { + return TypeBackgrounds +} + +// Describes a background set for a specific chat +type ChatBackground struct { + meta + // The background + Background *Background `json:"background"` + // Dimming of the background in dark themes, as a percentage; 0-100 + DarkThemeDimming int32 `json:"dark_theme_dimming"` +} + +func (entity *ChatBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBackground + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBackground) GetClass() string { + return ClassChatBackground +} + +func (*ChatBackground) GetType() string { + return TypeChatBackground +} + // Describes a user profile photo type ProfilePhoto struct { meta @@ -3777,6 +5228,8 @@ type ProfilePhoto struct { Minithumbnail *Minithumbnail `json:"minithumbnail"` // True, if the photo has animated variant HasAnimation bool `json:"has_animation"` + // True, if the photo is visible only for the current user + IsPersonal bool `json:"is_personal"` } func (entity *ProfilePhoto) MarshalJSON() ([]byte, error) { @@ -3806,6 +5259,8 @@ type ChatPhotoInfo struct { Minithumbnail *Minithumbnail `json:"minithumbnail"` // True, if the photo has animated variant HasAnimation bool `json:"has_animation"` + // True, if the photo is visible only for the current user + IsPersonal bool `json:"is_personal"` } func (entity *ChatPhotoInfo) MarshalJSON() ([]byte, error) { @@ -3877,6 +5332,8 @@ func (*UserTypeDeleted) UserTypeType() string { // A bot (see https://core.telegram.org/bots) type UserTypeBot struct { meta + // True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription + CanBeEdited bool `json:"can_be_edited"` // True, if the bot can be invited to basic group and supergroup chats CanJoinGroups bool `json:"can_join_groups"` // True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages @@ -3887,6 +5344,8 @@ type UserTypeBot struct { InlineQueryPlaceholder string `json:"inline_query_placeholder"` // True, if the location of the user is expected to be sent with every inline query to this bot NeedLocation bool `json:"need_location"` + // True, if the bot can be added to attachment or side menu + CanBeAddedToAttachmentMenu bool `json:"can_be_added_to_attachment_menu"` } func (entity *UserTypeBot) MarshalJSON() ([]byte, error) { @@ -3984,6 +5443,31 @@ func (*BotCommands) GetType() string { return TypeBotCommands } +// Describes a button to be shown instead of bot commands menu button +type BotMenuButton struct { + meta + // Text of the button + Text string `json:"text"` + // URL to be passed to openWebApp + Url string `json:"url"` +} + +func (entity *BotMenuButton) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotMenuButton + + return json.Marshal((*stub)(entity)) +} + +func (*BotMenuButton) GetClass() string { + return ClassBotMenuButton +} + +func (*BotMenuButton) GetType() string { + return TypeBotMenuButton +} + // Represents a location to which a chat is connected type ChatLocation struct { meta @@ -4009,6 +5493,107 @@ func (*ChatLocation) GetType() string { return TypeChatLocation } +// Information about the sticker, which was used to create the chat photo +type ChatPhotoStickerTypeRegularOrMask struct { + meta + // Sticker set identifier + StickerSetId JsonInt64 `json:"sticker_set_id"` + // Identifier of the sticker in the set + StickerId JsonInt64 `json:"sticker_id"` +} + +func (entity *ChatPhotoStickerTypeRegularOrMask) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhotoStickerTypeRegularOrMask + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhotoStickerTypeRegularOrMask) GetClass() string { + return ClassChatPhotoStickerType +} + +func (*ChatPhotoStickerTypeRegularOrMask) GetType() string { + return TypeChatPhotoStickerTypeRegularOrMask +} + +func (*ChatPhotoStickerTypeRegularOrMask) ChatPhotoStickerTypeType() string { + return TypeChatPhotoStickerTypeRegularOrMask +} + +// Information about the custom emoji, which was used to create the chat photo +type ChatPhotoStickerTypeCustomEmoji struct { + meta + // Identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *ChatPhotoStickerTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhotoStickerTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhotoStickerTypeCustomEmoji) GetClass() string { + return ClassChatPhotoStickerType +} + +func (*ChatPhotoStickerTypeCustomEmoji) GetType() string { + return TypeChatPhotoStickerTypeCustomEmoji +} + +func (*ChatPhotoStickerTypeCustomEmoji) ChatPhotoStickerTypeType() string { + return TypeChatPhotoStickerTypeCustomEmoji +} + +// Information about the sticker, which was used to create the chat photo. The sticker is shown at the center of the photo and occupies at most 67% of it +type ChatPhotoSticker struct { + meta + // Type of the sticker + Type ChatPhotoStickerType `json:"type"` + // The fill to be used as background for the sticker; rotation angle in backgroundFillGradient isn't supported + BackgroundFill BackgroundFill `json:"background_fill"` +} + +func (entity *ChatPhotoSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhotoSticker + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhotoSticker) GetClass() string { + return ClassChatPhotoSticker +} + +func (*ChatPhotoSticker) GetType() string { + return TypeChatPhotoSticker +} + +func (chatPhotoSticker *ChatPhotoSticker) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + BackgroundFill json.RawMessage `json:"background_fill"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldType, _ := UnmarshalChatPhotoStickerType(tmp.Type) + chatPhotoSticker.Type = fieldType + + fieldBackgroundFill, _ := UnmarshalBackgroundFill(tmp.BackgroundFill) + chatPhotoSticker.BackgroundFill = fieldBackgroundFill + + return nil +} + // Animated variant of a chat photo in MPEG4 format type AnimatedChatPhoto struct { meta @@ -4047,8 +5632,12 @@ type ChatPhoto struct { Minithumbnail *Minithumbnail `json:"minithumbnail"` // Available variants of the photo in JPEG format, in different size Sizes []*PhotoSize `json:"sizes"` - // Animated variant of the photo in MPEG4 format; may be null + // A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null Animation *AnimatedChatPhoto `json:"animation"` + // A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available + SmallAnimation *AnimatedChatPhoto `json:"small_animation"` + // Sticker-based version of the chat photo; may be null + Sticker *ChatPhotoSticker `json:"sticker"` } func (entity *ChatPhoto) MarshalJSON() ([]byte, error) { @@ -4162,7 +5751,7 @@ func (inputChatPhotoStatic *InputChatPhotoStatic) UnmarshalJSON(data []byte) err return nil } -// An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 800 and be at most 2MB in size +// An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 1280 and be at most 2MB in size type InputChatPhotoAnimation struct { meta // Animation to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed @@ -4210,6 +5799,666 @@ func (inputChatPhotoAnimation *InputChatPhotoAnimation) UnmarshalJSON(data []byt return nil } +// A sticker on a custom background +type InputChatPhotoSticker struct { + meta + // Information about the sticker + Sticker *ChatPhotoSticker `json:"sticker"` +} + +func (entity *InputChatPhotoSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputChatPhotoSticker + + return json.Marshal((*stub)(entity)) +} + +func (*InputChatPhotoSticker) GetClass() string { + return ClassInputChatPhoto +} + +func (*InputChatPhotoSticker) GetType() string { + return TypeInputChatPhotoSticker +} + +func (*InputChatPhotoSticker) InputChatPhotoType() string { + return TypeInputChatPhotoSticker +} + +// Describes actions that a user is allowed to take in a chat +type ChatPermissions struct { + meta + // True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues + CanSendBasicMessages bool `json:"can_send_basic_messages"` + // True, if the user can send music files + CanSendAudios bool `json:"can_send_audios"` + // True, if the user can send documents + CanSendDocuments bool `json:"can_send_documents"` + // True, if the user can send photos + CanSendPhotos bool `json:"can_send_photos"` + // True, if the user can send videos + CanSendVideos bool `json:"can_send_videos"` + // True, if the user can send video notes + CanSendVideoNotes bool `json:"can_send_video_notes"` + // True, if the user can send voice notes + CanSendVoiceNotes bool `json:"can_send_voice_notes"` + // True, if the user can send polls + CanSendPolls bool `json:"can_send_polls"` + // True, if the user can send animations, games, stickers, and dice and use inline bots + CanSendOtherMessages bool `json:"can_send_other_messages"` + // True, if the user may add a web page preview to their messages + CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` + // True, if the user can change the chat title, photo, and other settings + CanChangeInfo bool `json:"can_change_info"` + // True, if the user can invite new users to the chat + CanInviteUsers bool `json:"can_invite_users"` + // True, if the user can pin messages + CanPinMessages bool `json:"can_pin_messages"` + // True, if the user can manage topics + CanManageTopics bool `json:"can_manage_topics"` +} + +func (entity *ChatPermissions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPermissions + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPermissions) GetClass() string { + return ClassChatPermissions +} + +func (*ChatPermissions) GetType() string { + return TypeChatPermissions +} + +// Describes rights of the administrator +type ChatAdministratorRights struct { + meta + // True, if the administrator can get chat event log, get chat boosts in channels, get channel members, report supergroup spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only + CanManageChat bool `json:"can_manage_chat"` + // True, if the administrator can change the chat title, photo, and other settings + CanChangeInfo bool `json:"can_change_info"` + // True, if the administrator can create channel posts or view channel statistics; applicable to channels only + CanPostMessages bool `json:"can_post_messages"` + // True, if the administrator can edit messages of other users and pin messages; applicable to channels only + CanEditMessages bool `json:"can_edit_messages"` + // True, if the administrator can delete messages of other users + CanDeleteMessages bool `json:"can_delete_messages"` + // True, if the administrator can invite new users to the chat + CanInviteUsers bool `json:"can_invite_users"` + // True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels + CanRestrictMembers bool `json:"can_restrict_members"` + // True, if the administrator can pin messages; applicable to basic groups and supergroups only + CanPinMessages bool `json:"can_pin_messages"` + // True, if the administrator can manage topics; applicable to forum supergroups only + CanManageTopics bool `json:"can_manage_topics"` + // True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them + CanPromoteMembers bool `json:"can_promote_members"` + // True, if the administrator can manage video chats + CanManageVideoChats bool `json:"can_manage_video_chats"` + // True, if the administrator can create new channel stories, or edit and delete posted stories; applicable to channels only + CanPostStories bool `json:"can_post_stories"` + // True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to channels only + CanEditStories bool `json:"can_edit_stories"` + // True, if the administrator can delete stories posted by other users; applicable to channels only + CanDeleteStories bool `json:"can_delete_stories"` + // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only + IsAnonymous bool `json:"is_anonymous"` +} + +func (entity *ChatAdministratorRights) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAdministratorRights + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAdministratorRights) GetClass() string { + return ClassChatAdministratorRights +} + +func (*ChatAdministratorRights) GetType() string { + return TypeChatAdministratorRights +} + +// Describes an option for buying Telegram Premium to a user +type PremiumPaymentOption struct { + meta + // ISO 4217 currency code for Telegram Premium subscription payment + Currency string `json:"currency"` + // The amount to pay, in the smallest units of the currency + Amount int64 `json:"amount"` + // The discount associated with this option, as a percentage + DiscountPercentage int32 `json:"discount_percentage"` + // Number of month the Telegram Premium subscription will be active + MonthCount int32 `json:"month_count"` + // Identifier of the store product associated with the option + StoreProductId string `json:"store_product_id"` + // An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available + PaymentLink InternalLinkType `json:"payment_link"` +} + +func (entity *PremiumPaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumPaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumPaymentOption) GetClass() string { + return ClassPremiumPaymentOption +} + +func (*PremiumPaymentOption) GetType() string { + return TypePremiumPaymentOption +} + +func (premiumPaymentOption *PremiumPaymentOption) UnmarshalJSON(data []byte) error { + var tmp struct { + Currency string `json:"currency"` + Amount int64 `json:"amount"` + DiscountPercentage int32 `json:"discount_percentage"` + MonthCount int32 `json:"month_count"` + StoreProductId string `json:"store_product_id"` + PaymentLink json.RawMessage `json:"payment_link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumPaymentOption.Currency = tmp.Currency + premiumPaymentOption.Amount = tmp.Amount + premiumPaymentOption.DiscountPercentage = tmp.DiscountPercentage + premiumPaymentOption.MonthCount = tmp.MonthCount + premiumPaymentOption.StoreProductId = tmp.StoreProductId + + fieldPaymentLink, _ := UnmarshalInternalLinkType(tmp.PaymentLink) + premiumPaymentOption.PaymentLink = fieldPaymentLink + + return nil +} + +// Describes an option for buying or upgrading Telegram Premium for self +type PremiumStatePaymentOption struct { + meta + // Information about the payment option + PaymentOption *PremiumPaymentOption `json:"payment_option"` + // True, if this is the currently used Telegram Premium subscription option + IsCurrent bool `json:"is_current"` + // True, if the payment option can be used to upgrade the existing Telegram Premium subscription + IsUpgrade bool `json:"is_upgrade"` + // Identifier of the last in-store transaction for the currently used option + LastTransactionId string `json:"last_transaction_id"` +} + +func (entity *PremiumStatePaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStatePaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStatePaymentOption) GetClass() string { + return ClassPremiumStatePaymentOption +} + +func (*PremiumStatePaymentOption) GetType() string { + return TypePremiumStatePaymentOption +} + +// Describes an option for creating Telegram Premium gift codes +type PremiumGiftCodePaymentOption struct { + meta + // ISO 4217 currency code for Telegram Premium gift code payment + Currency string `json:"currency"` + // The amount to pay, in the smallest units of the currency + Amount int64 `json:"amount"` + // Number of users which will be able to activate the gift codes + UserCount int32 `json:"user_count"` + // Number of month the Telegram Premium subscription will be active + MonthCount int32 `json:"month_count"` + // Identifier of the store product associated with the option; may be empty if none + StoreProductId string `json:"store_product_id"` + // Number of times the store product must be paid + StoreProductQuantity int32 `json:"store_product_quantity"` +} + +func (entity *PremiumGiftCodePaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiftCodePaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiftCodePaymentOption) GetClass() string { + return ClassPremiumGiftCodePaymentOption +} + +func (*PremiumGiftCodePaymentOption) GetType() string { + return TypePremiumGiftCodePaymentOption +} + +// Contains a list of options for creating Telegram Premium gift codes +type PremiumGiftCodePaymentOptions struct { + meta + // The list of options + Options []*PremiumGiftCodePaymentOption `json:"options"` +} + +func (entity *PremiumGiftCodePaymentOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiftCodePaymentOptions + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiftCodePaymentOptions) GetClass() string { + return ClassPremiumGiftCodePaymentOptions +} + +func (*PremiumGiftCodePaymentOptions) GetType() string { + return TypePremiumGiftCodePaymentOptions +} + +// Contains information about a Telegram Premium gift code +type PremiumGiftCodeInfo struct { + meta + // Identifier of a chat or a user that created the gift code + CreatorId MessageSender `json:"creator_id"` + // Point in time (Unix timestamp) when the code was created + CreationDate int32 `json:"creation_date"` + // True, if the gift code was created for a giveaway + IsFromGiveaway bool `json:"is_from_giveaway"` + // Identifier of the corresponding giveaway message; can be 0 or an identifier of a deleted message + GiveawayMessageId int64 `json:"giveaway_message_id"` + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // Identifier of a user for which the code was created; 0 if none + UserId int64 `json:"user_id"` + // Point in time (Unix timestamp) when the code was activated; 0 if none + UseDate int32 `json:"use_date"` +} + +func (entity *PremiumGiftCodeInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiftCodeInfo + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiftCodeInfo) GetClass() string { + return ClassPremiumGiftCodeInfo +} + +func (*PremiumGiftCodeInfo) GetType() string { + return TypePremiumGiftCodeInfo +} + +func (premiumGiftCodeInfo *PremiumGiftCodeInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + CreatorId json.RawMessage `json:"creator_id"` + CreationDate int32 `json:"creation_date"` + IsFromGiveaway bool `json:"is_from_giveaway"` + GiveawayMessageId int64 `json:"giveaway_message_id"` + MonthCount int32 `json:"month_count"` + UserId int64 `json:"user_id"` + UseDate int32 `json:"use_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumGiftCodeInfo.CreationDate = tmp.CreationDate + premiumGiftCodeInfo.IsFromGiveaway = tmp.IsFromGiveaway + premiumGiftCodeInfo.GiveawayMessageId = tmp.GiveawayMessageId + premiumGiftCodeInfo.MonthCount = tmp.MonthCount + premiumGiftCodeInfo.UserId = tmp.UserId + premiumGiftCodeInfo.UseDate = tmp.UseDate + + fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) + premiumGiftCodeInfo.CreatorId = fieldCreatorId + + return nil +} + +// The user is eligible for the giveaway +type PremiumGiveawayParticipantStatusEligible struct { + meta +} + +func (entity *PremiumGiveawayParticipantStatusEligible) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusEligible + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusEligible) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusEligible) GetType() string { + return TypePremiumGiveawayParticipantStatusEligible +} + +func (*PremiumGiveawayParticipantStatusEligible) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusEligible +} + +// The user participates in the giveaway +type PremiumGiveawayParticipantStatusParticipating struct { + meta +} + +func (entity *PremiumGiveawayParticipantStatusParticipating) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusParticipating + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusParticipating) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusParticipating) GetType() string { + return TypePremiumGiveawayParticipantStatusParticipating +} + +func (*PremiumGiveawayParticipantStatusParticipating) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusParticipating +} + +// The user can't participate in the giveaway, because they have already been member of the chat +type PremiumGiveawayParticipantStatusAlreadyWasMember struct { + meta + // Point in time (Unix timestamp) when the user joined the chat + JoinedChatDate int32 `json:"joined_chat_date"` +} + +func (entity *PremiumGiveawayParticipantStatusAlreadyWasMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusAlreadyWasMember + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) GetType() string { + return TypePremiumGiveawayParticipantStatusAlreadyWasMember +} + +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusAlreadyWasMember +} + +// The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway +type PremiumGiveawayParticipantStatusAdministrator struct { + meta + // Identifier of the chat administered by the user + ChatId int64 `json:"chat_id"` +} + +func (entity *PremiumGiveawayParticipantStatusAdministrator) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusAdministrator + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusAdministrator) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusAdministrator) GetType() string { + return TypePremiumGiveawayParticipantStatusAdministrator +} + +func (*PremiumGiveawayParticipantStatusAdministrator) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusAdministrator +} + +// The user can't participate in the giveaway, because they phone number is from a disallowed country +type PremiumGiveawayParticipantStatusDisallowedCountry struct { + meta + // A two-letter ISO 3166-1 alpha-2 country code of the user's country + UserCountryCode string `json:"user_country_code"` +} + +func (entity *PremiumGiveawayParticipantStatusDisallowedCountry) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusDisallowedCountry + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusDisallowedCountry) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusDisallowedCountry) GetType() string { + return TypePremiumGiveawayParticipantStatusDisallowedCountry +} + +func (*PremiumGiveawayParticipantStatusDisallowedCountry) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusDisallowedCountry +} + +// Describes an ongoing giveaway +type PremiumGiveawayInfoOngoing struct { + meta + // Point in time (Unix timestamp) when the giveaway was created + CreationDate int32 `json:"creation_date"` + // Status of the current user in the giveaway + Status PremiumGiveawayParticipantStatus `json:"status"` + // True, if the giveaway has ended and results are being prepared + IsEnded bool `json:"is_ended"` +} + +func (entity *PremiumGiveawayInfoOngoing) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayInfoOngoing + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayInfoOngoing) GetClass() string { + return ClassPremiumGiveawayInfo +} + +func (*PremiumGiveawayInfoOngoing) GetType() string { + return TypePremiumGiveawayInfoOngoing +} + +func (*PremiumGiveawayInfoOngoing) PremiumGiveawayInfoType() string { + return TypePremiumGiveawayInfoOngoing +} + +func (premiumGiveawayInfoOngoing *PremiumGiveawayInfoOngoing) UnmarshalJSON(data []byte) error { + var tmp struct { + CreationDate int32 `json:"creation_date"` + Status json.RawMessage `json:"status"` + IsEnded bool `json:"is_ended"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumGiveawayInfoOngoing.CreationDate = tmp.CreationDate + premiumGiveawayInfoOngoing.IsEnded = tmp.IsEnded + + fieldStatus, _ := UnmarshalPremiumGiveawayParticipantStatus(tmp.Status) + premiumGiveawayInfoOngoing.Status = fieldStatus + + return nil +} + +// Describes a completed giveaway +type PremiumGiveawayInfoCompleted struct { + meta + // Point in time (Unix timestamp) when the giveaway was created + CreationDate int32 `json:"creation_date"` + // Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway + ActualWinnersSelectionDate int32 `json:"actual_winners_selection_date"` + // True, if the giveaway was canceled and was fully refunded + WasRefunded bool `json:"was_refunded"` + // Number of winners in the giveaway + WinnerCount int32 `json:"winner_count"` + // Number of winners, which activated their gift codes + ActivationCount int32 `json:"activation_count"` + // Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway + GiftCode string `json:"gift_code"` +} + +func (entity *PremiumGiveawayInfoCompleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayInfoCompleted + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayInfoCompleted) GetClass() string { + return ClassPremiumGiveawayInfo +} + +func (*PremiumGiveawayInfoCompleted) GetType() string { + return TypePremiumGiveawayInfoCompleted +} + +func (*PremiumGiveawayInfoCompleted) PremiumGiveawayInfoType() string { + return TypePremiumGiveawayInfoCompleted +} + +// Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews +type AccentColor struct { + meta + // Accent color identifier + Id int32 `json:"id"` + // Identifier of a built-in color to use in places, where only one color is needed; 0-6 + BuiltInAccentColorId int32 `json:"built_in_accent_color_id"` + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes + LightThemeColors []int32 `json:"light_theme_colors"` + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes + DarkThemeColors []int32 `json:"dark_theme_colors"` +} + +func (entity *AccentColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AccentColor + + return json.Marshal((*stub)(entity)) +} + +func (*AccentColor) GetClass() string { + return ClassAccentColor +} + +func (*AccentColor) GetType() string { + return TypeAccentColor +} + +// Describes a custom emoji to be shown instead of the Telegram Premium badge +type EmojiStatus struct { + meta + // Identifier of the custom emoji in stickerFormatTgs format + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` + // Point in time (Unix timestamp) when the status will expire; 0 if never + ExpirationDate int32 `json:"expiration_date"` +} + +func (entity *EmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiStatus) GetClass() string { + return ClassEmojiStatus +} + +func (*EmojiStatus) GetType() string { + return TypeEmojiStatus +} + +// Contains a list of custom emoji identifiers, which can be set as emoji statuses +type EmojiStatuses struct { + meta + // The list of custom emoji identifiers + CustomEmojiIds []JsonInt64 `json:"custom_emoji_ids"` +} + +func (entity *EmojiStatuses) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiStatuses + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiStatuses) GetClass() string { + return ClassEmojiStatuses +} + +func (*EmojiStatuses) GetType() string { + return TypeEmojiStatuses +} + +// Describes usernames assigned to a user, a supergroup, or a channel +type Usernames struct { + meta + // List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames + ActiveUsernames []string `json:"active_usernames"` + // List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive + DisabledUsernames []string `json:"disabled_usernames"` + // The active username, which can be changed with setUsername or setSupergroupUsername + EditableUsername string `json:"editable_username"` +} + +func (entity *Usernames) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Usernames + + return json.Marshal((*stub)(entity)) +} + +func (*Usernames) GetClass() string { + return ClassUsernames +} + +func (*Usernames) GetType() string { + return TypeUsernames +} + // Represents a user type User struct { meta @@ -4219,20 +6468,30 @@ type User struct { FirstName string `json:"first_name"` // Last name of the user LastName string `json:"last_name"` - // Username of the user - Username string `json:"username"` + // Usernames of the user; may be null + Usernames *Usernames `json:"usernames"` // Phone number of the user PhoneNumber string `json:"phone_number"` // Current online status of the user Status UserStatus `json:"status"` // Profile photo of the user; may be null ProfilePhoto *ProfilePhoto `json:"profile_photo"` + // Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header background; 0 if none. For Telegram Premium users only + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + // Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only + EmojiStatus *EmojiStatus `json:"emoji_status"` // The user is a contact of the current user IsContact bool `json:"is_contact"` // The user is a contact of the current user and the current user is a contact of the user IsMutualContact bool `json:"is_mutual_contact"` + // The user is a close friend of the current user; implies that the user is a contact + IsCloseFriend bool `json:"is_close_friend"` // True, if the user is verified IsVerified bool `json:"is_verified"` + // True, if the user is a Telegram Premium user + IsPremium bool `json:"is_premium"` // True, if the user is Telegram support account IsSupport bool `json:"is_support"` // If non-empty, it contains a human-readable description of the reason why access to this user must be restricted @@ -4241,12 +6500,18 @@ type User struct { IsScam bool `json:"is_scam"` // True, if many users reported this user as a fake account IsFake bool `json:"is_fake"` - // If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser + // True, if the user has non-expired stories available to the current user + HasActiveStories bool `json:"has_active_stories"` + // True, if the user has unread non-expired stories available to the current user + HasUnreadActiveStories bool `json:"has_unread_active_stories"` + // If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method HaveAccess bool `json:"have_access"` // Type of the user Type UserType `json:"type"` // IETF language tag of the user's language; only available to bots LanguageCode string `json:"language_code"` + // True, if the user added the current bot to attachment menu; only available to bots + AddedToAttachmentMenu bool `json:"added_to_attachment_menu"` } func (entity *User) MarshalJSON() ([]byte, error) { @@ -4267,23 +6532,31 @@ func (*User) GetType() string { func (user *User) UnmarshalJSON(data []byte) error { var tmp struct { - Id int64 `json:"id"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - Username string `json:"username"` - PhoneNumber string `json:"phone_number"` - Status json.RawMessage `json:"status"` - ProfilePhoto *ProfilePhoto `json:"profile_photo"` - IsContact bool `json:"is_contact"` - IsMutualContact bool `json:"is_mutual_contact"` - IsVerified bool `json:"is_verified"` - IsSupport bool `json:"is_support"` - RestrictionReason string `json:"restriction_reason"` - IsScam bool `json:"is_scam"` - IsFake bool `json:"is_fake"` - HaveAccess bool `json:"have_access"` - Type json.RawMessage `json:"type"` - LanguageCode string `json:"language_code"` + Id int64 `json:"id"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + Usernames *Usernames `json:"usernames"` + PhoneNumber string `json:"phone_number"` + Status json.RawMessage `json:"status"` + ProfilePhoto *ProfilePhoto `json:"profile_photo"` + AccentColorId int32 `json:"accent_color_id"` + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + EmojiStatus *EmojiStatus `json:"emoji_status"` + IsContact bool `json:"is_contact"` + IsMutualContact bool `json:"is_mutual_contact"` + IsCloseFriend bool `json:"is_close_friend"` + IsVerified bool `json:"is_verified"` + IsPremium bool `json:"is_premium"` + IsSupport bool `json:"is_support"` + RestrictionReason string `json:"restriction_reason"` + IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` + HasActiveStories bool `json:"has_active_stories"` + HasUnreadActiveStories bool `json:"has_unread_active_stories"` + HaveAccess bool `json:"have_access"` + Type json.RawMessage `json:"type"` + LanguageCode string `json:"language_code"` + AddedToAttachmentMenu bool `json:"added_to_attachment_menu"` } err := json.Unmarshal(data, &tmp) @@ -4294,18 +6567,26 @@ func (user *User) UnmarshalJSON(data []byte) error { user.Id = tmp.Id user.FirstName = tmp.FirstName user.LastName = tmp.LastName - user.Username = tmp.Username + user.Usernames = tmp.Usernames user.PhoneNumber = tmp.PhoneNumber user.ProfilePhoto = tmp.ProfilePhoto + user.AccentColorId = tmp.AccentColorId + user.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId + user.EmojiStatus = tmp.EmojiStatus user.IsContact = tmp.IsContact user.IsMutualContact = tmp.IsMutualContact + user.IsCloseFriend = tmp.IsCloseFriend user.IsVerified = tmp.IsVerified + user.IsPremium = tmp.IsPremium user.IsSupport = tmp.IsSupport user.RestrictionReason = tmp.RestrictionReason user.IsScam = tmp.IsScam user.IsFake = tmp.IsFake + user.HasActiveStories = tmp.HasActiveStories + user.HasUnreadActiveStories = tmp.HasUnreadActiveStories user.HaveAccess = tmp.HaveAccess user.LanguageCode = tmp.LanguageCode + user.AddedToAttachmentMenu = tmp.AddedToAttachmentMenu fieldStatus, _ := UnmarshalUserStatus(tmp.Status) user.Status = fieldStatus @@ -4316,13 +6597,107 @@ func (user *User) UnmarshalJSON(data []byte) error { return nil } +// Contains information about a bot +type BotInfo struct { + meta + // The text that is shown on the bot's profile page and is sent together with the link when users share the bot + ShortDescription string `json:"short_description"` + // The text shown in the chat with the bot if the chat is empty + Description string `json:"description"` + // Photo shown in the chat with the bot if the chat is empty; may be null + Photo *Photo `json:"photo"` + // Animation shown in the chat with the bot if the chat is empty; may be null + Animation *Animation `json:"animation"` + // Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown + MenuButton *BotMenuButton `json:"menu_button"` + // List of the bot commands + Commands []*BotCommand `json:"commands"` + // Default administrator rights for adding the bot to basic group and supergroup chats; may be null + DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` + // Default administrator rights for adding the bot to channels; may be null + DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` + // The internal link, which can be used to edit bot commands; may be null + EditCommandsLink InternalLinkType `json:"edit_commands_link"` + // The internal link, which can be used to edit bot description; may be null + EditDescriptionLink InternalLinkType `json:"edit_description_link"` + // The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null + EditDescriptionMediaLink InternalLinkType `json:"edit_description_media_link"` + // The internal link, which can be used to edit bot settings; may be null + EditSettingsLink InternalLinkType `json:"edit_settings_link"` +} + +func (entity *BotInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BotInfo) GetClass() string { + return ClassBotInfo +} + +func (*BotInfo) GetType() string { + return TypeBotInfo +} + +func (botInfo *BotInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + ShortDescription string `json:"short_description"` + Description string `json:"description"` + Photo *Photo `json:"photo"` + Animation *Animation `json:"animation"` + MenuButton *BotMenuButton `json:"menu_button"` + Commands []*BotCommand `json:"commands"` + DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` + DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` + EditCommandsLink json.RawMessage `json:"edit_commands_link"` + EditDescriptionLink json.RawMessage `json:"edit_description_link"` + EditDescriptionMediaLink json.RawMessage `json:"edit_description_media_link"` + EditSettingsLink json.RawMessage `json:"edit_settings_link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + botInfo.ShortDescription = tmp.ShortDescription + botInfo.Description = tmp.Description + botInfo.Photo = tmp.Photo + botInfo.Animation = tmp.Animation + botInfo.MenuButton = tmp.MenuButton + botInfo.Commands = tmp.Commands + botInfo.DefaultGroupAdministratorRights = tmp.DefaultGroupAdministratorRights + botInfo.DefaultChannelAdministratorRights = tmp.DefaultChannelAdministratorRights + + fieldEditCommandsLink, _ := UnmarshalInternalLinkType(tmp.EditCommandsLink) + botInfo.EditCommandsLink = fieldEditCommandsLink + + fieldEditDescriptionLink, _ := UnmarshalInternalLinkType(tmp.EditDescriptionLink) + botInfo.EditDescriptionLink = fieldEditDescriptionLink + + fieldEditDescriptionMediaLink, _ := UnmarshalInternalLinkType(tmp.EditDescriptionMediaLink) + botInfo.EditDescriptionMediaLink = fieldEditDescriptionMediaLink + + fieldEditSettingsLink, _ := UnmarshalInternalLinkType(tmp.EditSettingsLink) + botInfo.EditSettingsLink = fieldEditSettingsLink + + return nil +} + // Contains full information about a user type UserFullInfo struct { meta - // User profile photo; may be null + // User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos + PersonalPhoto *ChatPhoto `json:"personal_photo"` + // User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo Photo *ChatPhoto `json:"photo"` - // True, if the user is blocked by the current user - IsBlocked bool `json:"is_blocked"` + // User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos + PublicPhoto *ChatPhoto `json:"public_photo"` + // Block list to which the user is added; may be null if none + BlockList BlockList `json:"block_list"` // True, if the user can be called CanBeCalled bool `json:"can_be_called"` // True, if a video call can be created with the user @@ -4331,18 +6706,20 @@ type UserFullInfo struct { HasPrivateCalls bool `json:"has_private_calls"` // True, if the user can't be linked in forwarded messages due to their privacy settings HasPrivateForwards bool `json:"has_private_forwards"` + // True, if voice and video notes can't be sent or forwarded to the user + HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"` + // True, if the user has pinned stories + HasPinnedStories bool `json:"has_pinned_stories"` // True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` - // A short user bio - Bio string `json:"bio"` - // For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot - ShareText string `json:"share_text"` - // For bots, the text shown in the chat with the bot if the chat is empty - Description string `json:"description"` + // A short user bio; may be null for bots + Bio *FormattedText `json:"bio"` + // The list of available options for gifting Telegram Premium to the user + PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` // Number of group chats where both the other user and the current user are a member; 0 for the current user GroupInCommonCount int32 `json:"group_in_common_count"` - // For bots, list of the bot commands - Commands []*BotCommand `json:"commands"` + // For bots, information about the bot; may be null if the user isn't a bot + BotInfo *BotInfo `json:"bot_info"` } func (entity *UserFullInfo) MarshalJSON() ([]byte, error) { @@ -4361,10 +6738,55 @@ func (*UserFullInfo) GetType() string { return TypeUserFullInfo } +func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + PersonalPhoto *ChatPhoto `json:"personal_photo"` + Photo *ChatPhoto `json:"photo"` + PublicPhoto *ChatPhoto `json:"public_photo"` + BlockList json.RawMessage `json:"block_list"` + CanBeCalled bool `json:"can_be_called"` + SupportsVideoCalls bool `json:"supports_video_calls"` + HasPrivateCalls bool `json:"has_private_calls"` + HasPrivateForwards bool `json:"has_private_forwards"` + HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"` + HasPinnedStories bool `json:"has_pinned_stories"` + NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` + Bio *FormattedText `json:"bio"` + PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` + GroupInCommonCount int32 `json:"group_in_common_count"` + BotInfo *BotInfo `json:"bot_info"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + userFullInfo.PersonalPhoto = tmp.PersonalPhoto + userFullInfo.Photo = tmp.Photo + userFullInfo.PublicPhoto = tmp.PublicPhoto + userFullInfo.CanBeCalled = tmp.CanBeCalled + userFullInfo.SupportsVideoCalls = tmp.SupportsVideoCalls + userFullInfo.HasPrivateCalls = tmp.HasPrivateCalls + userFullInfo.HasPrivateForwards = tmp.HasPrivateForwards + userFullInfo.HasRestrictedVoiceAndVideoNoteMessages = tmp.HasRestrictedVoiceAndVideoNoteMessages + userFullInfo.HasPinnedStories = tmp.HasPinnedStories + userFullInfo.NeedPhoneNumberPrivacyException = tmp.NeedPhoneNumberPrivacyException + userFullInfo.Bio = tmp.Bio + userFullInfo.PremiumGiftOptions = tmp.PremiumGiftOptions + userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount + userFullInfo.BotInfo = tmp.BotInfo + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + userFullInfo.BlockList = fieldBlockList + + return nil +} + // Represents a list of users type Users struct { meta - // Approximate total count of users found + // Approximate total number of users found TotalCount int32 `json:"total_count"` // A list of user identifiers UserIds []int64 `json:"user_ids"` @@ -4436,43 +6858,6 @@ func (*ChatAdministrators) GetType() string { return TypeChatAdministrators } -// Describes actions that a user is allowed to take in a chat -type ChatPermissions struct { - meta - // True, if the user can send text messages, contacts, locations, and venues - CanSendMessages bool `json:"can_send_messages"` - // True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions - CanSendMediaMessages bool `json:"can_send_media_messages"` - // True, if the user can send polls. Implies can_send_messages permissions - CanSendPolls bool `json:"can_send_polls"` - // True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions - CanSendOtherMessages bool `json:"can_send_other_messages"` - // True, if the user may add a web page preview to their messages. Implies can_send_messages permissions - CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` - // True, if the user can change the chat title, photo, and other settings - CanChangeInfo bool `json:"can_change_info"` - // True, if the user can invite new users to the chat - CanInviteUsers bool `json:"can_invite_users"` - // True, if the user can pin messages - CanPinMessages bool `json:"can_pin_messages"` -} - -func (entity *ChatPermissions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatPermissions - - return json.Marshal((*stub)(entity)) -} - -func (*ChatPermissions) GetClass() string { - return ClassChatPermissions -} - -func (*ChatPermissions) GetType() string { - return TypeChatPermissions -} - // The user is the owner of the chat and has all the administrator privileges type ChatMemberStatusCreator struct { meta @@ -4511,28 +6896,8 @@ type ChatMemberStatusAdministrator struct { CustomTitle string `json:"custom_title"` // True, if the current user can edit the administrator privileges for the called user CanBeEdited bool `json:"can_be_edited"` - // True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only - CanManageChat bool `json:"can_manage_chat"` - // True, if the administrator can change the chat title, photo, and other settings - CanChangeInfo bool `json:"can_change_info"` - // True, if the administrator can create channel posts; applicable to channels only - CanPostMessages bool `json:"can_post_messages"` - // True, if the administrator can edit messages of other users and pin messages; applicable to channels only - CanEditMessages bool `json:"can_edit_messages"` - // True, if the administrator can delete messages of other users - CanDeleteMessages bool `json:"can_delete_messages"` - // True, if the administrator can invite new users to the chat - CanInviteUsers bool `json:"can_invite_users"` - // True, if the administrator can restrict, ban, or unban chat members; always true for channels - CanRestrictMembers bool `json:"can_restrict_members"` - // True, if the administrator can pin messages; applicable to basic groups and supergroups only - CanPinMessages bool `json:"can_pin_messages"` - // True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them - CanPromoteMembers bool `json:"can_promote_members"` - // True, if the administrator can manage video chats - CanManageVideoChats bool `json:"can_manage_video_chats"` - // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only - IsAnonymous bool `json:"is_anonymous"` + // Rights of the administrator + Rights *ChatAdministratorRights `json:"rights"` } func (entity *ChatMemberStatusAdministrator) MarshalJSON() ([]byte, error) { @@ -4670,7 +7035,7 @@ type ChatMember struct { MemberId MessageSender `json:"member_id"` // Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown InviterUserId int64 `json:"inviter_user_id"` - // Point in time (Unix timestamp) when the user joined the chat + // Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat JoinedChatDate int32 `json:"joined_chat_date"` // Status of the member in the chat Status ChatMemberStatus `json:"status"` @@ -4720,7 +7085,7 @@ func (chatMember *ChatMember) UnmarshalJSON(data []byte) error { // Contains a list of chat members type ChatMembers struct { meta - // Approximate total count of chat members found + // Approximate total number of chat members found TotalCount int32 `json:"total_count"` // A list of chat members Members []*ChatMember `json:"members"` @@ -5179,7 +7544,7 @@ func (*ChatInviteLink) GetType() string { // Contains a list of chat invite links type ChatInviteLinks struct { meta - // Approximate total count of chat invite links found + // Approximate total number of chat invite links found TotalCount int32 `json:"total_count"` // List of invite links InviteLinks []*ChatInviteLink `json:"invite_links"` @@ -5258,6 +7623,8 @@ type ChatInviteLinkMember struct { UserId int64 `json:"user_id"` // Point in time (Unix timestamp) when the user joined the chat JoinedChatDate int32 `json:"joined_chat_date"` + // True, if the user has joined the chat using an invite link for a chat folder + ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link"` // User identifier of the chat administrator, approved user join request ApproverUserId int64 `json:"approver_user_id"` } @@ -5281,7 +7648,7 @@ func (*ChatInviteLinkMember) GetType() string { // Contains a list of chat members joined a chat via an invite link type ChatInviteLinkMembers struct { meta - // Approximate total count of chat members found + // Approximate total number of chat members found TotalCount int32 `json:"total_count"` // List of chat members, joined a chat via an invite link Members []*ChatInviteLinkMember `json:"members"` @@ -5303,6 +7670,81 @@ func (*ChatInviteLinkMembers) GetType() string { return TypeChatInviteLinkMembers } +// The link is an invite link for a basic group +type InviteLinkChatTypeBasicGroup struct { + meta +} + +func (entity *InviteLinkChatTypeBasicGroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InviteLinkChatTypeBasicGroup + + return json.Marshal((*stub)(entity)) +} + +func (*InviteLinkChatTypeBasicGroup) GetClass() string { + return ClassInviteLinkChatType +} + +func (*InviteLinkChatTypeBasicGroup) GetType() string { + return TypeInviteLinkChatTypeBasicGroup +} + +func (*InviteLinkChatTypeBasicGroup) InviteLinkChatTypeType() string { + return TypeInviteLinkChatTypeBasicGroup +} + +// The link is an invite link for a supergroup +type InviteLinkChatTypeSupergroup struct { + meta +} + +func (entity *InviteLinkChatTypeSupergroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InviteLinkChatTypeSupergroup + + return json.Marshal((*stub)(entity)) +} + +func (*InviteLinkChatTypeSupergroup) GetClass() string { + return ClassInviteLinkChatType +} + +func (*InviteLinkChatTypeSupergroup) GetType() string { + return TypeInviteLinkChatTypeSupergroup +} + +func (*InviteLinkChatTypeSupergroup) InviteLinkChatTypeType() string { + return TypeInviteLinkChatTypeSupergroup +} + +// The link is an invite link for a channel +type InviteLinkChatTypeChannel struct { + meta +} + +func (entity *InviteLinkChatTypeChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InviteLinkChatTypeChannel + + return json.Marshal((*stub)(entity)) +} + +func (*InviteLinkChatTypeChannel) GetClass() string { + return ClassInviteLinkChatType +} + +func (*InviteLinkChatTypeChannel) GetType() string { + return TypeInviteLinkChatTypeChannel +} + +func (*InviteLinkChatTypeChannel) InviteLinkChatTypeType() string { + return TypeInviteLinkChatTypeChannel +} + // Contains information about a chat invite link type ChatInviteLinkInfo struct { meta @@ -5311,11 +7753,13 @@ type ChatInviteLinkInfo struct { // If non-zero, the amount of time for which read access to the chat will remain available, in seconds AccessibleFor int32 `json:"accessible_for"` // Type of the chat - Type ChatType `json:"type"` + Type InviteLinkChatType `json:"type"` // Title of the chat Title string `json:"title"` // Chat photo; may be null Photo *ChatPhotoInfo `json:"photo"` + // Identifier of the accent color for chat title and background of chat photo + AccentColorId int32 `json:"accent_color_id"` // Chat description Description string `json:"description"` // Number of members in the chat @@ -5326,6 +7770,12 @@ type ChatInviteLinkInfo struct { CreatesJoinRequest bool `json:"creates_join_request"` // True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup IsPublic bool `json:"is_public"` + // True, if the chat is verified + IsVerified bool `json:"is_verified"` + // True, if many users reported this chat as a scam + IsScam bool `json:"is_scam"` + // True, if many users reported this chat as a fake account + IsFake bool `json:"is_fake"` } func (entity *ChatInviteLinkInfo) MarshalJSON() ([]byte, error) { @@ -5351,11 +7801,15 @@ func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { Type json.RawMessage `json:"type"` Title string `json:"title"` Photo *ChatPhotoInfo `json:"photo"` + AccentColorId int32 `json:"accent_color_id"` Description string `json:"description"` MemberCount int32 `json:"member_count"` MemberUserIds []int64 `json:"member_user_ids"` CreatesJoinRequest bool `json:"creates_join_request"` IsPublic bool `json:"is_public"` + IsVerified bool `json:"is_verified"` + IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` } err := json.Unmarshal(data, &tmp) @@ -5367,13 +7821,17 @@ func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { chatInviteLinkInfo.AccessibleFor = tmp.AccessibleFor chatInviteLinkInfo.Title = tmp.Title chatInviteLinkInfo.Photo = tmp.Photo + chatInviteLinkInfo.AccentColorId = tmp.AccentColorId chatInviteLinkInfo.Description = tmp.Description chatInviteLinkInfo.MemberCount = tmp.MemberCount chatInviteLinkInfo.MemberUserIds = tmp.MemberUserIds chatInviteLinkInfo.CreatesJoinRequest = tmp.CreatesJoinRequest chatInviteLinkInfo.IsPublic = tmp.IsPublic + chatInviteLinkInfo.IsVerified = tmp.IsVerified + chatInviteLinkInfo.IsScam = tmp.IsScam + chatInviteLinkInfo.IsFake = tmp.IsFake - fieldType, _ := UnmarshalChatType(tmp.Type) + fieldType, _ := UnmarshalInviteLinkChatType(tmp.Type) chatInviteLinkInfo.Type = fieldType return nil @@ -5409,7 +7867,7 @@ func (*ChatJoinRequest) GetType() string { // Contains a list of requests to join a chat type ChatJoinRequests struct { meta - // Approximate total count of requests found + // Approximate total number of requests found TotalCount int32 `json:"total_count"` // List of the requests Requests []*ChatJoinRequest `json:"requests"` @@ -5515,7 +7973,7 @@ func (basicGroup *BasicGroup) UnmarshalJSON(data []byte) error { // Contains full information about a basic group type BasicGroupFullInfo struct { meta - // Chat photo; may be null + // Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo Photo *ChatPhoto `json:"photo"` // Group description. Updated only after the basic group is opened Description string `json:"description"` @@ -5523,6 +7981,10 @@ type BasicGroupFullInfo struct { CreatorUserId int64 `json:"creator_user_id"` // Group members Members []*ChatMember `json:"members"` + // True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup + CanHideMembers bool `json:"can_hide_members"` + // True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup + CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` // Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened InviteLink *ChatInviteLink `json:"invite_link"` // List of commands of bots in the group @@ -5550,13 +8012,13 @@ type Supergroup struct { meta // Supergroup or channel identifier Id int64 `json:"id"` - // Username of the supergroup or channel; empty for private supergroups or channels - Username string `json:"username"` + // Usernames of the supergroup or channel; may be null + Usernames *Usernames `json:"usernames"` // Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member Date int32 `json:"date"` - // Status of the current user in the supergroup or channel; custom title will be always empty + // Status of the current user in the supergroup or channel; custom title will always be empty Status ChatMemberStatus `json:"status"` - // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules + // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, getUserPrivacySettingRules, or in chatFolderInviteLinkInfo.missing_chat_ids 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"` @@ -5564,12 +8026,18 @@ type Supergroup struct { HasLocation bool `json:"has_location"` // True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels SignMessages bool `json:"sign_messages"` + // True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups + JoinToSendMessages bool `json:"join_to_send_messages"` + // True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat + JoinByRequest bool `json:"join_by_request"` // True, if the slow mode is enabled in the supergroup IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` // True, if the supergroup is a channel IsChannel bool `json:"is_channel"` // True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members IsBroadcastGroup bool `json:"is_broadcast_group"` + // True, if the supergroup must be shown as a forum by default + IsForum bool `json:"is_forum"` // True, if the supergroup or channel is verified IsVerified bool `json:"is_verified"` // If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted @@ -5578,6 +8046,10 @@ type Supergroup struct { IsScam bool `json:"is_scam"` // True, if many users reported this supergroup or channel as a fake account IsFake bool `json:"is_fake"` + // True, if the channel has non-expired stories available to the current user + HasActiveStories bool `json:"has_active_stories"` + // True, if the channel has unread non-expired stories available to the current user + HasUnreadActiveStories bool `json:"has_unread_active_stories"` } func (entity *Supergroup) MarshalJSON() ([]byte, error) { @@ -5598,21 +8070,26 @@ func (*Supergroup) GetType() string { func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { var tmp struct { - Id int64 `json:"id"` - Username string `json:"username"` - Date int32 `json:"date"` - Status json.RawMessage `json:"status"` - MemberCount int32 `json:"member_count"` - HasLinkedChat bool `json:"has_linked_chat"` - HasLocation bool `json:"has_location"` - SignMessages bool `json:"sign_messages"` - IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` - IsChannel bool `json:"is_channel"` - IsBroadcastGroup bool `json:"is_broadcast_group"` - IsVerified bool `json:"is_verified"` - RestrictionReason string `json:"restriction_reason"` - IsScam bool `json:"is_scam"` - IsFake bool `json:"is_fake"` + Id int64 `json:"id"` + Usernames *Usernames `json:"usernames"` + Date int32 `json:"date"` + Status json.RawMessage `json:"status"` + MemberCount int32 `json:"member_count"` + HasLinkedChat bool `json:"has_linked_chat"` + HasLocation bool `json:"has_location"` + SignMessages bool `json:"sign_messages"` + JoinToSendMessages bool `json:"join_to_send_messages"` + JoinByRequest bool `json:"join_by_request"` + IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` + IsChannel bool `json:"is_channel"` + IsBroadcastGroup bool `json:"is_broadcast_group"` + IsForum bool `json:"is_forum"` + IsVerified bool `json:"is_verified"` + RestrictionReason string `json:"restriction_reason"` + IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` + HasActiveStories bool `json:"has_active_stories"` + HasUnreadActiveStories bool `json:"has_unread_active_stories"` } err := json.Unmarshal(data, &tmp) @@ -5621,19 +8098,24 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { } supergroup.Id = tmp.Id - supergroup.Username = tmp.Username + supergroup.Usernames = tmp.Usernames supergroup.Date = tmp.Date supergroup.MemberCount = tmp.MemberCount supergroup.HasLinkedChat = tmp.HasLinkedChat supergroup.HasLocation = tmp.HasLocation supergroup.SignMessages = tmp.SignMessages + supergroup.JoinToSendMessages = tmp.JoinToSendMessages + supergroup.JoinByRequest = tmp.JoinByRequest supergroup.IsSlowModeEnabled = tmp.IsSlowModeEnabled supergroup.IsChannel = tmp.IsChannel supergroup.IsBroadcastGroup = tmp.IsBroadcastGroup + supergroup.IsForum = tmp.IsForum supergroup.IsVerified = tmp.IsVerified supergroup.RestrictionReason = tmp.RestrictionReason supergroup.IsScam = tmp.IsScam supergroup.IsFake = tmp.IsFake + supergroup.HasActiveStories = tmp.HasActiveStories + supergroup.HasUnreadActiveStories = tmp.HasUnreadActiveStories fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) supergroup.Status = fieldStatus @@ -5644,7 +8126,7 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { // Contains full information about a supergroup or channel type SupergroupFullInfo struct { meta - // Chat photo; may be null + // Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo Photo *ChatPhoto `json:"photo"` // Supergroup or channel description Description string `json:"description"` @@ -5662,23 +8144,31 @@ type SupergroupFullInfo struct { SlowModeDelay int32 `json:"slow_mode_delay"` // Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero SlowModeDelayExpiresIn float64 `json:"slow_mode_delay_expires_in"` - // True, if members of the chat can be retrieved + // True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers CanGetMembers bool `json:"can_get_members"` - // True, if the chat username can be changed - CanSetUsername bool `json:"can_set_username"` + // True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers + HasHiddenMembers bool `json:"has_hidden_members"` + // True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators + CanHideMembers bool `json:"can_hide_members"` // True, if the 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 supergroup or channel statistics are available CanGetStatistics bool `json:"can_get_statistics"` - // True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators + // True, if aggressive anti-spam checks can be enabled or disabled in the supergroup + CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` + // True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators IsAllHistoryAvailable bool `json:"is_all_history_available"` + // True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators + HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` + // True, if the channel has pinned stories + HasPinnedStories bool `json:"has_pinned_stories"` // 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 to which the supergroup is connected; may be null if none Location *ChatLocation `json:"location"` - // Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only + // Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only InviteLink *ChatInviteLink `json:"invite_link"` // List of commands of bots in the group BotCommands []*BotCommands `json:"bot_commands"` @@ -5788,11 +8278,11 @@ type SecretChat struct { UserId int64 `json:"user_id"` // State of the secret chat State SecretChatState `json:"state"` - // True, if the chat was created by the current user; otherwise false + // True, if the chat was created by the current user; false otherwise IsOutbound bool `json:"is_outbound"` // Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers KeyHash []byte `json:"key_hash"` - // Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101 + // Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101, files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144 Layer int32 `json:"layer"` } @@ -5896,7 +8386,7 @@ func (*MessageSenderChat) MessageSenderType() string { // Represents a list of message senders type MessageSenders struct { meta - // Approximate total count of messages senders found + // Approximate total number of messages senders found TotalCount int32 `json:"total_count"` // List of message senders Senders []MessageSender `json:"senders"` @@ -5937,35 +8427,177 @@ func (messageSenders *MessageSenders) UnmarshalJSON(data []byte) error { return nil } +// Represents a message sender, which can be used to send messages in a chat +type ChatMessageSender struct { + meta + // Available message senders + Sender MessageSender `json:"sender"` + // True, if Telegram Premium is needed to use the message sender + NeedsPremium bool `json:"needs_premium"` +} + +func (entity *ChatMessageSender) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMessageSender + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMessageSender) GetClass() string { + return ClassChatMessageSender +} + +func (*ChatMessageSender) GetType() string { + return TypeChatMessageSender +} + +func (chatMessageSender *ChatMessageSender) UnmarshalJSON(data []byte) error { + var tmp struct { + Sender json.RawMessage `json:"sender"` + NeedsPremium bool `json:"needs_premium"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatMessageSender.NeedsPremium = tmp.NeedsPremium + + fieldSender, _ := UnmarshalMessageSender(tmp.Sender) + chatMessageSender.Sender = fieldSender + + return nil +} + +// Represents a list of message senders, which can be used to send messages in a chat +type ChatMessageSenders struct { + meta + // List of available message senders + Senders []*ChatMessageSender `json:"senders"` +} + +func (entity *ChatMessageSenders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMessageSenders + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMessageSenders) GetClass() string { + return ClassChatMessageSenders +} + +func (*ChatMessageSenders) GetType() string { + return TypeChatMessageSenders +} + +// Represents a viewer of a message +type MessageViewer struct { + meta + // User identifier of the viewer + UserId int64 `json:"user_id"` + // Approximate point in time (Unix timestamp) when the message was viewed + ViewDate int32 `json:"view_date"` +} + +func (entity *MessageViewer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageViewer + + return json.Marshal((*stub)(entity)) +} + +func (*MessageViewer) GetClass() string { + return ClassMessageViewer +} + +func (*MessageViewer) GetType() string { + return TypeMessageViewer +} + +// Represents a list of message viewers +type MessageViewers struct { + meta + // List of message viewers + Viewers []*MessageViewer `json:"viewers"` +} + +func (entity *MessageViewers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageViewers + + return json.Marshal((*stub)(entity)) +} + +func (*MessageViewers) GetClass() string { + return ClassMessageViewers +} + +func (*MessageViewers) GetType() string { + return TypeMessageViewers +} + // The message was originally sent by a known user -type MessageForwardOriginUser struct { +type MessageOriginUser struct { meta // Identifier of the user that originally sent the message SenderUserId int64 `json:"sender_user_id"` } -func (entity *MessageForwardOriginUser) MarshalJSON() ([]byte, error) { +func (entity *MessageOriginUser) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageForwardOriginUser + type stub MessageOriginUser return json.Marshal((*stub)(entity)) } -func (*MessageForwardOriginUser) GetClass() string { - return ClassMessageForwardOrigin +func (*MessageOriginUser) GetClass() string { + return ClassMessageOrigin } -func (*MessageForwardOriginUser) GetType() string { - return TypeMessageForwardOriginUser +func (*MessageOriginUser) GetType() string { + return TypeMessageOriginUser } -func (*MessageForwardOriginUser) MessageForwardOriginType() string { - return TypeMessageForwardOriginUser +func (*MessageOriginUser) MessageOriginType() string { + return TypeMessageOriginUser +} + +// The message was originally sent by a user, which is hidden by their privacy settings +type MessageOriginHiddenUser struct { + meta + // Name of the sender + SenderName string `json:"sender_name"` +} + +func (entity *MessageOriginHiddenUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageOriginHiddenUser + + return json.Marshal((*stub)(entity)) +} + +func (*MessageOriginHiddenUser) GetClass() string { + return ClassMessageOrigin +} + +func (*MessageOriginHiddenUser) GetType() string { + return TypeMessageOriginHiddenUser +} + +func (*MessageOriginHiddenUser) MessageOriginType() string { + return TypeMessageOriginHiddenUser } // The message was originally sent on behalf of a chat -type MessageForwardOriginChat struct { +type MessageOriginChat struct { meta // Identifier of the chat that originally sent the message SenderChatId int64 `json:"sender_chat_id"` @@ -5973,57 +8605,30 @@ type MessageForwardOriginChat struct { AuthorSignature string `json:"author_signature"` } -func (entity *MessageForwardOriginChat) MarshalJSON() ([]byte, error) { +func (entity *MessageOriginChat) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageForwardOriginChat + type stub MessageOriginChat return json.Marshal((*stub)(entity)) } -func (*MessageForwardOriginChat) GetClass() string { - return ClassMessageForwardOrigin +func (*MessageOriginChat) GetClass() string { + return ClassMessageOrigin } -func (*MessageForwardOriginChat) GetType() string { - return TypeMessageForwardOriginChat +func (*MessageOriginChat) GetType() string { + return TypeMessageOriginChat } -func (*MessageForwardOriginChat) MessageForwardOriginType() string { - return TypeMessageForwardOriginChat -} - -// The message was originally sent by a user, which is hidden by their privacy settings -type MessageForwardOriginHiddenUser struct { - meta - // Name of the sender - SenderName string `json:"sender_name"` -} - -func (entity *MessageForwardOriginHiddenUser) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForwardOriginHiddenUser - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForwardOriginHiddenUser) GetClass() string { - return ClassMessageForwardOrigin -} - -func (*MessageForwardOriginHiddenUser) GetType() string { - return TypeMessageForwardOriginHiddenUser -} - -func (*MessageForwardOriginHiddenUser) MessageForwardOriginType() string { - return TypeMessageForwardOriginHiddenUser +func (*MessageOriginChat) MessageOriginType() string { + return TypeMessageOriginChat } // The message was originally a post in a channel -type MessageForwardOriginChannel struct { +type MessageOriginChannel struct { meta - // Identifier of the chat from which the message was originally forwarded + // Identifier of the channel chat to which the message was originally sent ChatId int64 `json:"chat_id"` // Message identifier of the original message MessageId int64 `json:"message_id"` @@ -6031,58 +8636,85 @@ type MessageForwardOriginChannel struct { AuthorSignature string `json:"author_signature"` } -func (entity *MessageForwardOriginChannel) MarshalJSON() ([]byte, error) { +func (entity *MessageOriginChannel) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageForwardOriginChannel + type stub MessageOriginChannel return json.Marshal((*stub)(entity)) } -func (*MessageForwardOriginChannel) GetClass() string { - return ClassMessageForwardOrigin +func (*MessageOriginChannel) GetClass() string { + return ClassMessageOrigin } -func (*MessageForwardOriginChannel) GetType() string { - return TypeMessageForwardOriginChannel +func (*MessageOriginChannel) GetType() string { + return TypeMessageOriginChannel } -func (*MessageForwardOriginChannel) MessageForwardOriginType() string { - return TypeMessageForwardOriginChannel +func (*MessageOriginChannel) MessageOriginType() string { + return TypeMessageOriginChannel } -// The message was imported from an exported message history -type MessageForwardOriginMessageImport struct { +// A reaction with an emoji +type ReactionTypeEmoji struct { meta - // Name of the sender - SenderName string `json:"sender_name"` + // Text representation of the reaction + Emoji string `json:"emoji"` } -func (entity *MessageForwardOriginMessageImport) MarshalJSON() ([]byte, error) { +func (entity *ReactionTypeEmoji) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageForwardOriginMessageImport + type stub ReactionTypeEmoji return json.Marshal((*stub)(entity)) } -func (*MessageForwardOriginMessageImport) GetClass() string { - return ClassMessageForwardOrigin +func (*ReactionTypeEmoji) GetClass() string { + return ClassReactionType } -func (*MessageForwardOriginMessageImport) GetType() string { - return TypeMessageForwardOriginMessageImport +func (*ReactionTypeEmoji) GetType() string { + return TypeReactionTypeEmoji } -func (*MessageForwardOriginMessageImport) MessageForwardOriginType() string { - return TypeMessageForwardOriginMessageImport +func (*ReactionTypeEmoji) ReactionTypeType() string { + return TypeReactionTypeEmoji +} + +// A reaction with a custom emoji +type ReactionTypeCustomEmoji struct { + meta + // Unique identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *ReactionTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionTypeCustomEmoji) GetClass() string { + return ClassReactionType +} + +func (*ReactionTypeCustomEmoji) GetType() string { + return TypeReactionTypeCustomEmoji +} + +func (*ReactionTypeCustomEmoji) ReactionTypeType() string { + return TypeReactionTypeCustomEmoji } // Contains information about a forwarded message type MessageForwardInfo struct { meta - // Origin of a forwarded message - Origin MessageForwardOrigin `json:"origin"` + // Origin of the forwarded message + Origin MessageOrigin `json:"origin"` // Point in time (Unix timestamp) when the message was originally sent Date int32 `json:"date"` // The type of a public service announcement for the forwarded message @@ -6128,12 +8760,37 @@ func (messageForwardInfo *MessageForwardInfo) UnmarshalJSON(data []byte) error { messageForwardInfo.FromChatId = tmp.FromChatId messageForwardInfo.FromMessageId = tmp.FromMessageId - fieldOrigin, _ := UnmarshalMessageForwardOrigin(tmp.Origin) + fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin) messageForwardInfo.Origin = fieldOrigin return nil } +// Contains information about a message created with importMessages +type MessageImportInfo struct { + meta + // Name of the original sender + SenderName string `json:"sender_name"` + // Point in time (Unix timestamp) when the message was originally sent + Date int32 `json:"date"` +} + +func (entity *MessageImportInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageImportInfo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageImportInfo) GetClass() string { + return ClassMessageImportInfo +} + +func (*MessageImportInfo) GetType() string { + return TypeMessageImportInfo +} + // Contains information about replies to a message type MessageReplyInfo struct { meta @@ -6190,6 +8847,66 @@ func (messageReplyInfo *MessageReplyInfo) UnmarshalJSON(data []byte) error { return nil } +// Contains information about a reaction to a message +type MessageReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // Number of times the reaction was added + TotalCount int32 `json:"total_count"` + // True, if the reaction is chosen by the current user + IsChosen bool `json:"is_chosen"` + // Identifier of the message sender used by the current user to add the reaction; null if unknown or the reaction isn't chosen + UsedSenderId MessageSender `json:"used_sender_id"` + // Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats + RecentSenderIds []MessageSender `json:"recent_sender_ids"` +} + +func (entity *MessageReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReaction + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReaction) GetClass() string { + return ClassMessageReaction +} + +func (*MessageReaction) GetType() string { + return TypeMessageReaction +} + +func (messageReaction *MessageReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + TotalCount int32 `json:"total_count"` + IsChosen bool `json:"is_chosen"` + UsedSenderId json.RawMessage `json:"used_sender_id"` + RecentSenderIds []json.RawMessage `json:"recent_sender_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageReaction.TotalCount = tmp.TotalCount + messageReaction.IsChosen = tmp.IsChosen + + fieldType, _ := UnmarshalReactionType(tmp.Type) + messageReaction.Type = fieldType + + fieldUsedSenderId, _ := UnmarshalMessageSender(tmp.UsedSenderId) + messageReaction.UsedSenderId = fieldUsedSenderId + + fieldRecentSenderIds, _ := UnmarshalListOfMessageSender(tmp.RecentSenderIds) + messageReaction.RecentSenderIds = fieldRecentSenderIds + + return nil +} + // Contains information about interactions with a message type MessageInteractionInfo struct { meta @@ -6199,6 +8916,8 @@ type MessageInteractionInfo struct { ForwardCount int32 `json:"forward_count"` // Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself ReplyInfo *MessageReplyInfo `json:"reply_info"` + // The list of reactions added to the message + Reactions []*MessageReaction `json:"reactions"` } func (entity *MessageInteractionInfo) MarshalJSON() ([]byte, error) { @@ -6217,9 +8936,61 @@ func (*MessageInteractionInfo) GetType() string { return TypeMessageInteractionInfo } +// Contains information about an unread reaction to a message +type UnreadReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // Identifier of the sender, added the reaction + SenderId MessageSender `json:"sender_id"` + // True, if the reaction was added with a big animation + IsBig bool `json:"is_big"` +} + +func (entity *UnreadReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UnreadReaction + + return json.Marshal((*stub)(entity)) +} + +func (*UnreadReaction) GetClass() string { + return ClassUnreadReaction +} + +func (*UnreadReaction) GetType() string { + return TypeUnreadReaction +} + +func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + SenderId json.RawMessage `json:"sender_id"` + IsBig bool `json:"is_big"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + unreadReaction.IsBig = tmp.IsBig + + fieldType, _ := UnmarshalReactionType(tmp.Type) + unreadReaction.Type = fieldType + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + unreadReaction.SenderId = fieldSenderId + + return nil +} + // The message is being sent now, but has not yet been delivered to the server type MessageSendingStatePending struct { meta + // Non-persistent message sending identifier, specified by the application + SendingId int32 `json:"sending_id"` } func (entity *MessageSendingStatePending) MarshalJSON() ([]byte, error) { @@ -6245,14 +9016,16 @@ func (*MessageSendingStatePending) MessageSendingStateType() string { // The message failed to be sent type MessageSendingStateFailed struct { meta - // An error code; 0 if unknown - ErrorCode int32 `json:"error_code"` - // Error message - ErrorMessage string `json:"error_message"` + // The cause of the message sending failure + Error *Error `json:"error"` // True, if the message can be re-sent CanRetry bool `json:"can_retry"` // True, if the message can be re-sent only on behalf of a different sender NeedAnotherSender bool `json:"need_another_sender"` + // True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message + NeedAnotherReplyQuote bool `json:"need_another_reply_quote"` + // True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages + NeedDropReply bool `json:"need_drop_reply"` // Time left before the message can be re-sent, in seconds. No update is sent when this field changes RetryAfter float64 `json:"retry_after"` } @@ -6277,6 +9050,165 @@ func (*MessageSendingStateFailed) MessageSendingStateType() string { return TypeMessageSendingStateFailed } +// Describes a message replied by a given message +type MessageReplyToMessage struct { + meta + // The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat + ChatId int64 `json:"chat_id"` + // The identifier of the message; may be 0 if the replied message is in unknown chat + MessageId int64 `json:"message_id"` + // Manually or automatically chosen quote from the replied message; may be null if none. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the quote + Quote *FormattedText `json:"quote"` + // True, if the quote was manually chosen by the message sender + IsQuoteManual bool `json:"is_quote_manual"` + // Information about origin of the message if the message was replied from another chat; may be null for messages from the same chat + Origin MessageOrigin `json:"origin"` + // Point in time (Unix timestamp) when the message was sent if the message was replied from another chat; 0 for messages from the same chat + OriginSendDate int32 `json:"origin_send_date"` + // Media content of the message if the message was replied from another chat; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, messagePhoto, messagePoll, messagePremiumGiveaway, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote + Content MessageContent `json:"content"` +} + +func (entity *MessageReplyToMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReplyToMessage + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReplyToMessage) GetClass() string { + return ClassMessageReplyTo +} + +func (*MessageReplyToMessage) GetType() string { + return TypeMessageReplyToMessage +} + +func (*MessageReplyToMessage) MessageReplyToType() string { + return TypeMessageReplyToMessage +} + +func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageId int64 `json:"message_id"` + Quote *FormattedText `json:"quote"` + IsQuoteManual bool `json:"is_quote_manual"` + Origin json.RawMessage `json:"origin"` + OriginSendDate int32 `json:"origin_send_date"` + Content json.RawMessage `json:"content"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageReplyToMessage.ChatId = tmp.ChatId + messageReplyToMessage.MessageId = tmp.MessageId + messageReplyToMessage.Quote = tmp.Quote + messageReplyToMessage.IsQuoteManual = tmp.IsQuoteManual + messageReplyToMessage.OriginSendDate = tmp.OriginSendDate + + fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin) + messageReplyToMessage.Origin = fieldOrigin + + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + messageReplyToMessage.Content = fieldContent + + return nil +} + +// Describes a story replied by a given message +type MessageReplyToStory struct { + meta + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` +} + +func (entity *MessageReplyToStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReplyToStory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReplyToStory) GetClass() string { + return ClassMessageReplyTo +} + +func (*MessageReplyToStory) GetType() string { + return TypeMessageReplyToStory +} + +func (*MessageReplyToStory) MessageReplyToType() string { + return TypeMessageReplyToStory +} + +// Describes a message to be replied +type InputMessageReplyToMessage struct { + meta + // The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat only if message.can_be_replied_in_another_chat + ChatId int64 `json:"chat_id"` + // The identifier of the message to be replied in the same or the specified chat + MessageId int64 `json:"message_id"` + // Manually chosen quote from the message to be replied; pass null if none; 0-getOption("message_reply_quote_length_max") characters. Must always be null for replies in secret chats. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote + Quote *FormattedText `json:"quote"` +} + +func (entity *InputMessageReplyToMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageReplyToMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageReplyToMessage) GetClass() string { + return ClassInputMessageReplyTo +} + +func (*InputMessageReplyToMessage) GetType() string { + return TypeInputMessageReplyToMessage +} + +func (*InputMessageReplyToMessage) InputMessageReplyToType() string { + return TypeInputMessageReplyToMessage +} + +// Describes a story to be replied +type InputMessageReplyToStory struct { + meta + // The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` +} + +func (entity *InputMessageReplyToStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageReplyToStory + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageReplyToStory) GetClass() string { + return ClassInputMessageReplyTo +} + +func (*InputMessageReplyToStory) GetType() string { + return TypeInputMessageReplyToStory +} + +func (*InputMessageReplyToStory) InputMessageReplyToType() string { + return TypeInputMessageReplyToStory +} + // Describes a message type Message struct { meta @@ -6286,9 +9218,9 @@ type Message struct { SenderId MessageSender `json:"sender_id"` // Chat identifier ChatId int64 `json:"chat_id"` - // The sending state of the message; may be null + // The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent SendingState MessageSendingState `json:"sending_state"` - // The scheduling state of the message; may be null + // The scheduling state of the message; may be null if the message isn't scheduled SchedulingState MessageSchedulingState `json:"scheduling_state"` // True, if the message is outgoing IsOutgoing bool `json:"is_outgoing"` @@ -6298,44 +9230,56 @@ type Message struct { CanBeEdited bool `json:"can_be_edited"` // True, if the message can be forwarded CanBeForwarded bool `json:"can_be_forwarded"` + // True, if the message can be replied in another chat + CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` // True, if content of the message can be saved locally or copied CanBeSaved bool `json:"can_be_saved"` // True, if the message can be deleted only for the current user while other users will continue to see it CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` // True, if the message can be deleted for all users CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - // True, if the message statistics are available + // True, if the list of added reactions is available through getMessageAddedReactions + CanGetAddedReactions bool `json:"can_get_added_reactions"` + // True, if the message statistics are available through getMessageStatistics CanGetStatistics bool `json:"can_get_statistics"` - // True, if the message thread info is available + // True, if information about the message thread is available through getMessageThread and getMessageThreadHistory CanGetMessageThread bool `json:"can_get_message_thread"` // True, if chat members already viewed the message can be received through getMessageViewers CanGetViewers bool `json:"can_get_viewers"` - // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description + // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` + // True, if reactions on the message can be reported through reportMessageReactions + CanReportReactions bool `json:"can_report_reactions"` // True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message HasTimestampedMedia bool `json:"has_timestamped_media"` // True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts IsChannelPost bool `json:"is_channel_post"` + // True, if the message is a forum topic message + IsTopicMessage bool `json:"is_topic_message"` // True, if the message contains an unread mention for the current user ContainsUnreadMention bool `json:"contains_unread_mention"` // Point in time (Unix timestamp) when the message was sent Date int32 `json:"date"` // Point in time (Unix timestamp) when the message was last edited EditDate int32 `json:"edit_date"` - // Information about the initial message sender; may be null + // Information about the initial message sender; may be null if none or unknown ForwardInfo *MessageForwardInfo `json:"forward_info"` - // Information about interactions with the message; may be null + // Information about the initial message for messages created with importMessages; may be null if the message isn't imported + ImportInfo *MessageImportInfo `json:"import_info"` + // Information about interactions with the message; may be null if none InteractionInfo *MessageInteractionInfo `json:"interaction_info"` - // If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id - ReplyInChatId int64 `json:"reply_in_chat_id"` - // If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about unread reactions added to the message + UnreadReactions []*UnreadReaction `json:"unread_reactions"` + // Information about the message or the story this message is replying to; may be null if none + ReplyTo MessageReplyTo `json:"reply_to"` // If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs MessageThreadId int64 `json:"message_thread_id"` - // For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires - Ttl int32 `json:"ttl"` - // Time left before the message expires, in seconds. If the TTL timer isn't started yet, equals to the value of the ttl field - TtlExpiresIn float64 `json:"ttl_expires_in"` + // The message's self-destruct type; may be null if none + SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` + // Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet + SelfDestructIn float64 `json:"self_destruct_in"` + // Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never + AutoDeleteIn float64 `json:"auto_delete_in"` // If non-zero, the user identifier of the bot through which this message was sent ViaBotUserId int64 `json:"via_bot_user_id"` // For channel posts and anonymous group messages, optional author signature @@ -6346,7 +9290,7 @@ type Message struct { RestrictionReason string `json:"restriction_reason"` // Content of the message Content MessageContent `json:"content"` - // Reply markup for the message; may be null + // Reply markup for the message; may be null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` } @@ -6377,25 +9321,31 @@ func (message *Message) UnmarshalJSON(data []byte) error { IsPinned bool `json:"is_pinned"` CanBeEdited bool `json:"can_be_edited"` CanBeForwarded bool `json:"can_be_forwarded"` + CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` CanBeSaved bool `json:"can_be_saved"` CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` + CanGetAddedReactions bool `json:"can_get_added_reactions"` CanGetStatistics bool `json:"can_get_statistics"` CanGetMessageThread bool `json:"can_get_message_thread"` CanGetViewers bool `json:"can_get_viewers"` CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` + CanReportReactions bool `json:"can_report_reactions"` HasTimestampedMedia bool `json:"has_timestamped_media"` IsChannelPost bool `json:"is_channel_post"` + IsTopicMessage bool `json:"is_topic_message"` ContainsUnreadMention bool `json:"contains_unread_mention"` Date int32 `json:"date"` EditDate int32 `json:"edit_date"` ForwardInfo *MessageForwardInfo `json:"forward_info"` + ImportInfo *MessageImportInfo `json:"import_info"` InteractionInfo *MessageInteractionInfo `json:"interaction_info"` - ReplyInChatId int64 `json:"reply_in_chat_id"` - ReplyToMessageId int64 `json:"reply_to_message_id"` + UnreadReactions []*UnreadReaction `json:"unread_reactions"` + ReplyTo json.RawMessage `json:"reply_to"` MessageThreadId int64 `json:"message_thread_id"` - Ttl int32 `json:"ttl"` - TtlExpiresIn float64 `json:"ttl_expires_in"` + SelfDestructType json.RawMessage `json:"self_destruct_type"` + SelfDestructIn float64 `json:"self_destruct_in"` + AutoDeleteIn float64 `json:"auto_delete_in"` ViaBotUserId int64 `json:"via_bot_user_id"` AuthorSignature string `json:"author_signature"` MediaAlbumId JsonInt64 `json:"media_album_id"` @@ -6415,25 +9365,29 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.IsPinned = tmp.IsPinned message.CanBeEdited = tmp.CanBeEdited message.CanBeForwarded = tmp.CanBeForwarded + message.CanBeRepliedInAnotherChat = tmp.CanBeRepliedInAnotherChat message.CanBeSaved = tmp.CanBeSaved message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers + message.CanGetAddedReactions = tmp.CanGetAddedReactions message.CanGetStatistics = tmp.CanGetStatistics message.CanGetMessageThread = tmp.CanGetMessageThread message.CanGetViewers = tmp.CanGetViewers message.CanGetMediaTimestampLinks = tmp.CanGetMediaTimestampLinks + message.CanReportReactions = tmp.CanReportReactions message.HasTimestampedMedia = tmp.HasTimestampedMedia message.IsChannelPost = tmp.IsChannelPost + message.IsTopicMessage = tmp.IsTopicMessage message.ContainsUnreadMention = tmp.ContainsUnreadMention message.Date = tmp.Date message.EditDate = tmp.EditDate message.ForwardInfo = tmp.ForwardInfo + message.ImportInfo = tmp.ImportInfo message.InteractionInfo = tmp.InteractionInfo - message.ReplyInChatId = tmp.ReplyInChatId - message.ReplyToMessageId = tmp.ReplyToMessageId + message.UnreadReactions = tmp.UnreadReactions message.MessageThreadId = tmp.MessageThreadId - message.Ttl = tmp.Ttl - message.TtlExpiresIn = tmp.TtlExpiresIn + message.SelfDestructIn = tmp.SelfDestructIn + message.AutoDeleteIn = tmp.AutoDeleteIn message.ViaBotUserId = tmp.ViaBotUserId message.AuthorSignature = tmp.AuthorSignature message.MediaAlbumId = tmp.MediaAlbumId @@ -6448,6 +9402,12 @@ func (message *Message) UnmarshalJSON(data []byte) error { fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) message.SchedulingState = fieldSchedulingState + fieldReplyTo, _ := UnmarshalMessageReplyTo(tmp.ReplyTo) + message.ReplyTo = fieldReplyTo + + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) + message.SelfDestructType = fieldSelfDestructType + fieldContent, _ := UnmarshalMessageContent(tmp.Content) message.Content = fieldContent @@ -6460,7 +9420,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { // Contains a list of messages type Messages struct { meta - // Approximate total count of messages found + // Approximate total number of messages found TotalCount int32 `json:"total_count"` // List of messages; messages may be null Messages []*Message `json:"messages"` @@ -6485,7 +9445,7 @@ func (*Messages) GetType() string { // Contains a list of messages found by a search type FoundMessages struct { meta - // Approximate total count of messages found; -1 if unknown + // Approximate total number of messages found; -1 if unknown TotalCount int32 `json:"total_count"` // List of messages Messages []*Message `json:"messages"` @@ -6509,6 +9469,33 @@ func (*FoundMessages) GetType() string { return TypeFoundMessages } +// Contains a list of messages found by a search in a given chat +type FoundChatMessages struct { + meta + // Approximate total number of messages found; -1 if unknown + TotalCount int32 `json:"total_count"` + // List of messages + Messages []*Message `json:"messages"` + // The offset for the next request. If 0, there are no more results + NextFromMessageId int64 `json:"next_from_message_id"` +} + +func (entity *FoundChatMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundChatMessages + + return json.Marshal((*stub)(entity)) +} + +func (*FoundChatMessages) GetClass() string { + return ClassFoundChatMessages +} + +func (*FoundChatMessages) GetType() string { + return TypeFoundChatMessages +} + // Contains information about a message in a specific position type MessagePosition struct { meta @@ -6539,7 +9526,7 @@ func (*MessagePosition) GetType() string { // Contains a list of message positions type MessagePositions struct { meta - // Total count of messages found + // Total number of messages found TotalCount int32 `json:"total_count"` // List of message positions Positions []*MessagePosition `json:"positions"` @@ -6611,17 +9598,471 @@ func (*MessageCalendar) GetType() string { return TypeMessageCalendar } +// The message is from a chat history +type MessageSourceChatHistory struct { + meta +} + +func (entity *MessageSourceChatHistory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceChatHistory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceChatHistory) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceChatHistory) GetType() string { + return TypeMessageSourceChatHistory +} + +func (*MessageSourceChatHistory) MessageSourceType() string { + return TypeMessageSourceChatHistory +} + +// The message is from a message thread history +type MessageSourceMessageThreadHistory struct { + meta +} + +func (entity *MessageSourceMessageThreadHistory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceMessageThreadHistory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceMessageThreadHistory) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceMessageThreadHistory) GetType() string { + return TypeMessageSourceMessageThreadHistory +} + +func (*MessageSourceMessageThreadHistory) MessageSourceType() string { + return TypeMessageSourceMessageThreadHistory +} + +// The message is from a forum topic history +type MessageSourceForumTopicHistory struct { + meta +} + +func (entity *MessageSourceForumTopicHistory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceForumTopicHistory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceForumTopicHistory) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceForumTopicHistory) GetType() string { + return TypeMessageSourceForumTopicHistory +} + +func (*MessageSourceForumTopicHistory) MessageSourceType() string { + return TypeMessageSourceForumTopicHistory +} + +// The message is from chat, message thread or forum topic history preview +type MessageSourceHistoryPreview struct { + meta +} + +func (entity *MessageSourceHistoryPreview) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceHistoryPreview + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceHistoryPreview) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceHistoryPreview) GetType() string { + return TypeMessageSourceHistoryPreview +} + +func (*MessageSourceHistoryPreview) MessageSourceType() string { + return TypeMessageSourceHistoryPreview +} + +// The message is from a chat list or a forum topic list +type MessageSourceChatList struct { + meta +} + +func (entity *MessageSourceChatList) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceChatList + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceChatList) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceChatList) GetType() string { + return TypeMessageSourceChatList +} + +func (*MessageSourceChatList) MessageSourceType() string { + return TypeMessageSourceChatList +} + +// The message is from search results, including file downloads, local file list, outgoing document messages, calendar +type MessageSourceSearch struct { + meta +} + +func (entity *MessageSourceSearch) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceSearch + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceSearch) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceSearch) GetType() string { + return TypeMessageSourceSearch +} + +func (*MessageSourceSearch) MessageSourceType() string { + return TypeMessageSourceSearch +} + +// The message is from a chat event log +type MessageSourceChatEventLog struct { + meta +} + +func (entity *MessageSourceChatEventLog) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceChatEventLog + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceChatEventLog) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceChatEventLog) GetType() string { + return TypeMessageSourceChatEventLog +} + +func (*MessageSourceChatEventLog) MessageSourceType() string { + return TypeMessageSourceChatEventLog +} + +// The message is from a notification +type MessageSourceNotification struct { + meta +} + +func (entity *MessageSourceNotification) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceNotification + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceNotification) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceNotification) GetType() string { + return TypeMessageSourceNotification +} + +func (*MessageSourceNotification) MessageSourceType() string { + return TypeMessageSourceNotification +} + +// The message was screenshotted; the source must be used only if the message content was visible during the screenshot +type MessageSourceScreenshot struct { + meta +} + +func (entity *MessageSourceScreenshot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceScreenshot + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceScreenshot) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceScreenshot) GetType() string { + return TypeMessageSourceScreenshot +} + +func (*MessageSourceScreenshot) MessageSourceType() string { + return TypeMessageSourceScreenshot +} + +// The message is from some other source +type MessageSourceOther struct { + meta +} + +func (entity *MessageSourceOther) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceOther + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceOther) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceOther) GetType() string { + return TypeMessageSourceOther +} + +func (*MessageSourceOther) MessageSourceType() string { + return TypeMessageSourceOther +} + +// The sponsor is a bot +type MessageSponsorTypeBot struct { + meta + // User identifier of the bot + BotUserId int64 `json:"bot_user_id"` + // An internal link to be opened when the sponsored message is clicked + Link InternalLinkType `json:"link"` +} + +func (entity *MessageSponsorTypeBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypeBot + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypeBot) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypeBot) GetType() string { + return TypeMessageSponsorTypeBot +} + +func (*MessageSponsorTypeBot) MessageSponsorTypeType() string { + return TypeMessageSponsorTypeBot +} + +func (messageSponsorTypeBot *MessageSponsorTypeBot) UnmarshalJSON(data []byte) error { + var tmp struct { + BotUserId int64 `json:"bot_user_id"` + Link json.RawMessage `json:"link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsorTypeBot.BotUserId = tmp.BotUserId + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + messageSponsorTypeBot.Link = fieldLink + + return nil +} + +// The sponsor is a public channel chat +type MessageSponsorTypePublicChannel struct { + meta + // Sponsor chat identifier + ChatId int64 `json:"chat_id"` + // An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead + Link InternalLinkType `json:"link"` +} + +func (entity *MessageSponsorTypePublicChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypePublicChannel + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypePublicChannel) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypePublicChannel) GetType() string { + return TypeMessageSponsorTypePublicChannel +} + +func (*MessageSponsorTypePublicChannel) MessageSponsorTypeType() string { + return TypeMessageSponsorTypePublicChannel +} + +func (messageSponsorTypePublicChannel *MessageSponsorTypePublicChannel) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + Link json.RawMessage `json:"link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsorTypePublicChannel.ChatId = tmp.ChatId + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + messageSponsorTypePublicChannel.Link = fieldLink + + return nil +} + +// The sponsor is a private channel chat +type MessageSponsorTypePrivateChannel struct { + meta + // Title of the chat + Title string `json:"title"` + // Invite link for the channel + InviteLink string `json:"invite_link"` +} + +func (entity *MessageSponsorTypePrivateChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypePrivateChannel + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypePrivateChannel) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypePrivateChannel) GetType() string { + return TypeMessageSponsorTypePrivateChannel +} + +func (*MessageSponsorTypePrivateChannel) MessageSponsorTypeType() string { + return TypeMessageSponsorTypePrivateChannel +} + +// The sponsor is a website +type MessageSponsorTypeWebsite struct { + meta + // URL of the website + Url string `json:"url"` + // Name of the website + Name string `json:"name"` +} + +func (entity *MessageSponsorTypeWebsite) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypeWebsite + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypeWebsite) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypeWebsite) GetType() string { + return TypeMessageSponsorTypeWebsite +} + +func (*MessageSponsorTypeWebsite) MessageSponsorTypeType() string { + return TypeMessageSponsorTypeWebsite +} + +// Information about the sponsor of a message +type MessageSponsor struct { + meta + // Type of the sponsor + Type MessageSponsorType `json:"type"` + // Photo of the sponsor; may be null if must not be shown + Photo *ChatPhotoInfo `json:"photo"` + // Additional optional information about the sponsor to be shown along with the message + Info string `json:"info"` +} + +func (entity *MessageSponsor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsor + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsor) GetClass() string { + return ClassMessageSponsor +} + +func (*MessageSponsor) GetType() string { + return TypeMessageSponsor +} + +func (messageSponsor *MessageSponsor) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + Photo *ChatPhotoInfo `json:"photo"` + Info string `json:"info"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsor.Photo = tmp.Photo + messageSponsor.Info = tmp.Info + + fieldType, _ := UnmarshalMessageSponsorType(tmp.Type) + messageSponsor.Type = fieldType + + return nil +} + // Describes a sponsored message type SponsoredMessage struct { meta // Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages MessageId int64 `json:"message_id"` - // Chat identifier - SponsorChatId int64 `json:"sponsor_chat_id"` - // An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead - Link InternalLinkType `json:"link"` + // True, if the message needs to be labeled as "recommended" instead of "sponsored" + IsRecommended bool `json:"is_recommended"` // Content of the message. Currently, can be only of the type messageText Content MessageContent `json:"content"` + // Information about the sponsor of the message + Sponsor *MessageSponsor `json:"sponsor"` + // If non-empty, additional information about the sponsored message to be shown along with the message + AdditionalInfo string `json:"additional_info"` } func (entity *SponsoredMessage) MarshalJSON() ([]byte, error) { @@ -6642,10 +10083,11 @@ func (*SponsoredMessage) GetType() string { func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { var tmp struct { - MessageId int64 `json:"message_id"` - SponsorChatId int64 `json:"sponsor_chat_id"` - Link json.RawMessage `json:"link"` - Content json.RawMessage `json:"content"` + MessageId int64 `json:"message_id"` + IsRecommended bool `json:"is_recommended"` + Content json.RawMessage `json:"content"` + Sponsor *MessageSponsor `json:"sponsor"` + AdditionalInfo string `json:"additional_info"` } err := json.Unmarshal(data, &tmp) @@ -6654,10 +10096,9 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { } sponsoredMessage.MessageId = tmp.MessageId - sponsoredMessage.SponsorChatId = tmp.SponsorChatId - - fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) - sponsoredMessage.Link = fieldLink + sponsoredMessage.IsRecommended = tmp.IsRecommended + sponsoredMessage.Sponsor = tmp.Sponsor + sponsoredMessage.AdditionalInfo = tmp.AdditionalInfo fieldContent, _ := UnmarshalMessageContent(tmp.Content) sponsoredMessage.Content = fieldContent @@ -6665,6 +10106,116 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { return nil } +// Contains a list of sponsored messages +type SponsoredMessages struct { + meta + // List of sponsored messages + Messages []*SponsoredMessage `json:"messages"` + // The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages + MessagesBetween int32 `json:"messages_between"` +} + +func (entity *SponsoredMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SponsoredMessages + + return json.Marshal((*stub)(entity)) +} + +func (*SponsoredMessages) GetClass() string { + return ClassSponsoredMessages +} + +func (*SponsoredMessages) GetType() string { + return TypeSponsoredMessages +} + +// Describes a file added to file download list +type FileDownload struct { + meta + // File identifier + FileId int32 `json:"file_id"` + // The message with the file + Message *Message `json:"message"` + // Point in time (Unix timestamp) when the file was added to the download list + AddDate int32 `json:"add_date"` + // Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed + CompleteDate int32 `json:"complete_date"` + // True, if downloading of the file is paused + IsPaused bool `json:"is_paused"` +} + +func (entity *FileDownload) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileDownload + + return json.Marshal((*stub)(entity)) +} + +func (*FileDownload) GetClass() string { + return ClassFileDownload +} + +func (*FileDownload) GetType() string { + return TypeFileDownload +} + +// Contains number of being downloaded and recently downloaded files found +type DownloadedFileCounts struct { + meta + // Number of active file downloads found, including paused + ActiveCount int32 `json:"active_count"` + // Number of paused file downloads found + PausedCount int32 `json:"paused_count"` + // Number of completed file downloads found + CompletedCount int32 `json:"completed_count"` +} + +func (entity *DownloadedFileCounts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DownloadedFileCounts + + return json.Marshal((*stub)(entity)) +} + +func (*DownloadedFileCounts) GetClass() string { + return ClassDownloadedFileCounts +} + +func (*DownloadedFileCounts) GetType() string { + return TypeDownloadedFileCounts +} + +// Contains a list of downloaded files, found by a search +type FoundFileDownloads struct { + meta + // Total number of suitable files, ignoring offset + TotalCounts *DownloadedFileCounts `json:"total_counts"` + // The list of files + Files []*FileDownload `json:"files"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *FoundFileDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundFileDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*FoundFileDownloads) GetClass() string { + return ClassFoundFileDownloads +} + +func (*FoundFileDownloads) GetType() string { + return TypeFoundFileDownloads +} + // Notification settings applied to all private and secret chats when the corresponding chat setting has a default value type NotificationSettingsScopePrivateChats struct { meta @@ -6690,7 +10241,7 @@ func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() st return TypeNotificationSettingsScopePrivateChats } -// Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value +// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value type NotificationSettingsScopeGroupChats struct { meta } @@ -6715,7 +10266,7 @@ func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() stri return TypeNotificationSettingsScopeGroupChats } -// Notification settings applied to all channels when the corresponding chat setting has a default value +// Notification settings applied to all channel chats when the corresponding chat setting has a default value type NotificationSettingsScopeChannelChats struct { meta } @@ -6740,26 +10291,38 @@ func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() st return TypeNotificationSettingsScopeChannelChats } -// Contains information about notification settings for a chat +// Contains information about notification settings for a chat or a forum topic type ChatNotificationSettings struct { meta - // If true, mute_for is ignored and the value for the relevant type of chat is used instead + // If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead UseDefaultMuteFor bool `json:"use_default_mute_for"` // Time left before notifications will be unmuted, in seconds MuteFor int32 `json:"mute_for"` - // If true, sound is ignored and the value for the relevant type of chat is used instead + // If true, the value for the relevant type of chat or the forum chat is used instead of sound_id UseDefaultSound bool `json:"use_default_sound"` - // The name of an audio file to be used for notification sounds; only applies to iOS applications - Sound string `json:"sound"` - // If true, show_preview is ignored and the value for the relevant type of chat is used instead + // Identifier of the notification sound to be played for messages; 0 if sound is disabled + SoundId JsonInt64 `json:"sound_id"` + // If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead UseDefaultShowPreview bool `json:"use_default_show_preview"` // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` - // If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead + // If true, mute_stories is ignored and the value for the relevant type of chat is used instead + UseDefaultMuteStories bool `json:"use_default_mute_stories"` + // True, if story notifications are disabled for the chat + MuteStories bool `json:"mute_stories"` + // If true, the value for the relevant type of chat is used instead of story_sound_id + UseDefaultStorySound bool `json:"use_default_story_sound"` + // Identifier of the notification sound to be played for stories; 0 if sound is disabled + StorySoundId JsonInt64 `json:"story_sound_id"` + // If true, show_story_sender is ignored and the value for the relevant type of chat is used instead + UseDefaultShowStorySender bool `json:"use_default_show_story_sender"` + // True, if the sender of stories must be displayed in notifications + ShowStorySender bool `json:"show_story_sender"` + // If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead UseDefaultDisablePinnedMessageNotifications bool `json:"use_default_disable_pinned_message_notifications"` // If true, notifications for incoming pinned messages will be created as for an ordinary unread message DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"` - // If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead + // If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead UseDefaultDisableMentionNotifications bool `json:"use_default_disable_mention_notifications"` // If true, notifications for messages with mentions will be created as for an ordinary unread message DisableMentionNotifications bool `json:"disable_mention_notifications"` @@ -6786,10 +10349,18 @@ type ScopeNotificationSettings struct { meta // Time left before notifications will be unmuted, in seconds MuteFor int32 `json:"mute_for"` - // The name of an audio file to be used for notification sounds; only applies to iOS applications - Sound string `json:"sound"` + // Identifier of the notification sound to be played; 0 if sound is disabled + SoundId JsonInt64 `json:"sound_id"` // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` + // If true, mute_stories is ignored and story notifications are received only for the first 5 chats from topChatCategoryUsers + UseDefaultMuteStories bool `json:"use_default_mute_stories"` + // True, if story notifications are disabled for the chat + MuteStories bool `json:"mute_stories"` + // Identifier of the notification sound to be played for stories; 0 if sound is disabled + StorySoundId JsonInt64 `json:"story_sound_id"` + // True, if the sender of stories must be displayed in notifications + ShowStorySender bool `json:"show_story_sender"` // True, if notifications for incoming pinned messages will be created as for an ordinary unread message DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"` // True, if notifications for messages with mentions will be created as for an ordinary unread message @@ -6815,8 +10386,8 @@ func (*ScopeNotificationSettings) GetType() string { // Contains information about a message draft type DraftMessage struct { meta - // Identifier of the message to reply to; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Point in time (Unix timestamp) when the draft was created Date int32 `json:"date"` // Content of the message draft; must be of the type inputMessageText @@ -6841,7 +10412,7 @@ func (*DraftMessage) GetType() string { func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { var tmp struct { - ReplyToMessageId int64 `json:"reply_to_message_id"` + ReplyTo json.RawMessage `json:"reply_to"` Date int32 `json:"date"` InputMessageText json.RawMessage `json:"input_message_text"` } @@ -6851,9 +10422,11 @@ func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { return err } - draftMessage.ReplyToMessageId = tmp.ReplyToMessageId draftMessage.Date = tmp.Date + fieldReplyTo, _ := UnmarshalInputMessageReplyTo(tmp.ReplyTo) + draftMessage.ReplyTo = fieldReplyTo + fieldInputMessageText, _ := UnmarshalInputMessageContent(tmp.InputMessageText) draftMessage.InputMessageText = fieldInputMessageText @@ -6972,18 +10545,43 @@ func (*ChatTypeSecret) ChatTypeType() string { return TypeChatTypeSecret } -// Represents a filter of user chats -type ChatFilter struct { +// Represents an icon for a chat folder +type ChatFolderIcon struct { meta - // The title of the filter; 1-12 characters without line feeds + // The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" + Name string `json:"name"` +} + +func (entity *ChatFolderIcon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderIcon + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderIcon) GetClass() string { + return ClassChatFolderIcon +} + +func (*ChatFolderIcon) GetType() string { + return TypeChatFolderIcon +} + +// Represents a folder for user chats +type ChatFolder struct { + meta + // The title of the folder; 1-12 characters without line feeds Title string `json:"title"` - // The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". If empty, use getChatFilterDefaultIconName to get default icon name for the filter - IconName string `json:"icon_name"` - // The chat identifiers of pinned chats in the filtered chat list + // The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder + Icon *ChatFolderIcon `json:"icon"` + // True, if at least one link has been created for the folder + IsShareable bool `json:"is_shareable"` + // The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium PinnedChatIds []int64 `json:"pinned_chat_ids"` - // The chat identifiers of always included chats in the filtered chat list + // The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium IncludedChatIds []int64 `json:"included_chat_ids"` - // The chat identifiers of always excluded chats in the filtered chat list + // The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium ExcludedChatIds []int64 `json:"excluded_chat_ids"` // True, if muted chats need to be excluded ExcludeMuted bool `json:"exclude_muted"` @@ -7003,95 +10601,203 @@ type ChatFilter struct { IncludeChannels bool `json:"include_channels"` } -func (entity *ChatFilter) MarshalJSON() ([]byte, error) { +func (entity *ChatFolder) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatFilter + type stub ChatFolder return json.Marshal((*stub)(entity)) } -func (*ChatFilter) GetClass() string { - return ClassChatFilter +func (*ChatFolder) GetClass() string { + return ClassChatFolder } -func (*ChatFilter) GetType() string { - return TypeChatFilter +func (*ChatFolder) GetType() string { + return TypeChatFolder } -// Contains basic information about a chat filter -type ChatFilterInfo struct { +// Contains basic information about a chat folder +type ChatFolderInfo struct { meta - // Unique chat filter identifier + // Unique chat folder identifier Id int32 `json:"id"` - // The title of the filter; 1-12 characters without line feeds + // The title of the folder; 1-12 characters without line feeds Title string `json:"title"` - // The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" - IconName string `json:"icon_name"` + // The chosen or default icon for the chat folder + Icon *ChatFolderIcon `json:"icon"` + // True, if at least one link has been created for the folder + IsShareable bool `json:"is_shareable"` + // True, if the chat folder has invite links created by the current user + HasMyInviteLinks bool `json:"has_my_invite_links"` } -func (entity *ChatFilterInfo) MarshalJSON() ([]byte, error) { +func (entity *ChatFolderInfo) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatFilterInfo + type stub ChatFolderInfo return json.Marshal((*stub)(entity)) } -func (*ChatFilterInfo) GetClass() string { - return ClassChatFilterInfo +func (*ChatFolderInfo) GetClass() string { + return ClassChatFolderInfo } -func (*ChatFilterInfo) GetType() string { - return TypeChatFilterInfo +func (*ChatFolderInfo) GetType() string { + return TypeChatFolderInfo } -// Describes a recommended chat filter -type RecommendedChatFilter struct { +// Contains a chat folder invite link +type ChatFolderInviteLink struct { meta - // The chat filter - Filter *ChatFilter `json:"filter"` - // Chat filter description + // The chat folder invite link + InviteLink string `json:"invite_link"` + // Name of the link + Name string `json:"name"` + // Identifiers of chats, included in the link + ChatIds []int64 `json:"chat_ids"` +} + +func (entity *ChatFolderInviteLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderInviteLink + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderInviteLink) GetClass() string { + return ClassChatFolderInviteLink +} + +func (*ChatFolderInviteLink) GetType() string { + return TypeChatFolderInviteLink +} + +// Represents a list of chat folder invite links +type ChatFolderInviteLinks struct { + meta + // List of the invite links + InviteLinks []*ChatFolderInviteLink `json:"invite_links"` +} + +func (entity *ChatFolderInviteLinks) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderInviteLinks + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderInviteLinks) GetClass() string { + return ClassChatFolderInviteLinks +} + +func (*ChatFolderInviteLinks) GetType() string { + return TypeChatFolderInviteLinks +} + +// Contains information about an invite link to a chat folder +type ChatFolderInviteLinkInfo struct { + meta + // Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet + ChatFolderInfo *ChatFolderInfo `json:"chat_folder_info"` + // Identifiers of the chats from the link, which aren't added to the folder yet + MissingChatIds []int64 `json:"missing_chat_ids"` + // Identifiers of the chats from the link, which are added to the folder already + AddedChatIds []int64 `json:"added_chat_ids"` +} + +func (entity *ChatFolderInviteLinkInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderInviteLinkInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderInviteLinkInfo) GetClass() string { + return ClassChatFolderInviteLinkInfo +} + +func (*ChatFolderInviteLinkInfo) GetType() string { + return TypeChatFolderInviteLinkInfo +} + +// Describes a recommended chat folder +type RecommendedChatFolder struct { + meta + // The chat folder + Folder *ChatFolder `json:"folder"` + // Chat folder description Description string `json:"description"` } -func (entity *RecommendedChatFilter) MarshalJSON() ([]byte, error) { +func (entity *RecommendedChatFolder) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub RecommendedChatFilter + type stub RecommendedChatFolder return json.Marshal((*stub)(entity)) } -func (*RecommendedChatFilter) GetClass() string { - return ClassRecommendedChatFilter +func (*RecommendedChatFolder) GetClass() string { + return ClassRecommendedChatFolder } -func (*RecommendedChatFilter) GetType() string { - return TypeRecommendedChatFilter +func (*RecommendedChatFolder) GetType() string { + return TypeRecommendedChatFolder } -// Contains a list of recommended chat filters -type RecommendedChatFilters struct { +// Contains a list of recommended chat folders +type RecommendedChatFolders struct { meta - // List of recommended chat filters - ChatFilters []*RecommendedChatFilter `json:"chat_filters"` + // List of recommended chat folders + ChatFolders []*RecommendedChatFolder `json:"chat_folders"` } -func (entity *RecommendedChatFilters) MarshalJSON() ([]byte, error) { +func (entity *RecommendedChatFolders) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub RecommendedChatFilters + type stub RecommendedChatFolders return json.Marshal((*stub)(entity)) } -func (*RecommendedChatFilters) GetClass() string { - return ClassRecommendedChatFilters +func (*RecommendedChatFolders) GetClass() string { + return ClassRecommendedChatFolders } -func (*RecommendedChatFilters) GetType() string { - return TypeRecommendedChatFilters +func (*RecommendedChatFolders) GetType() string { + return TypeRecommendedChatFolders +} + +// Contains settings for automatic moving of chats to and from the Archive chat lists +type ArchiveChatListSettings struct { + meta + // True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true + ArchiveAndMuteNewChatsFromUnknownUsers bool `json:"archive_and_mute_new_chats_from_unknown_users"` + // True, if unmuted chats will be kept in the Archive chat list when they get a new message + KeepUnmutedChatsArchived bool `json:"keep_unmuted_chats_archived"` + // True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true + KeepChatsFromFoldersArchived bool `json:"keep_chats_from_folders_archived"` +} + +func (entity *ArchiveChatListSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ArchiveChatListSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ArchiveChatListSettings) GetClass() string { + return ClassArchiveChatListSettings +} + +func (*ArchiveChatListSettings) GetType() string { + return TypeArchiveChatListSettings } // A main list of chats @@ -7144,31 +10850,31 @@ func (*ChatListArchive) ChatListType() string { return TypeChatListArchive } -// A list of chats belonging to a chat filter -type ChatListFilter struct { +// A list of chats added to a chat folder +type ChatListFolder struct { meta - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` } -func (entity *ChatListFilter) MarshalJSON() ([]byte, error) { +func (entity *ChatListFolder) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatListFilter + type stub ChatListFolder return json.Marshal((*stub)(entity)) } -func (*ChatListFilter) GetClass() string { +func (*ChatListFolder) GetClass() string { return ClassChatList } -func (*ChatListFilter) GetType() string { - return TypeChatListFilter +func (*ChatListFolder) GetType() string { + return TypeChatListFolder } -func (*ChatListFilter) ChatListType() string { - return TypeChatListFilter +func (*ChatListFolder) ChatListType() string { + return TypeChatListFolder } // Contains a list of chat lists @@ -7318,6 +11024,74 @@ func (chatPosition *ChatPosition) UnmarshalJSON(data []byte) error { return nil } +// All reactions are available in the chat +type ChatAvailableReactionsAll struct { + meta +} + +func (entity *ChatAvailableReactionsAll) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAvailableReactionsAll + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAvailableReactionsAll) GetClass() string { + return ClassChatAvailableReactions +} + +func (*ChatAvailableReactionsAll) GetType() string { + return TypeChatAvailableReactionsAll +} + +func (*ChatAvailableReactionsAll) ChatAvailableReactionsType() string { + return TypeChatAvailableReactionsAll +} + +// Only specific reactions are available in the chat +type ChatAvailableReactionsSome struct { + meta + // The list of reactions + Reactions []ReactionType `json:"reactions"` +} + +func (entity *ChatAvailableReactionsSome) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAvailableReactionsSome + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAvailableReactionsSome) GetClass() string { + return ClassChatAvailableReactions +} + +func (*ChatAvailableReactionsSome) GetType() string { + return TypeChatAvailableReactionsSome +} + +func (*ChatAvailableReactionsSome) ChatAvailableReactionsType() string { + return TypeChatAvailableReactionsSome +} + +func (chatAvailableReactionsSome *ChatAvailableReactionsSome) UnmarshalJSON(data []byte) error { + var tmp struct { + Reactions []json.RawMessage `json:"reactions"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldReactions, _ := UnmarshalListOfReactionType(tmp.Reactions) + chatAvailableReactionsSome.Reactions = fieldReactions + + return nil +} + // Describes a video chat type VideoChat struct { meta @@ -7377,20 +11151,26 @@ type Chat struct { Title string `json:"title"` // Chat photo; may be null Photo *ChatPhotoInfo `json:"photo"` + // Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` // Actions that non-administrator chat members are allowed to take in the chat Permissions *ChatPermissions `json:"permissions"` - // Last message in the chat; may be null + // Last message in the chat; may be null if none or unknown LastMessage *Message `json:"last_message"` // Positions of the chat in chat lists Positions []*ChatPosition `json:"positions"` // Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender MessageSenderId MessageSender `json:"message_sender_id"` + // Block list to which the chat is added; may be null if none + BlockList BlockList `json:"block_list"` // True, if chat content can't be saved locally, forwarded, or copied HasProtectedContent bool `json:"has_protected_content"` + // True, if translation of all messages in the chat must be suggested to the user + IsTranslatable bool `json:"is_translatable"` // True, if the chat is marked as unread IsMarkedAsUnread bool `json:"is_marked_as_unread"` - // True, if the chat is blocked by the current user and private messages from the chat can't be received - IsBlocked bool `json:"is_blocked"` // True, if the chat has scheduled messages HasScheduledMessages bool `json:"has_scheduled_messages"` // True, if the chat messages can be deleted only for the current user while other users will continue to see the messages @@ -7409,21 +11189,27 @@ type Chat struct { LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` // Number of unread messages with a mention/reply in the chat UnreadMentionCount int32 `json:"unread_mention_count"` - // Notification settings for this chat + // Number of messages with unread reactions in the chat + UnreadReactionCount int32 `json:"unread_reaction_count"` + // Notification settings for the chat NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - // Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats - MessageTtl int32 `json:"message_ttl"` + // Types of reaction, available in the chat + AvailableReactions ChatAvailableReactions `json:"available_reactions"` + // Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + // Background set for the chat; may be null if none + Background *ChatBackground `json:"background"` // If non-empty, name of a theme, set for the chat ThemeName string `json:"theme_name"` - // Information about actions which must be possible to do through the chat action bar; may be null + // Information about actions which must be possible to do through the chat action bar; may be null if none ActionBar ChatActionBar `json:"action_bar"` // Information about video chat of the chat VideoChat *VideoChat `json:"video_chat"` - // Information about pending join requests; may be null + // Information about pending join requests; may be null if none PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"` // Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat ReplyMarkupMessageId int64 `json:"reply_markup_message_id"` - // A draft of a message in the chat; may be null + // A draft of a message in the chat; may be null if none DraftMessage *DraftMessage `json:"draft_message"` // Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used ClientData string `json:"client_data"` @@ -7451,13 +11237,16 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { Type json.RawMessage `json:"type"` Title string `json:"title"` Photo *ChatPhotoInfo `json:"photo"` + AccentColorId int32 `json:"accent_color_id"` + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` Permissions *ChatPermissions `json:"permissions"` LastMessage *Message `json:"last_message"` Positions []*ChatPosition `json:"positions"` MessageSenderId json.RawMessage `json:"message_sender_id"` + BlockList json.RawMessage `json:"block_list"` HasProtectedContent bool `json:"has_protected_content"` + IsTranslatable bool `json:"is_translatable"` IsMarkedAsUnread bool `json:"is_marked_as_unread"` - IsBlocked bool `json:"is_blocked"` HasScheduledMessages bool `json:"has_scheduled_messages"` CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` @@ -7467,8 +11256,11 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` UnreadMentionCount int32 `json:"unread_mention_count"` + UnreadReactionCount int32 `json:"unread_reaction_count"` NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - MessageTtl int32 `json:"message_ttl"` + AvailableReactions json.RawMessage `json:"available_reactions"` + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + Background *ChatBackground `json:"background"` ThemeName string `json:"theme_name"` ActionBar json.RawMessage `json:"action_bar"` VideoChat *VideoChat `json:"video_chat"` @@ -7486,12 +11278,14 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.Id = tmp.Id chat.Title = tmp.Title chat.Photo = tmp.Photo + chat.AccentColorId = tmp.AccentColorId + chat.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId chat.Permissions = tmp.Permissions chat.LastMessage = tmp.LastMessage chat.Positions = tmp.Positions chat.HasProtectedContent = tmp.HasProtectedContent + chat.IsTranslatable = tmp.IsTranslatable chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread - chat.IsBlocked = tmp.IsBlocked chat.HasScheduledMessages = tmp.HasScheduledMessages chat.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf chat.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers @@ -7501,8 +11295,10 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.LastReadInboxMessageId = tmp.LastReadInboxMessageId chat.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId chat.UnreadMentionCount = tmp.UnreadMentionCount + chat.UnreadReactionCount = tmp.UnreadReactionCount chat.NotificationSettings = tmp.NotificationSettings - chat.MessageTtl = tmp.MessageTtl + chat.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime + chat.Background = tmp.Background chat.ThemeName = tmp.ThemeName chat.VideoChat = tmp.VideoChat chat.PendingJoinRequests = tmp.PendingJoinRequests @@ -7516,6 +11312,12 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) chat.MessageSenderId = fieldMessageSenderId + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + chat.BlockList = fieldBlockList + + fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) + chat.AvailableReactions = fieldAvailableReactions + fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) chat.ActionBar = fieldActionBar @@ -7525,7 +11327,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { // Represents a list of chats type Chats struct { meta - // Approximate total count of chats found + // Approximate total number of chats found TotalCount int32 `json:"total_count"` // List of chat identifiers ChatIds []int64 `json:"chat_ids"` @@ -7597,7 +11399,7 @@ func (*ChatsNearby) GetType() string { return TypeChatsNearby } -// The chat is public, because it has username +// The chat is public, because it has an active username type PublicChatTypeHasUsername struct { meta } @@ -7647,7 +11449,7 @@ func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string { return TypePublicChatTypeIsLocationBased } -// The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam +// The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown type ChatActionBarReportSpam struct { meta // If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings @@ -7674,7 +11476,7 @@ 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 +// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation type ChatActionBarReportUnrelatedLocation struct { meta } @@ -7724,7 +11526,7 @@ func (*ChatActionBarInviteMembers) ChatActionBarType() string { return TypeChatActionBarInviteMembers } -// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact +// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method setMessageSenderBlockList, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown type ChatActionBarReportAddBlock struct { meta // If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings @@ -7938,6 +11740,113 @@ func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string { return TypeKeyboardButtonTypeRequestPoll } +// A button that requests a user to be shared by the current user; available only in private chats. Use the method shareUserWithBot to complete the request +type KeyboardButtonTypeRequestUser struct { + meta + // Unique button identifier + Id int32 `json:"id"` + // True, if the shared user must or must not be a bot + RestrictUserIsBot bool `json:"restrict_user_is_bot"` + // True, if the shared user must be a bot; otherwise, the shared user must no be a bot. Ignored if restrict_user_is_bot is false + UserIsBot bool `json:"user_is_bot"` + // True, if the shared user must or must not be a Telegram Premium user + RestrictUserIsPremium bool `json:"restrict_user_is_premium"` + // True, if the shared user must be a Telegram Premium user; otherwise, the shared user must no be a Telegram Premium user. Ignored if restrict_user_is_premium is false + UserIsPremium bool `json:"user_is_premium"` +} + +func (entity *KeyboardButtonTypeRequestUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeRequestUser + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeRequestUser) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeRequestUser) GetType() string { + return TypeKeyboardButtonTypeRequestUser +} + +func (*KeyboardButtonTypeRequestUser) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeRequestUser +} + +// A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request +type KeyboardButtonTypeRequestChat struct { + meta + // Unique button identifier + Id int32 `json:"id"` + // True, if the chat must be a channel; otherwise, a basic group or a supergroup chat is shared + ChatIsChannel bool `json:"chat_is_channel"` + // True, if the chat must or must not be a forum supergroup + RestrictChatIsForum bool `json:"restrict_chat_is_forum"` + // True, if the chat must be a forum supergroup; otherwise, the chat must not be a forum supergroup. Ignored if restrict_chat_is_forum is false + ChatIsForum bool `json:"chat_is_forum"` + // True, if the chat must or must not have a username + RestrictChatHasUsername bool `json:"restrict_chat_has_username"` + // True, if the chat must have a username; otherwise, the chat must not have a username. Ignored if restrict_chat_has_username is false + ChatHasUsername bool `json:"chat_has_username"` + // True, if the chat must be created by the current user + ChatIsCreated bool `json:"chat_is_created"` + // Expected user administrator rights in the chat; may be null if they aren't restricted + UserAdministratorRights *ChatAdministratorRights `json:"user_administrator_rights"` + // Expected bot administrator rights in the chat; may be null if they aren't restricted + BotAdministratorRights *ChatAdministratorRights `json:"bot_administrator_rights"` + // True, if the bot must be a member of the chat; for basic group and supergroup chats only + BotIsMember bool `json:"bot_is_member"` +} + +func (entity *KeyboardButtonTypeRequestChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeRequestChat + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeRequestChat) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeRequestChat) GetType() string { + return TypeKeyboardButtonTypeRequestChat +} + +func (*KeyboardButtonTypeRequestChat) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeRequestChat +} + +// A button that opens a Web App by calling getWebAppUrl +type KeyboardButtonTypeWebApp struct { + meta + // An HTTP URL to pass to getWebAppUrl + Url string `json:"url"` +} + +func (entity *KeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeWebApp) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeWebApp) GetType() string { + return TypeKeyboardButtonTypeWebApp +} + +func (*KeyboardButtonTypeWebApp) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeWebApp +} + // Represents a single button in a bot keyboard type KeyboardButton struct { meta @@ -8009,10 +11918,10 @@ func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeUrl } -// A button that opens a specified URL and automatically authorize the current user if allowed to do so +// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo type InlineKeyboardButtonTypeLoginUrl struct { meta - // An HTTP URL to open + // An HTTP URL to pass to getLoginUrlInfo Url string `json:"url"` // Unique button identifier Id int64 `json:"id"` @@ -8040,6 +11949,33 @@ func (*InlineKeyboardButtonTypeLoginUrl) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeLoginUrl } +// A button that opens a Web App by calling openWebApp +type InlineKeyboardButtonTypeWebApp struct { + meta + // An HTTP URL to pass to openWebApp + Url string `json:"url"` +} + +func (entity *InlineKeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeWebApp) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeWebApp) GetType() string { + return TypeInlineKeyboardButtonTypeWebApp +} + +func (*InlineKeyboardButtonTypeWebApp) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeWebApp +} + // A button that sends a callback query to a bot type InlineKeyboardButtonTypeCallback struct { meta @@ -8067,7 +12003,7 @@ func (*InlineKeyboardButtonTypeCallback) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeCallback } -// A button that asks for password of the current user and then sends a callback query to a bot +// A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot type InlineKeyboardButtonTypeCallbackWithPassword struct { meta // Data to be sent to the bot via a callback query @@ -8124,8 +12060,8 @@ type InlineKeyboardButtonTypeSwitchInline struct { meta // Inline query to be sent to the bot Query string `json:"query"` - // True, if the inline query must be sent from the current chat - InCurrentChat bool `json:"in_current_chat"` + // Target chat from which to send the inline query + TargetChat TargetChat `json:"target_chat"` } func (entity *InlineKeyboardButtonTypeSwitchInline) MarshalJSON() ([]byte, error) { @@ -8148,6 +12084,25 @@ func (*InlineKeyboardButtonTypeSwitchInline) InlineKeyboardButtonTypeType() stri return TypeInlineKeyboardButtonTypeSwitchInline } +func (inlineKeyboardButtonTypeSwitchInline *InlineKeyboardButtonTypeSwitchInline) UnmarshalJSON(data []byte) error { + var tmp struct { + Query string `json:"query"` + TargetChat json.RawMessage `json:"target_chat"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inlineKeyboardButtonTypeSwitchInline.Query = tmp.Query + + fieldTargetChat, _ := UnmarshalTargetChat(tmp.TargetChat) + inlineKeyboardButtonTypeSwitchInline.TargetChat = fieldTargetChat + + return nil +} + // A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice type InlineKeyboardButtonTypeBuy struct { meta @@ -8244,7 +12199,7 @@ func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) err return nil } -// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, UpdateChatReplyMarkup with message_id == 0 will be sent +// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 will be sent type ReplyMarkupRemoveKeyboard struct { meta // True, if the keyboard is removed only for the mentioned users or the target user of a reply @@ -8305,6 +12260,8 @@ type ReplyMarkupShowKeyboard struct { meta // A list of rows of bot keyboard buttons Rows [][]*KeyboardButton `json:"rows"` + // True, if the keyboard is supposed to always be shown when the ordinary keyboard is hidden + IsPersistent bool `json:"is_persistent"` // True, if the application needs to resize the keyboard vertically ResizeKeyboard bool `json:"resize_keyboard"` // True, if the application needs to hide the keyboard after use @@ -8362,13 +12319,13 @@ func (*ReplyMarkupInlineKeyboard) ReplyMarkupType() string { return TypeReplyMarkupInlineKeyboard } -// An HTTP url needs to be open +// 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"` + // True, if there is no need to show an ordinary open URL confirmation + SkipConfirmation bool `json:"skip_confirmation"` } func (entity *LoginUrlInfoOpen) MarshalJSON() ([]byte, error) { @@ -8400,7 +12357,7 @@ type LoginUrlInfoRequestConfirmation struct { Domain string `json:"domain"` // User identifier of a bot linked with the website BotUserId int64 `json:"bot_user_id"` - // True, if the user needs to be requested to give the permission to the bot to send them messages + // True, if the user must be asked for the permission to the bot to send them messages RequestWriteAccess bool `json:"request_write_access"` } @@ -8424,6 +12381,58 @@ func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string { return TypeLoginUrlInfoRequestConfirmation } +// Contains information about a Web App found by its short name +type FoundWebApp struct { + meta + // The Web App + WebApp *WebApp `json:"web_app"` + // True, if the user must be asked for the permission to the bot to send them messages + RequestWriteAccess bool `json:"request_write_access"` + // True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden + SkipConfirmation bool `json:"skip_confirmation"` +} + +func (entity *FoundWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*FoundWebApp) GetClass() string { + return ClassFoundWebApp +} + +func (*FoundWebApp) GetType() string { + return TypeFoundWebApp +} + +// Contains information about a Web App +type WebAppInfo struct { + meta + // Unique identifier for the Web App launch + LaunchId JsonInt64 `json:"launch_id"` + // A Web App URL to open in a web view + Url string `json:"url"` +} + +func (entity *WebAppInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebAppInfo + + return json.Marshal((*stub)(entity)) +} + +func (*WebAppInfo) GetClass() string { + return ClassWebAppInfo +} + +func (*WebAppInfo) GetType() string { + return TypeWebAppInfo +} + // Contains information about a message thread type MessageThreadInfo struct { meta @@ -8431,13 +12440,13 @@ type MessageThreadInfo struct { ChatId int64 `json:"chat_id"` // Message thread identifier, unique within the chat MessageThreadId int64 `json:"message_thread_id"` - // Information about the message thread + // Information about the message thread; may be null for forum topic threads ReplyInfo *MessageReplyInfo `json:"reply_info"` // Approximate number of unread messages in the message thread UnreadMessageCount int32 `json:"unread_message_count"` // The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) Messages []*Message `json:"messages"` - // A draft of a message in the message thread; may be null + // A draft of a message in the message thread; may be null if none DraftMessage *DraftMessage `json:"draft_message"` } @@ -8457,6 +12466,206 @@ func (*MessageThreadInfo) GetType() string { return TypeMessageThreadInfo } +// Describes a forum topic icon +type ForumTopicIcon struct { + meta + // Color of the topic icon in RGB format + Color int32 `json:"color"` + // Unique identifier of the custom emoji shown on the topic icon; 0 if none + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *ForumTopicIcon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopicIcon + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopicIcon) GetClass() string { + return ClassForumTopicIcon +} + +func (*ForumTopicIcon) GetType() string { + return TypeForumTopicIcon +} + +// Contains basic information about a forum topic +type ForumTopicInfo struct { + meta + // Message thread identifier of the topic + MessageThreadId int64 `json:"message_thread_id"` + // Name of the topic + Name string `json:"name"` + // Icon of the topic + Icon *ForumTopicIcon `json:"icon"` + // Point in time (Unix timestamp) when the topic was created + CreationDate int32 `json:"creation_date"` + // Identifier of the creator of the topic + CreatorId MessageSender `json:"creator_id"` + // True, if the topic is the General topic list + IsGeneral bool `json:"is_general"` + // True, if the topic was created by the current user + IsOutgoing bool `json:"is_outgoing"` + // True, if the topic is closed + IsClosed bool `json:"is_closed"` + // True, if the topic is hidden above the topic list and closed; for General topic only + IsHidden bool `json:"is_hidden"` +} + +func (entity *ForumTopicInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopicInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopicInfo) GetClass() string { + return ClassForumTopicInfo +} + +func (*ForumTopicInfo) GetType() string { + return TypeForumTopicInfo +} + +func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + MessageThreadId int64 `json:"message_thread_id"` + Name string `json:"name"` + Icon *ForumTopicIcon `json:"icon"` + CreationDate int32 `json:"creation_date"` + CreatorId json.RawMessage `json:"creator_id"` + IsGeneral bool `json:"is_general"` + IsOutgoing bool `json:"is_outgoing"` + IsClosed bool `json:"is_closed"` + IsHidden bool `json:"is_hidden"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + forumTopicInfo.MessageThreadId = tmp.MessageThreadId + forumTopicInfo.Name = tmp.Name + forumTopicInfo.Icon = tmp.Icon + forumTopicInfo.CreationDate = tmp.CreationDate + forumTopicInfo.IsGeneral = tmp.IsGeneral + forumTopicInfo.IsOutgoing = tmp.IsOutgoing + forumTopicInfo.IsClosed = tmp.IsClosed + forumTopicInfo.IsHidden = tmp.IsHidden + + fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) + forumTopicInfo.CreatorId = fieldCreatorId + + return nil +} + +// Describes a forum topic +type ForumTopic struct { + meta + // Basic information about the topic + Info *ForumTopicInfo `json:"info"` + // Last message in the topic; may be null if unknown + LastMessage *Message `json:"last_message"` + // True, if the topic is pinned in the topic list + IsPinned bool `json:"is_pinned"` + // Number of unread messages in the topic + UnreadCount int32 `json:"unread_count"` + // Identifier of the last read incoming message + LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` + // Identifier of the last read outgoing message + LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` + // Number of unread messages with a mention/reply in the topic + UnreadMentionCount int32 `json:"unread_mention_count"` + // Number of messages with unread reactions in the topic + UnreadReactionCount int32 `json:"unread_reaction_count"` + // Notification settings for the topic + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` + // A draft of a message in the topic; may be null if none + DraftMessage *DraftMessage `json:"draft_message"` +} + +func (entity *ForumTopic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopic + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopic) GetClass() string { + return ClassForumTopic +} + +func (*ForumTopic) GetType() string { + return TypeForumTopic +} + +// Describes a list of forum topics +type ForumTopics struct { + meta + // Approximate total number of forum topics found + TotalCount int32 `json:"total_count"` + // List of forum topics + Topics []*ForumTopic `json:"topics"` + // Offset date for the next getForumTopics request + NextOffsetDate int32 `json:"next_offset_date"` + // Offset message identifier for the next getForumTopics request + NextOffsetMessageId int64 `json:"next_offset_message_id"` + // Offset message thread identifier for the next getForumTopics request + NextOffsetMessageThreadId int64 `json:"next_offset_message_thread_id"` +} + +func (entity *ForumTopics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopics + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopics) GetClass() string { + return ClassForumTopics +} + +func (*ForumTopics) GetType() string { + return TypeForumTopics +} + +// Options to be used for generation of a link preview +type LinkPreviewOptions struct { + meta + // True, if link preview must be disabled + IsDisabled bool `json:"is_disabled"` + // URL to use for link preview. If empty, then the first URL found in the message text will be used + Url string `json:"url"` + // True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified + ForceSmallMedia bool `json:"force_small_media"` + // True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified + ForceLargeMedia bool `json:"force_large_media"` + // True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats + ShowAboveText bool `json:"show_above_text"` +} + +func (entity *LinkPreviewOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewOptions + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewOptions) GetClass() string { + return ClassLinkPreviewOptions +} + +func (*LinkPreviewOptions) GetType() string { + return TypeLinkPreviewOptions +} + // A plain text type RichTextPlain struct { meta @@ -10495,7 +14704,9 @@ type PageBlockChatLink struct { Title string `json:"title"` // Chat photo; may be null Photo *ChatPhotoInfo `json:"photo"` - // Chat username, by which all other information about the chat can be resolved + // Identifier of the accent color for chat title and background of chat photo + AccentColorId int32 `json:"accent_color_id"` + // Chat username by which all other information about the chat can be resolved Username string `json:"username"` } @@ -10774,7 +14985,7 @@ func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error { return nil } -// Describes a web page preview +// Describes a link preview type WebPage struct { meta // Original URL of the link @@ -10803,6 +15014,14 @@ type WebPage struct { Duration int32 `json:"duration"` // Author of the content Author string `json:"author"` + // True, if the preview has large media and its appearance can be changed + HasLargeMedia bool `json:"has_large_media"` + // True, if large media preview must be shown + ShowLargeMedia bool `json:"show_large_media"` + // True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear + SkipConfirmation bool `json:"skip_confirmation"` + // True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text + ShowAboveText bool `json:"show_above_text"` // Preview of the content as an animation, if available; may be null Animation *Animation `json:"animation"` // Preview of the content as an audio file, if available; may be null @@ -10817,7 +15036,11 @@ type WebPage struct { VideoNote *VideoNote `json:"video_note"` // Preview of the content as a voice note, if available; may be null VoiceNote *VoiceNote `json:"voice_note"` - // Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none + // The identifier of the sender of the previewed story; 0 if none + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the previewed story; 0 if none + StoryId int32 `json:"story_id"` + // Version of web page instant view (currently, can be 1 or 2); 0 if none InstantViewVersion int32 `json:"instant_view_version"` } @@ -10900,6 +15123,8 @@ type PhoneNumberInfo struct { CountryCallingCode string `json:"country_calling_code"` // The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user FormattedPhoneNumber string `json:"formatted_phone_number"` + // True, if the phone number was bought on Fragment and isn't tied to a SIM card + IsAnonymous bool `json:"is_anonymous"` } func (entity *PhoneNumberInfo) MarshalJSON() ([]byte, error) { @@ -11001,6 +15226,53 @@ func (*Address) GetType() string { return TypeAddress } +// Contains parameters of the application theme +type ThemeParameters struct { + meta + // A color of the background in the RGB24 format + BackgroundColor int32 `json:"background_color"` + // A secondary color for the background in the RGB24 format + SecondaryBackgroundColor int32 `json:"secondary_background_color"` + // A color of the header background in the RGB24 format + HeaderBackgroundColor int32 `json:"header_background_color"` + // A color of the section background in the RGB24 format + SectionBackgroundColor int32 `json:"section_background_color"` + // A color of text in the RGB24 format + TextColor int32 `json:"text_color"` + // An accent color of the text in the RGB24 format + AccentTextColor int32 `json:"accent_text_color"` + // A color of text on the section headers in the RGB24 format + SectionHeaderTextColor int32 `json:"section_header_text_color"` + // A color of the subtitle text in the RGB24 format + SubtitleTextColor int32 `json:"subtitle_text_color"` + // A color of the text for destructive actions in the RGB24 format + DestructiveTextColor int32 `json:"destructive_text_color"` + // A color of hints in the RGB24 format + HintColor int32 `json:"hint_color"` + // A color of links in the RGB24 format + LinkColor int32 `json:"link_color"` + // A color of the buttons in the RGB24 format + ButtonColor int32 `json:"button_color"` + // A color of text on the buttons in the RGB24 format + ButtonTextColor int32 `json:"button_text_color"` +} + +func (entity *ThemeParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThemeParameters + + return json.Marshal((*stub)(entity)) +} + +func (*ThemeParameters) GetClass() string { + return ClassThemeParameters +} + +func (*ThemeParameters) GetType() string { + return TypeThemeParameters +} + // Portion of the price of a product (e.g., "delivery cost", "tax amount") type LabeledPricePart struct { meta @@ -11037,6 +15309,10 @@ type Invoice struct { MaxTipAmount int64 `json:"max_tip_amount"` // Suggested amounts of tip in the smallest units of the currency SuggestedTipAmounts []int64 `json:"suggested_tip_amounts"` + // An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay + RecurringPaymentTermsOfServiceUrl string `json:"recurring_payment_terms_of_service_url"` + // An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay + TermsOfServiceUrl string `json:"terms_of_service_url"` // True, if the payment is a test payment IsTest bool `json:"is_test"` // True, if the user's name is needed for payment @@ -11127,7 +15403,7 @@ func (*ShippingOption) GetType() string { return TypeShippingOption } -// Contains information about saved card credentials +// Contains information about saved payment credentials type SavedCredentials struct { meta // Unique identifier of the saved credentials @@ -11262,8 +15538,35 @@ func (*InputCredentialsGooglePay) InputCredentialsType() string { return TypeInputCredentialsGooglePay } +// Smart Glocal payment provider +type PaymentProviderSmartGlocal struct { + meta + // Public payment token + PublicToken string `json:"public_token"` +} + +func (entity *PaymentProviderSmartGlocal) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentProviderSmartGlocal + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentProviderSmartGlocal) GetClass() string { + return ClassPaymentProvider +} + +func (*PaymentProviderSmartGlocal) GetType() string { + return TypePaymentProviderSmartGlocal +} + +func (*PaymentProviderSmartGlocal) PaymentProviderType() string { + return TypePaymentProviderSmartGlocal +} + // Stripe payment provider -type PaymentsProviderStripe struct { +type PaymentProviderStripe struct { meta // Stripe API publishable key PublishableKey string `json:"publishable_key"` @@ -11275,53 +15578,76 @@ type PaymentsProviderStripe struct { NeedCardholderName bool `json:"need_cardholder_name"` } -func (entity *PaymentsProviderStripe) MarshalJSON() ([]byte, error) { +func (entity *PaymentProviderStripe) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub PaymentsProviderStripe + type stub PaymentProviderStripe return json.Marshal((*stub)(entity)) } -func (*PaymentsProviderStripe) GetClass() string { - return ClassPaymentsProviderStripe +func (*PaymentProviderStripe) GetClass() string { + return ClassPaymentProvider } -func (*PaymentsProviderStripe) GetType() string { - return TypePaymentsProviderStripe +func (*PaymentProviderStripe) GetType() string { + return TypePaymentProviderStripe } -// Theme colors for a payment form -type PaymentFormTheme struct { +func (*PaymentProviderStripe) PaymentProviderType() string { + return TypePaymentProviderStripe +} + +// Some other payment provider, for which a web payment form must be shown +type PaymentProviderOther struct { meta - // A color of the payment form background in the RGB24 format - BackgroundColor int32 `json:"background_color"` - // A color of text in the RGB24 format - TextColor int32 `json:"text_color"` - // A color of hints in the RGB24 format - HintColor int32 `json:"hint_color"` - // A color of links in the RGB24 format - LinkColor int32 `json:"link_color"` - // A color of the buttons in the RGB24 format - ButtonColor int32 `json:"button_color"` - // A color of text on the buttons in the RGB24 format - ButtonTextColor int32 `json:"button_text_color"` + // Payment form URL + Url string `json:"url"` } -func (entity *PaymentFormTheme) MarshalJSON() ([]byte, error) { +func (entity *PaymentProviderOther) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub PaymentFormTheme + type stub PaymentProviderOther return json.Marshal((*stub)(entity)) } -func (*PaymentFormTheme) GetClass() string { - return ClassPaymentFormTheme +func (*PaymentProviderOther) GetClass() string { + return ClassPaymentProvider } -func (*PaymentFormTheme) GetType() string { - return TypePaymentFormTheme +func (*PaymentProviderOther) GetType() string { + return TypePaymentProviderOther +} + +func (*PaymentProviderOther) PaymentProviderType() string { + return TypePaymentProviderOther +} + +// Describes an additional payment option +type PaymentOption struct { + meta + // Title for the payment option + Title string `json:"title"` + // Payment form URL to be opened in a web view + Url string `json:"url"` +} + +func (entity *PaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentOption) GetClass() string { + return ClassPaymentOption +} + +func (*PaymentOption) GetType() string { + return TypePaymentOption } // Contains information about an invoice payment form @@ -11329,24 +15655,30 @@ type PaymentForm struct { meta // The payment form identifier Id JsonInt64 `json:"id"` - // Full information of the invoice + // Full information about the invoice Invoice *Invoice `json:"invoice"` - // Payment form URL - Url string `json:"url"` // User identifier of the seller bot SellerBotUserId int64 `json:"seller_bot_user_id"` // User identifier of the payment provider bot - PaymentsProviderUserId int64 `json:"payments_provider_user_id"` - // Information about the payment provider, if available, to support it natively without the need for opening the URL; may be null - PaymentsProvider *PaymentsProviderStripe `json:"payments_provider"` + PaymentProviderUserId int64 `json:"payment_provider_user_id"` + // Information about the payment provider + PaymentProvider PaymentProvider `json:"payment_provider"` + // The list of additional payment options + AdditionalPaymentOptions []*PaymentOption `json:"additional_payment_options"` // Saved server-side order information; may be null SavedOrderInfo *OrderInfo `json:"saved_order_info"` - // Information about saved card credentials; may be null - SavedCredentials *SavedCredentials `json:"saved_credentials"` + // The list of saved payment credentials + SavedCredentials []*SavedCredentials `json:"saved_credentials"` // True, if the user can choose to save credentials CanSaveCredentials bool `json:"can_save_credentials"` - // True, if the user will be able to save credentials protected by a password they set up + // True, if the user will be able to save credentials, if sets up a 2-step verification password NeedPassword bool `json:"need_password"` + // Product title + ProductTitle string `json:"product_title"` + // Product description + ProductDescription *FormattedText `json:"product_description"` + // Product photo; may be null + ProductPhoto *Photo `json:"product_photo"` } func (entity *PaymentForm) MarshalJSON() ([]byte, error) { @@ -11365,7 +15697,48 @@ func (*PaymentForm) GetType() string { return TypePaymentForm } -// Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options +func (paymentForm *PaymentForm) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Invoice *Invoice `json:"invoice"` + SellerBotUserId int64 `json:"seller_bot_user_id"` + PaymentProviderUserId int64 `json:"payment_provider_user_id"` + PaymentProvider json.RawMessage `json:"payment_provider"` + AdditionalPaymentOptions []*PaymentOption `json:"additional_payment_options"` + SavedOrderInfo *OrderInfo `json:"saved_order_info"` + SavedCredentials []*SavedCredentials `json:"saved_credentials"` + CanSaveCredentials bool `json:"can_save_credentials"` + NeedPassword bool `json:"need_password"` + ProductTitle string `json:"product_title"` + ProductDescription *FormattedText `json:"product_description"` + ProductPhoto *Photo `json:"product_photo"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + paymentForm.Id = tmp.Id + paymentForm.Invoice = tmp.Invoice + paymentForm.SellerBotUserId = tmp.SellerBotUserId + paymentForm.PaymentProviderUserId = tmp.PaymentProviderUserId + paymentForm.AdditionalPaymentOptions = tmp.AdditionalPaymentOptions + paymentForm.SavedOrderInfo = tmp.SavedOrderInfo + paymentForm.SavedCredentials = tmp.SavedCredentials + paymentForm.CanSaveCredentials = tmp.CanSaveCredentials + paymentForm.NeedPassword = tmp.NeedPassword + paymentForm.ProductTitle = tmp.ProductTitle + paymentForm.ProductDescription = tmp.ProductDescription + paymentForm.ProductPhoto = tmp.ProductPhoto + + fieldPaymentProvider, _ := UnmarshalPaymentProvider(tmp.PaymentProvider) + paymentForm.PaymentProvider = fieldPaymentProvider + + return nil +} + +// Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options type ValidatedOrderInfo struct { meta // Temporary identifier of the order information @@ -11393,7 +15766,7 @@ func (*ValidatedOrderInfo) GetType() string { // Contains the result of a payment request type PaymentResult struct { meta - // True, if the payment request was successful; otherwise the verification_url will be non-empty + // True, if the payment request was successful; otherwise, the verification_url will be non-empty Success bool `json:"success"` // URL for additional payment credentials verification VerificationUrl string `json:"verification_url"` @@ -11421,7 +15794,7 @@ type PaymentReceipt struct { // Product title Title string `json:"title"` // Product description - Description string `json:"description"` + Description *FormattedText `json:"description"` // Product photo; may be null Photo *Photo `json:"photo"` // Point in time (Unix timestamp) when the payment was made @@ -11429,7 +15802,7 @@ type PaymentReceipt struct { // User identifier of the seller bot SellerBotUserId int64 `json:"seller_bot_user_id"` // User identifier of the payment provider bot - PaymentsProviderUserId int64 `json:"payments_provider_user_id"` + PaymentProviderUserId int64 `json:"payment_provider_user_id"` // Information about the invoice Invoice *Invoice `json:"invoice"` // Order information; may be null @@ -11458,6 +15831,256 @@ func (*PaymentReceipt) GetType() string { return TypePaymentReceipt } +// An invoice from a message of the type messageInvoice +type InputInvoiceMessage struct { + meta + // Chat identifier of the message + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` +} + +func (entity *InputInvoiceMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInvoiceMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputInvoiceMessage) GetClass() string { + return ClassInputInvoice +} + +func (*InputInvoiceMessage) GetType() string { + return TypeInputInvoiceMessage +} + +func (*InputInvoiceMessage) InputInvoiceType() string { + return TypeInputInvoiceMessage +} + +// An invoice from a link of the type internalLinkTypeInvoice +type InputInvoiceName struct { + meta + // Name of the invoice + Name string `json:"name"` +} + +func (entity *InputInvoiceName) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInvoiceName + + return json.Marshal((*stub)(entity)) +} + +func (*InputInvoiceName) GetClass() string { + return ClassInputInvoice +} + +func (*InputInvoiceName) GetType() string { + return TypeInputInvoiceName +} + +func (*InputInvoiceName) InputInvoiceType() string { + return TypeInputInvoiceName +} + +// An invoice for a payment toward Telegram; must not be used in the in-store apps +type InputInvoiceTelegram struct { + meta + // Transaction purpose + Purpose TelegramPaymentPurpose `json:"purpose"` +} + +func (entity *InputInvoiceTelegram) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInvoiceTelegram + + return json.Marshal((*stub)(entity)) +} + +func (*InputInvoiceTelegram) GetClass() string { + return ClassInputInvoice +} + +func (*InputInvoiceTelegram) GetType() string { + return TypeInputInvoiceTelegram +} + +func (*InputInvoiceTelegram) InputInvoiceType() string { + return TypeInputInvoiceTelegram +} + +func (inputInvoiceTelegram *InputInvoiceTelegram) UnmarshalJSON(data []byte) error { + var tmp struct { + Purpose json.RawMessage `json:"purpose"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldPurpose, _ := UnmarshalTelegramPaymentPurpose(tmp.Purpose) + inputInvoiceTelegram.Purpose = fieldPurpose + + return nil +} + +// The media is hidden until the invoice is paid +type MessageExtendedMediaPreview struct { + meta + // Media width; 0 if unknown + Width int32 `json:"width"` + // Media height; 0 if unknown + Height int32 `json:"height"` + // Media duration; 0 if unknown + Duration int32 `json:"duration"` + // Media minithumbnail; may be null + Minithumbnail *Minithumbnail `json:"minithumbnail"` + // Media caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaPreview) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaPreview + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaPreview) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaPreview) GetType() string { + return TypeMessageExtendedMediaPreview +} + +func (*MessageExtendedMediaPreview) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaPreview +} + +// The media is a photo +type MessageExtendedMediaPhoto struct { + meta + // The photo + Photo *Photo `json:"photo"` + // Photo caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaPhoto) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaPhoto) GetType() string { + return TypeMessageExtendedMediaPhoto +} + +func (*MessageExtendedMediaPhoto) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaPhoto +} + +// The media is a video +type MessageExtendedMediaVideo struct { + meta + // The video + Video *Video `json:"video"` + // Photo caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaVideo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaVideo) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaVideo) GetType() string { + return TypeMessageExtendedMediaVideo +} + +func (*MessageExtendedMediaVideo) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaVideo +} + +// The media is unsupported +type MessageExtendedMediaUnsupported struct { + meta + // Media caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaUnsupported) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaUnsupported) GetType() string { + return TypeMessageExtendedMediaUnsupported +} + +func (*MessageExtendedMediaUnsupported) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaUnsupported +} + +// Describes parameters of a Telegram Premium giveaway +type PremiumGiveawayParameters struct { + meta + // Identifier of the channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription + BoostedChatId int64 `json:"boosted_chat_id"` + // Identifiers of other channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats + AdditionalChatIds []int64 `json:"additional_chat_ids"` + // Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways + WinnersSelectionDate int32 `json:"winners_selection_date"` + // True, if only new subscribers of the chats will be eligible for the giveaway + OnlyNewMembers bool `json:"only_new_members"` + // The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought on Fragment can participate in any giveaway and the country code "FT" must not be specified in the list + CountryCodes []string `json:"country_codes"` +} + +func (entity *PremiumGiveawayParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParameters + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParameters) GetClass() string { + return ClassPremiumGiveawayParameters +} + +func (*PremiumGiveawayParameters) GetType() string { + return TypePremiumGiveawayParameters +} + // File with the date it was uploaded type DatedFile struct { meta @@ -11881,8 +16504,8 @@ type IdentityDocument struct { meta // Document number; 1-24 characters Number string `json:"number"` - // Document expiry date; may be null if not applicable - ExpiryDate *Date `json:"expiry_date"` + // Document expiration date; may be null if not applicable + ExpirationDate *Date `json:"expiration_date"` // Front side of the document FrontSide *DatedFile `json:"front_side"` // Reverse side of the document; only for driver license and identity card; may be null @@ -11914,8 +16537,8 @@ type InputIdentityDocument struct { meta // Document number; 1-24 characters Number string `json:"number"` - // Document expiry date; pass null if not applicable - ExpiryDate *Date `json:"expiry_date"` + // Document expiration date; pass null if not applicable + ExpirationDate *Date `json:"expiration_date"` // Front side of the document FrontSide InputFile `json:"front_side"` // Reverse side of the document; only for driver license and identity card; pass null otherwise @@ -11944,12 +16567,12 @@ func (*InputIdentityDocument) GetType() string { func (inputIdentityDocument *InputIdentityDocument) UnmarshalJSON(data []byte) error { var tmp struct { - Number string `json:"number"` - ExpiryDate *Date `json:"expiry_date"` - FrontSide json.RawMessage `json:"front_side"` - ReverseSide json.RawMessage `json:"reverse_side"` - Selfie json.RawMessage `json:"selfie"` - Translation []json.RawMessage `json:"translation"` + Number string `json:"number"` + ExpirationDate *Date `json:"expiration_date"` + FrontSide json.RawMessage `json:"front_side"` + ReverseSide json.RawMessage `json:"reverse_side"` + Selfie json.RawMessage `json:"selfie"` + Translation []json.RawMessage `json:"translation"` } err := json.Unmarshal(data, &tmp) @@ -11958,7 +16581,7 @@ func (inputIdentityDocument *InputIdentityDocument) UnmarshalJSON(data []byte) e } inputIdentityDocument.Number = tmp.Number - inputIdentityDocument.ExpiryDate = tmp.ExpiryDate + inputIdentityDocument.ExpirationDate = tmp.ExpirationDate fieldFrontSide, _ := UnmarshalInputFile(tmp.FrontSide) inputIdentityDocument.FrontSide = fieldFrontSide @@ -13612,8 +18235,10 @@ type MessageText struct { meta // Text of the message Text *FormattedText `json:"text"` - // A preview of the web page that's mentioned in the text; may be null + // A link preview attached to the message; may be null WebPage *WebPage `json:"web_page"` + // Options which was used for generation of the link preview; may be null if default options were used + LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` } func (entity *MessageText) MarshalJSON() ([]byte, error) { @@ -13643,6 +18268,8 @@ type MessageAnimation struct { Animation *Animation `json:"animation"` // Animation caption Caption *FormattedText `json:"caption"` + // True, if the animation preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` // True, if the animation thumbnail must be blurred and the animation must be shown only while tapped IsSecret bool `json:"is_secret"` } @@ -13728,10 +18355,12 @@ func (*MessageDocument) MessageContentType() string { // A photo message type MessagePhoto struct { meta - // The photo description + // The photo Photo *Photo `json:"photo"` // Photo caption Caption *FormattedText `json:"caption"` + // True, if the photo preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` // True, if the photo must be blurred and must be shown only while tapped IsSecret bool `json:"is_secret"` } @@ -13756,7 +18385,7 @@ func (*MessagePhoto) MessageContentType() string { return TypeMessagePhoto } -// An expired photo message (self-destructed after TTL has elapsed) +// A self-destructed photo message type MessageExpiredPhoto struct { meta } @@ -13786,6 +18415,8 @@ type MessageSticker struct { meta // The sticker description Sticker *Sticker `json:"sticker"` + // True, if premium animation of the sticker must be played + IsPremium bool `json:"is_premium"` } func (entity *MessageSticker) MarshalJSON() ([]byte, error) { @@ -13815,6 +18446,8 @@ type MessageVideo struct { Video *Video `json:"video"` // Video caption Caption *FormattedText `json:"caption"` + // True, if the video preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` // True, if the video thumbnail must be blurred and the video must be shown only while tapped IsSecret bool `json:"is_secret"` } @@ -13839,7 +18472,7 @@ func (*MessageVideo) MessageContentType() string { return TypeMessageVideo } -// An expired video message (self-destructed after TTL has elapsed) +// A self-destructed video message type MessageExpiredVideo struct { meta } @@ -13937,7 +18570,7 @@ type MessageLocation struct { ExpiresIn int32 `json:"expires_in"` // For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown Heading int32 `json:"heading"` - // For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only for the message sender + // For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only to the message sender ProximityAlertRadius int32 `json:"proximity_alert_radius"` } @@ -14160,20 +18793,51 @@ func (*MessagePoll) MessageContentType() string { return TypeMessagePoll } -// A message with an invoice from a bot +// A message with a forwarded story +type MessageStory struct { + meta + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` + // True, if the story was automatically forwarded because of a mention of the user + ViaMention bool `json:"via_mention"` +} + +func (entity *MessageStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageStory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageStory) GetClass() string { + return ClassMessageContent +} + +func (*MessageStory) GetType() string { + return TypeMessageStory +} + +func (*MessageStory) MessageContentType() string { + return TypeMessageStory +} + +// A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice type MessageInvoice struct { meta // Product title Title string `json:"title"` // Product description - Description string `json:"description"` + Description *FormattedText `json:"description"` // Product photo; may be null Photo *Photo `json:"photo"` // Currency for the product price Currency string `json:"currency"` // Product total price in the smallest units of the currency TotalAmount int64 `json:"total_amount"` - // Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter} + // Unique invoice bot start_parameter to be passed to getInternalLink StartParameter string `json:"start_parameter"` // True, if the invoice is a test invoice IsTest bool `json:"is_test"` @@ -14181,6 +18845,8 @@ type MessageInvoice struct { NeedShippingAddress bool `json:"need_shipping_address"` // The identifier of the message with the receipt, after the product has been purchased ReceiptMessageId int64 `json:"receipt_message_id"` + // Extended media attached to the invoice; may be null + ExtendedMedia MessageExtendedMedia `json:"extended_media"` } func (entity *MessageInvoice) MarshalJSON() ([]byte, error) { @@ -14203,6 +18869,41 @@ func (*MessageInvoice) MessageContentType() string { return TypeMessageInvoice } +func (messageInvoice *MessageInvoice) UnmarshalJSON(data []byte) error { + var tmp struct { + Title string `json:"title"` + Description *FormattedText `json:"description"` + Photo *Photo `json:"photo"` + Currency string `json:"currency"` + TotalAmount int64 `json:"total_amount"` + StartParameter string `json:"start_parameter"` + IsTest bool `json:"is_test"` + NeedShippingAddress bool `json:"need_shipping_address"` + ReceiptMessageId int64 `json:"receipt_message_id"` + ExtendedMedia json.RawMessage `json:"extended_media"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageInvoice.Title = tmp.Title + messageInvoice.Description = tmp.Description + messageInvoice.Photo = tmp.Photo + messageInvoice.Currency = tmp.Currency + messageInvoice.TotalAmount = tmp.TotalAmount + messageInvoice.StartParameter = tmp.StartParameter + messageInvoice.IsTest = tmp.IsTest + messageInvoice.NeedShippingAddress = tmp.NeedShippingAddress + messageInvoice.ReceiptMessageId = tmp.ReceiptMessageId + + fieldExtendedMedia, _ := UnmarshalMessageExtendedMedia(tmp.ExtendedMedia) + messageInvoice.ExtendedMedia = fieldExtendedMedia + + return nil +} + // A message with information about an ended call type MessageCall struct { meta @@ -14714,10 +19415,39 @@ func (*MessageScreenshotTaken) MessageContentType() string { return TypeMessageScreenshotTaken } +// A new background was set in the chat +type MessageChatSetBackground struct { + meta + // Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message + OldBackgroundMessageId int64 `json:"old_background_message_id"` + // The new background + Background *ChatBackground `json:"background"` +} + +func (entity *MessageChatSetBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatSetBackground + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatSetBackground) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatSetBackground) GetType() string { + return TypeMessageChatSetBackground +} + +func (*MessageChatSetBackground) MessageContentType() string { + return TypeMessageChatSetBackground +} + // A theme in the chat has been changed type MessageChatSetTheme struct { meta - // If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one + // If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one ThemeName string `json:"theme_name"` } @@ -14741,31 +19471,174 @@ func (*MessageChatSetTheme) MessageContentType() string { return TypeMessageChatSetTheme } -// The TTL (Time To Live) setting for messages in the chat has been changed -type MessageChatSetTtl struct { +// The auto-delete or self-destruct timer for messages in the chat has been changed +type MessageChatSetMessageAutoDeleteTime struct { meta - // New message TTL - Ttl int32 `json:"ttl"` + // New value auto-delete or self-destruct time, in seconds; 0 if disabled + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + // If not 0, a user identifier, which default setting was automatically applied + FromUserId int64 `json:"from_user_id"` } -func (entity *MessageChatSetTtl) MarshalJSON() ([]byte, error) { +func (entity *MessageChatSetMessageAutoDeleteTime) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageChatSetTtl + type stub MessageChatSetMessageAutoDeleteTime return json.Marshal((*stub)(entity)) } -func (*MessageChatSetTtl) GetClass() string { +func (*MessageChatSetMessageAutoDeleteTime) GetClass() string { return ClassMessageContent } -func (*MessageChatSetTtl) GetType() string { - return TypeMessageChatSetTtl +func (*MessageChatSetMessageAutoDeleteTime) GetType() string { + return TypeMessageChatSetMessageAutoDeleteTime } -func (*MessageChatSetTtl) MessageContentType() string { - return TypeMessageChatSetTtl +func (*MessageChatSetMessageAutoDeleteTime) MessageContentType() string { + return TypeMessageChatSetMessageAutoDeleteTime +} + +// A forum topic has been created +type MessageForumTopicCreated struct { + meta + // Name of the topic + Name string `json:"name"` + // Icon of the topic + Icon *ForumTopicIcon `json:"icon"` +} + +func (entity *MessageForumTopicCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicCreated + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicCreated) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicCreated) GetType() string { + return TypeMessageForumTopicCreated +} + +func (*MessageForumTopicCreated) MessageContentType() string { + return TypeMessageForumTopicCreated +} + +// A forum topic has been edited +type MessageForumTopicEdited struct { + meta + // If non-empty, the new name of the topic + Name string `json:"name"` + // True, if icon's custom_emoji_id is changed + EditIconCustomEmojiId bool `json:"edit_icon_custom_emoji_id"` + // New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` +} + +func (entity *MessageForumTopicEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicEdited + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicEdited) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicEdited) GetType() string { + return TypeMessageForumTopicEdited +} + +func (*MessageForumTopicEdited) MessageContentType() string { + return TypeMessageForumTopicEdited +} + +// A forum topic has been closed or opened +type MessageForumTopicIsClosedToggled struct { + meta + // True, if the topic was closed; otherwise, the topic was reopened + IsClosed bool `json:"is_closed"` +} + +func (entity *MessageForumTopicIsClosedToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicIsClosedToggled + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicIsClosedToggled) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicIsClosedToggled) GetType() string { + return TypeMessageForumTopicIsClosedToggled +} + +func (*MessageForumTopicIsClosedToggled) MessageContentType() string { + return TypeMessageForumTopicIsClosedToggled +} + +// A General forum topic has been hidden or unhidden +type MessageForumTopicIsHiddenToggled struct { + meta + // True, if the topic was hidden; otherwise, the topic was unhidden + IsHidden bool `json:"is_hidden"` +} + +func (entity *MessageForumTopicIsHiddenToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicIsHiddenToggled + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicIsHiddenToggled) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicIsHiddenToggled) GetType() string { + return TypeMessageForumTopicIsHiddenToggled +} + +func (*MessageForumTopicIsHiddenToggled) MessageContentType() string { + return TypeMessageForumTopicIsHiddenToggled +} + +// A profile photo was suggested to a user in a private chat +type MessageSuggestProfilePhoto struct { + meta + // The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo + Photo *ChatPhoto `json:"photo"` +} + +func (entity *MessageSuggestProfilePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSuggestProfilePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSuggestProfilePhoto) GetClass() string { + return ClassMessageContent +} + +func (*MessageSuggestProfilePhoto) GetType() string { + return TypeMessageSuggestProfilePhoto +} + +func (*MessageSuggestProfilePhoto) MessageContentType() string { + return TypeMessageSuggestProfilePhoto } // A non-standard action has happened in the chat @@ -14829,14 +19702,20 @@ func (*MessageGameScore) MessageContentType() string { // A payment has been completed type MessagePaymentSuccessful struct { meta - // Identifier of the chat, containing the corresponding invoice message; 0 if unknown + // Identifier of the chat, containing the corresponding invoice message InvoiceChatId int64 `json:"invoice_chat_id"` - // Identifier of the message with the corresponding invoice; can be an identifier of a deleted message + // Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message InvoiceMessageId int64 `json:"invoice_message_id"` // Currency for the price of the product Currency string `json:"currency"` // Total price for the product, in the smallest units of the currency TotalAmount int64 `json:"total_amount"` + // True, if this is a recurring payment + IsRecurring bool `json:"is_recurring"` + // True, if this is the first recurring payment + IsFirstRecurring bool `json:"is_first_recurring"` + // Name of the invoice; may be empty if unknown + InvoiceName string `json:"invoice_name"` } func (entity *MessagePaymentSuccessful) MarshalJSON() ([]byte, error) { @@ -14866,6 +19745,10 @@ type MessagePaymentSuccessfulBot struct { Currency string `json:"currency"` // Total price for the product, in the smallest units of the currency TotalAmount int64 `json:"total_amount"` + // True, if this is a recurring payment + IsRecurring bool `json:"is_recurring"` + // True, if this is the first recurring payment + IsFirstRecurring bool `json:"is_first_recurring"` // Invoice payload InvoicePayload []byte `json:"invoice_payload"` // Identifier of the shipping option chosen by the user; may be empty if not applicable @@ -14898,6 +19781,167 @@ func (*MessagePaymentSuccessfulBot) MessageContentType() string { return TypeMessagePaymentSuccessfulBot } +// Telegram Premium was gifted to the user +type MessageGiftedPremium struct { + meta + // The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous + GifterUserId int64 `json:"gifter_user_id"` + // Currency for the paid amount + Currency string `json:"currency"` + // The paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Cryptocurrency used to pay for the gift; may be empty if none + Cryptocurrency string `json:"cryptocurrency"` + // The paid amount, in the smallest units of the cryptocurrency + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + // Number of month the Telegram Premium subscription will be active + MonthCount int32 `json:"month_count"` + // A sticker to be shown in the message; may be null if unknown + Sticker *Sticker `json:"sticker"` +} + +func (entity *MessageGiftedPremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageGiftedPremium + + return json.Marshal((*stub)(entity)) +} + +func (*MessageGiftedPremium) GetClass() string { + return ClassMessageContent +} + +func (*MessageGiftedPremium) GetType() string { + return TypeMessageGiftedPremium +} + +func (*MessageGiftedPremium) MessageContentType() string { + return TypeMessageGiftedPremium +} + +// A Telegram Premium gift code was created for the user +type MessagePremiumGiftCode struct { + meta + // Identifier of a chat or a user that created the gift code + CreatorId MessageSender `json:"creator_id"` + // True, if the gift code was created for a giveaway + IsFromGiveaway bool `json:"is_from_giveaway"` + // True, if the winner for the corresponding Telegram Premium subscription wasn't chosen + IsUnclaimed bool `json:"is_unclaimed"` + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // A sticker to be shown in the message; may be null if unknown + Sticker *Sticker `json:"sticker"` + // The gift code + Code string `json:"code"` +} + +func (entity *MessagePremiumGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiftCode) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiftCode) GetType() string { + return TypeMessagePremiumGiftCode +} + +func (*MessagePremiumGiftCode) MessageContentType() string { + return TypeMessagePremiumGiftCode +} + +func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte) error { + var tmp struct { + CreatorId json.RawMessage `json:"creator_id"` + IsFromGiveaway bool `json:"is_from_giveaway"` + IsUnclaimed bool `json:"is_unclaimed"` + MonthCount int32 `json:"month_count"` + Sticker *Sticker `json:"sticker"` + Code string `json:"code"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messagePremiumGiftCode.IsFromGiveaway = tmp.IsFromGiveaway + messagePremiumGiftCode.IsUnclaimed = tmp.IsUnclaimed + messagePremiumGiftCode.MonthCount = tmp.MonthCount + messagePremiumGiftCode.Sticker = tmp.Sticker + messagePremiumGiftCode.Code = tmp.Code + + fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) + messagePremiumGiftCode.CreatorId = fieldCreatorId + + return nil +} + +// A Telegram Premium giveaway was created for the chat +type MessagePremiumGiveawayCreated struct { + meta +} + +func (entity *MessagePremiumGiveawayCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiveawayCreated + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiveawayCreated) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiveawayCreated) GetType() string { + return TypeMessagePremiumGiveawayCreated +} + +func (*MessagePremiumGiveawayCreated) MessageContentType() string { + return TypeMessagePremiumGiveawayCreated +} + +// A Telegram Premium giveaway +type MessagePremiumGiveaway struct { + meta + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` + // Number of users which will receive Telegram Premium subscription gift codes + WinnerCount int32 `json:"winner_count"` + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // A sticker to be shown in the message; may be null if unknown + Sticker *Sticker `json:"sticker"` +} + +func (entity *MessagePremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiveaway) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiveaway) GetType() string { + return TypeMessagePremiumGiveaway +} + +func (*MessagePremiumGiveaway) MessageContentType() string { + return TypeMessagePremiumGiveaway +} + // A contact has registered with Telegram type MessageContactRegistered struct { meta @@ -14923,34 +19967,164 @@ func (*MessageContactRegistered) MessageContentType() string { return TypeMessageContactRegistered } -// The current user has connected a website by logging in using Telegram Login Widget on it -type MessageWebsiteConnected struct { +// The current user shared a user, which was requested by the bot +type MessageUserShared struct { meta - // Domain name of the connected website - DomainName string `json:"domain_name"` + // Identifier of the shared user + UserId int64 `json:"user_id"` + // Identifier of the keyboard button with the request + ButtonId int32 `json:"button_id"` } -func (entity *MessageWebsiteConnected) MarshalJSON() ([]byte, error) { +func (entity *MessageUserShared) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageWebsiteConnected + type stub MessageUserShared return json.Marshal((*stub)(entity)) } -func (*MessageWebsiteConnected) GetClass() string { +func (*MessageUserShared) GetClass() string { return ClassMessageContent } -func (*MessageWebsiteConnected) GetType() string { - return TypeMessageWebsiteConnected +func (*MessageUserShared) GetType() string { + return TypeMessageUserShared } -func (*MessageWebsiteConnected) MessageContentType() string { - return TypeMessageWebsiteConnected +func (*MessageUserShared) MessageContentType() string { + return TypeMessageUserShared } -// Telegram Passport data has been sent +// The current user shared a chat, which was requested by the bot +type MessageChatShared struct { + meta + // Identifier of the shared chat + ChatId int64 `json:"chat_id"` + // Identifier of the keyboard button with the request + ButtonId int32 `json:"button_id"` +} + +func (entity *MessageChatShared) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatShared + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatShared) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatShared) GetType() string { + return TypeMessageChatShared +} + +func (*MessageChatShared) MessageContentType() string { + return TypeMessageChatShared +} + +// The user allowed the bot to send messages +type MessageBotWriteAccessAllowed struct { + meta + // The reason why the bot was allowed to write messages + Reason BotWriteAccessAllowReason `json:"reason"` +} + +func (entity *MessageBotWriteAccessAllowed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageBotWriteAccessAllowed + + return json.Marshal((*stub)(entity)) +} + +func (*MessageBotWriteAccessAllowed) GetClass() string { + return ClassMessageContent +} + +func (*MessageBotWriteAccessAllowed) GetType() string { + return TypeMessageBotWriteAccessAllowed +} + +func (*MessageBotWriteAccessAllowed) MessageContentType() string { + return TypeMessageBotWriteAccessAllowed +} + +func (messageBotWriteAccessAllowed *MessageBotWriteAccessAllowed) UnmarshalJSON(data []byte) error { + var tmp struct { + Reason json.RawMessage `json:"reason"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldReason, _ := UnmarshalBotWriteAccessAllowReason(tmp.Reason) + messageBotWriteAccessAllowed.Reason = fieldReason + + return nil +} + +// Data from a Web App has been sent to a bot +type MessageWebAppDataSent struct { + meta + // Text of the keyboardButtonTypeWebApp button, which opened the Web App + ButtonText string `json:"button_text"` +} + +func (entity *MessageWebAppDataSent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageWebAppDataSent + + return json.Marshal((*stub)(entity)) +} + +func (*MessageWebAppDataSent) GetClass() string { + return ClassMessageContent +} + +func (*MessageWebAppDataSent) GetType() string { + return TypeMessageWebAppDataSent +} + +func (*MessageWebAppDataSent) MessageContentType() string { + return TypeMessageWebAppDataSent +} + +// Data from a Web App has been received; for bots only +type MessageWebAppDataReceived struct { + meta + // Text of the keyboardButtonTypeWebApp button, which opened the Web App + ButtonText string `json:"button_text"` + // The data + Data string `json:"data"` +} + +func (entity *MessageWebAppDataReceived) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageWebAppDataReceived + + return json.Marshal((*stub)(entity)) +} + +func (*MessageWebAppDataReceived) GetClass() string { + return ClassMessageContent +} + +func (*MessageWebAppDataReceived) GetType() string { + return TypeMessageWebAppDataReceived +} + +func (*MessageWebAppDataReceived) MessageContentType() string { + return TypeMessageWebAppDataReceived +} + +// Telegram Passport data has been sent to a bot type MessagePassportDataSent struct { meta // List of Telegram Passport element types sent @@ -15076,7 +20250,7 @@ func (messageProximityAlertTriggered *MessageProximityAlertTriggered) UnmarshalJ return nil } -// Message content that is not supported in the current TDLib version +// A message content that is not supported in the current TDLib version type MessageUnsupported struct { meta } @@ -15101,7 +20275,7 @@ func (*MessageUnsupported) MessageContentType() string { return TypeMessageUnsupported } -// A mention of a user by their username +// A mention of a user, a supergroup, or a channel by their username type TextEntityTypeMention struct { meta } @@ -15401,6 +20575,31 @@ func (*TextEntityTypeStrikethrough) TextEntityTypeType() string { return TypeTextEntityTypeStrikethrough } +// A spoiler text +type TextEntityTypeSpoiler struct { + meta +} + +func (entity *TextEntityTypeSpoiler) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeSpoiler + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeSpoiler) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeSpoiler) GetType() string { + return TypeTextEntityTypeSpoiler +} + +func (*TextEntityTypeSpoiler) TextEntityTypeType() string { + return TypeTextEntityTypeSpoiler +} + // Text that must be formatted as if inside a code HTML tag type TextEntityTypeCode struct { meta @@ -15478,6 +20677,31 @@ func (*TextEntityTypePreCode) TextEntityTypeType() string { return TypeTextEntityTypePreCode } +// Text that must be formatted as if inside a blockquote HTML tag +type TextEntityTypeBlockQuote struct { + meta +} + +func (entity *TextEntityTypeBlockQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeBlockQuote + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeBlockQuote) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeBlockQuote) GetType() string { + return TypeTextEntityTypeBlockQuote +} + +func (*TextEntityTypeBlockQuote) TextEntityTypeType() string { + return TypeTextEntityTypeBlockQuote +} + // A text description shown instead of a raw URL type TextEntityTypeTextUrl struct { meta @@ -15532,10 +20756,37 @@ func (*TextEntityTypeMentionName) TextEntityTypeType() string { return TypeTextEntityTypeMentionName } +// A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji +type TextEntityTypeCustomEmoji struct { + meta + // Unique identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *TextEntityTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeCustomEmoji) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeCustomEmoji) GetType() string { + return TypeTextEntityTypeCustomEmoji +} + +func (*TextEntityTypeCustomEmoji) TextEntityTypeType() string { + return TypeTextEntityTypeCustomEmoji +} + // A media timestamp type TextEntityTypeMediaTimestamp struct { meta - // Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message + // Timestamp from which a video/audio/video note/voice note/story playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message MediaTimestamp int32 `json:"media_timestamp"` } @@ -15610,7 +20861,7 @@ func (inputThumbnail *InputThumbnail) UnmarshalJSON(data []byte) error { // 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 + // Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future SendDate int32 `json:"send_date"` } @@ -15659,6 +20910,58 @@ func (*MessageSchedulingStateSendWhenOnline) MessageSchedulingStateType() string return TypeMessageSchedulingStateSendWhenOnline } +// The message will be self-destructed in the specified time after its content was opened +type MessageSelfDestructTypeTimer struct { + meta + // The message's self-destruct time, in seconds; must be between 0 and 60 in private chats + SelfDestructTime int32 `json:"self_destruct_time"` +} + +func (entity *MessageSelfDestructTypeTimer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSelfDestructTypeTimer + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSelfDestructTypeTimer) GetClass() string { + return ClassMessageSelfDestructType +} + +func (*MessageSelfDestructTypeTimer) GetType() string { + return TypeMessageSelfDestructTypeTimer +} + +func (*MessageSelfDestructTypeTimer) MessageSelfDestructTypeType() string { + return TypeMessageSelfDestructTypeTimer +} + +// The message can be opened only once and will be self-destructed once closed +type MessageSelfDestructTypeImmediately struct { + meta +} + +func (entity *MessageSelfDestructTypeImmediately) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSelfDestructTypeImmediately + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSelfDestructTypeImmediately) GetClass() string { + return ClassMessageSelfDestructType +} + +func (*MessageSelfDestructTypeImmediately) GetType() string { + return TypeMessageSelfDestructTypeImmediately +} + +func (*MessageSelfDestructTypeImmediately) MessageSelfDestructTypeType() string { + return TypeMessageSelfDestructTypeImmediately +} + // Options to be used when a message is sent type MessageSendOptions struct { meta @@ -15666,8 +20969,16 @@ type MessageSendOptions struct { DisableNotification bool `json:"disable_notification"` // Pass true if the message is sent from the background FromBackground bool `json:"from_background"` + // Pass true if the content of the message must be protected from forwarding and saving; for bots only + ProtectContent bool `json:"protect_content"` + // Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum + UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` // Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled SchedulingState MessageSchedulingState `json:"scheduling_state"` + // Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates + SendingId int32 `json:"sending_id"` + // Pass true to get a fake message instead of actually sending them + OnlyPreview bool `json:"only_preview"` } func (entity *MessageSendOptions) MarshalJSON() ([]byte, error) { @@ -15688,9 +20999,13 @@ func (*MessageSendOptions) GetType() string { func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { var tmp struct { - DisableNotification bool `json:"disable_notification"` - FromBackground bool `json:"from_background"` - SchedulingState json.RawMessage `json:"scheduling_state"` + DisableNotification bool `json:"disable_notification"` + FromBackground bool `json:"from_background"` + ProtectContent bool `json:"protect_content"` + UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` + SchedulingState json.RawMessage `json:"scheduling_state"` + SendingId int32 `json:"sending_id"` + OnlyPreview bool `json:"only_preview"` } err := json.Unmarshal(data, &tmp) @@ -15700,6 +21015,10 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { messageSendOptions.DisableNotification = tmp.DisableNotification messageSendOptions.FromBackground = tmp.FromBackground + messageSendOptions.ProtectContent = tmp.ProtectContent + messageSendOptions.UpdateOrderOfInstalledStickerSets = tmp.UpdateOrderOfInstalledStickerSets + messageSendOptions.SendingId = tmp.SendingId + messageSendOptions.OnlyPreview = tmp.OnlyPreview fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) messageSendOptions.SchedulingState = fieldSchedulingState @@ -15707,7 +21026,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { return nil } -// Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied +// Options to be used when a message content is copied without reference to the original sender. Service messages, and messages with messageInvoice or messagePremiumGiveaway content can't be copied type MessageCopyOptions struct { meta // True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local @@ -15737,10 +21056,10 @@ func (*MessageCopyOptions) GetType() string { // A text message type InputMessageText struct { meta - // Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually + // Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually Text *FormattedText `json:"text"` - // True, if rich web page previews for URLs in the message text must be disabled - DisableWebPagePreview bool `json:"disable_web_page_preview"` + // Options to be used for generation of a link preview; pass null to use default link preview options + LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` // True, if a chat message draft must be deleted ClearDraft bool `json:"clear_draft"` } @@ -15780,8 +21099,10 @@ type InputMessageAnimation struct { Width int32 `json:"width"` // Height of the animation; may be replaced by the server Height int32 `json:"height"` - // Animation caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Animation caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` + // True, if the animation preview must be covered by a spoiler animation; not supported in secret chats + HasSpoiler bool `json:"has_spoiler"` } func (entity *InputMessageAnimation) MarshalJSON() ([]byte, error) { @@ -15813,6 +21134,7 @@ func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) e Width int32 `json:"width"` Height int32 `json:"height"` Caption *FormattedText `json:"caption"` + HasSpoiler bool `json:"has_spoiler"` } err := json.Unmarshal(data, &tmp) @@ -15826,6 +21148,7 @@ func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) e inputMessageAnimation.Width = tmp.Width inputMessageAnimation.Height = tmp.Height inputMessageAnimation.Caption = tmp.Caption + inputMessageAnimation.HasSpoiler = tmp.HasSpoiler fieldAnimation, _ := UnmarshalInputFile(tmp.Animation) inputMessageAnimation.Animation = fieldAnimation @@ -15846,7 +21169,7 @@ type InputMessageAudio struct { Title string `json:"title"` // Performer of the audio; 0-64 characters, may be replaced by the server Performer string `json:"performer"` - // Audio caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Audio caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -15904,9 +21227,9 @@ type InputMessageDocument struct { Document InputFile `json:"document"` // Document thumbnail; pass null to skip thumbnail uploading Thumbnail *InputThumbnail `json:"thumbnail"` - // If true, automatic file type detection will be disabled and the document will be always sent as file. Always true for files sent to secret chats + // If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats DisableContentTypeDetection bool `json:"disable_content_type_detection"` - // Document caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -15956,7 +21279,7 @@ func (inputMessageDocument *InputMessageDocument) UnmarshalJSON(data []byte) err // A photo message type InputMessagePhoto struct { meta - // Photo to send + // Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 Photo InputFile `json:"photo"` // Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats Thumbnail *InputThumbnail `json:"thumbnail"` @@ -15966,10 +21289,12 @@ type InputMessagePhoto struct { Width int32 `json:"width"` // Photo height Height int32 `json:"height"` - // Photo caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` - // Photo TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats - Ttl int32 `json:"ttl"` + // Photo self-destruct type; pass null if none; private chats only + SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` + // True, if the photo preview must be covered by a spoiler animation; not supported in secret chats + HasSpoiler bool `json:"has_spoiler"` } func (entity *InputMessagePhoto) MarshalJSON() ([]byte, error) { @@ -16000,7 +21325,8 @@ func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { Width int32 `json:"width"` Height int32 `json:"height"` Caption *FormattedText `json:"caption"` - Ttl int32 `json:"ttl"` + SelfDestructType json.RawMessage `json:"self_destruct_type"` + HasSpoiler bool `json:"has_spoiler"` } err := json.Unmarshal(data, &tmp) @@ -16013,11 +21339,14 @@ func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { inputMessagePhoto.Width = tmp.Width inputMessagePhoto.Height = tmp.Height inputMessagePhoto.Caption = tmp.Caption - inputMessagePhoto.Ttl = tmp.Ttl + inputMessagePhoto.HasSpoiler = tmp.HasSpoiler fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) inputMessagePhoto.Photo = fieldPhoto + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) + inputMessagePhoto.SelfDestructType = fieldSelfDestructType + return nil } @@ -16098,10 +21427,12 @@ type InputMessageVideo struct { Height int32 `json:"height"` // True, if the video is supposed to be streamed SupportsStreaming bool `json:"supports_streaming"` - // Video caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` - // Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats - Ttl int32 `json:"ttl"` + // Video self-destruct type; pass null if none; private chats only + SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` + // True, if the video preview must be covered by a spoiler animation; not supported in secret chats + HasSpoiler bool `json:"has_spoiler"` } func (entity *InputMessageVideo) MarshalJSON() ([]byte, error) { @@ -16134,7 +21465,8 @@ func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error { Height int32 `json:"height"` SupportsStreaming bool `json:"supports_streaming"` Caption *FormattedText `json:"caption"` - Ttl int32 `json:"ttl"` + SelfDestructType json.RawMessage `json:"self_destruct_type"` + HasSpoiler bool `json:"has_spoiler"` } err := json.Unmarshal(data, &tmp) @@ -16149,11 +21481,14 @@ func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error { inputMessageVideo.Height = tmp.Height inputMessageVideo.SupportsStreaming = tmp.SupportsStreaming inputMessageVideo.Caption = tmp.Caption - inputMessageVideo.Ttl = tmp.Ttl + inputMessageVideo.HasSpoiler = tmp.HasSpoiler fieldVideo, _ := UnmarshalInputFile(tmp.Video) inputMessageVideo.Video = fieldVideo + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) + inputMessageVideo.SelfDestructType = fieldSelfDestructType + return nil } @@ -16220,9 +21555,9 @@ type InputMessageVoiceNote struct { VoiceNote InputFile `json:"voice_note"` // Duration of the voice note, in seconds Duration int32 `json:"duration"` - // Waveform representation of the voice note, in 5-bit format + // Waveform representation of the voice note in 5-bit format Waveform []byte `json:"waveform"` - // Voice note caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters + // Voice note caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters Caption *FormattedText `json:"caption"` } @@ -16439,6 +21774,8 @@ type InputMessageInvoice struct { ProviderData string `json:"provider_data"` // Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message StartParameter string `json:"start_parameter"` + // The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo + ExtendedMediaContent InputMessageContent `json:"extended_media_content"` } func (entity *InputMessageInvoice) MarshalJSON() ([]byte, error) { @@ -16461,6 +21798,45 @@ func (*InputMessageInvoice) InputMessageContentType() string { return TypeInputMessageInvoice } +func (inputMessageInvoice *InputMessageInvoice) UnmarshalJSON(data []byte) error { + var tmp struct { + Invoice *Invoice `json:"invoice"` + Title string `json:"title"` + Description string `json:"description"` + PhotoUrl string `json:"photo_url"` + PhotoSize int32 `json:"photo_size"` + PhotoWidth int32 `json:"photo_width"` + PhotoHeight int32 `json:"photo_height"` + Payload []byte `json:"payload"` + ProviderToken string `json:"provider_token"` + ProviderData string `json:"provider_data"` + StartParameter string `json:"start_parameter"` + ExtendedMediaContent json.RawMessage `json:"extended_media_content"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputMessageInvoice.Invoice = tmp.Invoice + inputMessageInvoice.Title = tmp.Title + inputMessageInvoice.Description = tmp.Description + inputMessageInvoice.PhotoUrl = tmp.PhotoUrl + inputMessageInvoice.PhotoSize = tmp.PhotoSize + inputMessageInvoice.PhotoWidth = tmp.PhotoWidth + inputMessageInvoice.PhotoHeight = tmp.PhotoHeight + inputMessageInvoice.Payload = tmp.Payload + inputMessageInvoice.ProviderToken = tmp.ProviderToken + inputMessageInvoice.ProviderData = tmp.ProviderData + inputMessageInvoice.StartParameter = tmp.StartParameter + + fieldExtendedMediaContent, _ := UnmarshalInputMessageContent(tmp.ExtendedMediaContent) + inputMessageInvoice.ExtendedMediaContent = fieldExtendedMediaContent + + return nil +} + // A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot type InputMessagePoll struct { meta @@ -16529,12 +21905,41 @@ func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { return nil } +// A message with a forwarded story. Stories can't be sent to secret chats. A story can be forwarded only if story.can_be_forwarded +type InputMessageStory struct { + meta + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *InputMessageStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageStory + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageStory) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageStory) GetType() string { + return TypeInputMessageStory +} + +func (*InputMessageStory) InputMessageContentType() string { + return TypeInputMessageStory +} + // A forwarded message type InputMessageForwarded struct { meta // Identifier for the chat this forwarded message came from FromChatId int64 `json:"from_chat_id"` - // Identifier of the message to forward + // Identifier of the message to forward. A message can be forwarded only if message.can_be_forwarded MessageId int64 `json:"message_id"` // True, if a game message is being shared from a launched game; applies only to game messages InGameShare bool `json:"in_game_share"` @@ -16912,6 +22317,31 @@ func (*SearchMessagesFilterUnreadMention) SearchMessagesFilterType() string { return TypeSearchMessagesFilterUnreadMention } +// Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user +type SearchMessagesFilterUnreadReaction struct { + meta +} + +func (entity *SearchMessagesFilterUnreadReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterUnreadReaction + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterUnreadReaction) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterUnreadReaction) GetType() string { + return TypeSearchMessagesFilterUnreadReaction +} + +func (*SearchMessagesFilterUnreadReaction) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterUnreadReaction +} + // Returns only failed to send messages. This filter can be used only if the message database is used type SearchMessagesFilterFailedToSend struct { meta @@ -17558,7 +22988,7 @@ type StickerSet struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed + // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` @@ -17568,10 +22998,12 @@ type StickerSet struct { IsArchived bool `json:"is_archived"` // True, if the sticker set is official IsOfficial bool `json:"is_official"` - // True, is the stickers in the set are animated - IsAnimated bool `json:"is_animated"` - // True, if the stickers in the set are masks - IsMasks bool `json:"is_masks"` + // Format of the stickers in the set + StickerFormat StickerFormat `json:"sticker_format"` + // Type of the stickers in the set + StickerType StickerType `json:"sticker_type"` + // True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only + NeedsRepainting bool `json:"needs_repainting"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // List of stickers in this set @@ -17596,6 +23028,51 @@ func (*StickerSet) GetType() string { return TypeStickerSet } +func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Thumbnail *Thumbnail `json:"thumbnail"` + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsInstalled bool `json:"is_installed"` + IsArchived bool `json:"is_archived"` + IsOfficial bool `json:"is_official"` + StickerFormat json.RawMessage `json:"sticker_format"` + StickerType json.RawMessage `json:"sticker_type"` + NeedsRepainting bool `json:"needs_repainting"` + IsViewed bool `json:"is_viewed"` + Stickers []*Sticker `json:"stickers"` + Emojis []*Emojis `json:"emojis"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + stickerSet.Id = tmp.Id + stickerSet.Title = tmp.Title + stickerSet.Name = tmp.Name + stickerSet.Thumbnail = tmp.Thumbnail + stickerSet.ThumbnailOutline = tmp.ThumbnailOutline + stickerSet.IsInstalled = tmp.IsInstalled + stickerSet.IsArchived = tmp.IsArchived + stickerSet.IsOfficial = tmp.IsOfficial + stickerSet.NeedsRepainting = tmp.NeedsRepainting + stickerSet.IsViewed = tmp.IsViewed + stickerSet.Stickers = tmp.Stickers + stickerSet.Emojis = tmp.Emojis + + fieldStickerFormat, _ := UnmarshalStickerFormat(tmp.StickerFormat) + stickerSet.StickerFormat = fieldStickerFormat + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + stickerSet.StickerType = fieldStickerType + + return nil +} + // Represents short information about a sticker set type StickerSetInfo struct { meta @@ -17605,7 +23082,7 @@ type StickerSetInfo struct { Title string `json:"title"` // Name of the sticker set Name string `json:"name"` - // Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null + // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` @@ -17615,10 +23092,12 @@ type StickerSetInfo struct { IsArchived bool `json:"is_archived"` // True, if the sticker set is official IsOfficial bool `json:"is_official"` - // True, is the stickers in the set are animated - IsAnimated bool `json:"is_animated"` - // True, if the stickers in the set are masks - IsMasks bool `json:"is_masks"` + // Format of the stickers in the set + StickerFormat StickerFormat `json:"sticker_format"` + // Type of the stickers in the set + StickerType StickerType `json:"sticker_type"` + // True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only + NeedsRepainting bool `json:"needs_repainting"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // Total number of stickers in the set @@ -17643,6 +23122,51 @@ func (*StickerSetInfo) GetType() string { return TypeStickerSetInfo } +func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Thumbnail *Thumbnail `json:"thumbnail"` + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsInstalled bool `json:"is_installed"` + IsArchived bool `json:"is_archived"` + IsOfficial bool `json:"is_official"` + StickerFormat json.RawMessage `json:"sticker_format"` + StickerType json.RawMessage `json:"sticker_type"` + NeedsRepainting bool `json:"needs_repainting"` + IsViewed bool `json:"is_viewed"` + Size int32 `json:"size"` + Covers []*Sticker `json:"covers"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + stickerSetInfo.Id = tmp.Id + stickerSetInfo.Title = tmp.Title + stickerSetInfo.Name = tmp.Name + stickerSetInfo.Thumbnail = tmp.Thumbnail + stickerSetInfo.ThumbnailOutline = tmp.ThumbnailOutline + stickerSetInfo.IsInstalled = tmp.IsInstalled + stickerSetInfo.IsArchived = tmp.IsArchived + stickerSetInfo.IsOfficial = tmp.IsOfficial + stickerSetInfo.NeedsRepainting = tmp.NeedsRepainting + stickerSetInfo.IsViewed = tmp.IsViewed + stickerSetInfo.Size = tmp.Size + stickerSetInfo.Covers = tmp.Covers + + fieldStickerFormat, _ := UnmarshalStickerFormat(tmp.StickerFormat) + stickerSetInfo.StickerFormat = fieldStickerFormat + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + stickerSetInfo.StickerType = fieldStickerType + + return nil +} + // Represents a list of sticker sets type StickerSets struct { meta @@ -17668,6 +23192,1461 @@ func (*StickerSets) GetType() string { return TypeStickerSets } +// Represents a list of trending sticker sets +type TrendingStickerSets struct { + meta + // Approximate total number of trending sticker sets + TotalCount int32 `json:"total_count"` + // List of trending sticker sets + Sets []*StickerSetInfo `json:"sets"` + // True, if the list contains sticker sets with premium stickers + IsPremium bool `json:"is_premium"` +} + +func (entity *TrendingStickerSets) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TrendingStickerSets + + return json.Marshal((*stub)(entity)) +} + +func (*TrendingStickerSets) GetClass() string { + return ClassTrendingStickerSets +} + +func (*TrendingStickerSets) GetType() string { + return TypeTrendingStickerSets +} + +// Contains a list of similar emoji to search for in getStickers and searchStickers +type EmojiCategory struct { + meta + // Name of the category + Name string `json:"name"` + // Custom emoji sticker, which represents icon of the category + Icon *Sticker `json:"icon"` + // List of emojis in the category + Emojis []string `json:"emojis"` +} + +func (entity *EmojiCategory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiCategory + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiCategory) GetClass() string { + return ClassEmojiCategory +} + +func (*EmojiCategory) GetType() string { + return TypeEmojiCategory +} + +// Represents a list of emoji categories +type EmojiCategories struct { + meta + // List of categories + Categories []*EmojiCategory `json:"categories"` +} + +func (entity *EmojiCategories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiCategories + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiCategories) GetClass() string { + return ClassEmojiCategories +} + +func (*EmojiCategories) GetType() string { + return TypeEmojiCategories +} + +// The category must be used by default +type EmojiCategoryTypeDefault struct { + meta +} + +func (entity *EmojiCategoryTypeDefault) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiCategoryTypeDefault + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiCategoryTypeDefault) GetClass() string { + return ClassEmojiCategoryType +} + +func (*EmojiCategoryTypeDefault) GetType() string { + return TypeEmojiCategoryTypeDefault +} + +func (*EmojiCategoryTypeDefault) EmojiCategoryTypeType() string { + return TypeEmojiCategoryTypeDefault +} + +// The category must be used for emoji status selection +type EmojiCategoryTypeEmojiStatus struct { + meta +} + +func (entity *EmojiCategoryTypeEmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiCategoryTypeEmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiCategoryTypeEmojiStatus) GetClass() string { + return ClassEmojiCategoryType +} + +func (*EmojiCategoryTypeEmojiStatus) GetType() string { + return TypeEmojiCategoryTypeEmojiStatus +} + +func (*EmojiCategoryTypeEmojiStatus) EmojiCategoryTypeType() string { + return TypeEmojiCategoryTypeEmojiStatus +} + +// The category must be used for chat photo emoji selection +type EmojiCategoryTypeChatPhoto struct { + meta +} + +func (entity *EmojiCategoryTypeChatPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiCategoryTypeChatPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiCategoryTypeChatPhoto) GetClass() string { + return ClassEmojiCategoryType +} + +func (*EmojiCategoryTypeChatPhoto) GetType() string { + return TypeEmojiCategoryTypeChatPhoto +} + +func (*EmojiCategoryTypeChatPhoto) EmojiCategoryTypeType() string { + return TypeEmojiCategoryTypeChatPhoto +} + +// Represents a viewer of a story +type StoryViewer struct { + meta + // User identifier of the viewer + UserId int64 `json:"user_id"` + // Approximate point in time (Unix timestamp) when the story was viewed + ViewDate int32 `json:"view_date"` + // Block list to which the user is added; may be null if none + BlockList BlockList `json:"block_list"` + // Type of the reaction that was chosen by the user; may be null if none + ChosenReactionType ReactionType `json:"chosen_reaction_type"` +} + +func (entity *StoryViewer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryViewer + + return json.Marshal((*stub)(entity)) +} + +func (*StoryViewer) GetClass() string { + return ClassStoryViewer +} + +func (*StoryViewer) GetType() string { + return TypeStoryViewer +} + +func (storyViewer *StoryViewer) UnmarshalJSON(data []byte) error { + var tmp struct { + UserId int64 `json:"user_id"` + ViewDate int32 `json:"view_date"` + BlockList json.RawMessage `json:"block_list"` + ChosenReactionType json.RawMessage `json:"chosen_reaction_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyViewer.UserId = tmp.UserId + storyViewer.ViewDate = tmp.ViewDate + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + storyViewer.BlockList = fieldBlockList + + fieldChosenReactionType, _ := UnmarshalReactionType(tmp.ChosenReactionType) + storyViewer.ChosenReactionType = fieldChosenReactionType + + return nil +} + +// Represents a list of story viewers +type StoryViewers struct { + meta + // Approximate total number of story viewers found + TotalCount int32 `json:"total_count"` + // Approximate total number of reactions set by found story viewers + TotalReactionCount int32 `json:"total_reaction_count"` + // List of story viewers + Viewers []*StoryViewer `json:"viewers"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *StoryViewers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryViewers + + return json.Marshal((*stub)(entity)) +} + +func (*StoryViewers) GetClass() string { + return ClassStoryViewers +} + +func (*StoryViewers) GetType() string { + return TypeStoryViewers +} + +// Describes position of a clickable rectangle area on a story media +type StoryAreaPosition struct { + meta + // The abscissa of the rectangle's center, as a percentage of the media width + XPercentage float64 `json:"x_percentage"` + // The ordinate of the rectangle's center, as a percentage of the media height + YPercentage float64 `json:"y_percentage"` + // The width of the rectangle, as a percentage of the media width + WidthPercentage float64 `json:"width_percentage"` + // The height of the rectangle, as a percentage of the media height + HeightPercentage float64 `json:"height_percentage"` + // Clockwise rotation angle of the rectangle, in degrees; 0-360 + RotationAngle float64 `json:"rotation_angle"` +} + +func (entity *StoryAreaPosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaPosition + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaPosition) GetClass() string { + return ClassStoryAreaPosition +} + +func (*StoryAreaPosition) GetType() string { + return TypeStoryAreaPosition +} + +// An area pointing to a location +type StoryAreaTypeLocation struct { + meta + // The location + Location *Location `json:"location"` +} + +func (entity *StoryAreaTypeLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeLocation + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeLocation) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeLocation) GetType() string { + return TypeStoryAreaTypeLocation +} + +func (*StoryAreaTypeLocation) StoryAreaTypeType() string { + return TypeStoryAreaTypeLocation +} + +// An area pointing to a venue +type StoryAreaTypeVenue struct { + meta + // Information about the venue + Venue *Venue `json:"venue"` +} + +func (entity *StoryAreaTypeVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeVenue + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeVenue) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeVenue) GetType() string { + return TypeStoryAreaTypeVenue +} + +func (*StoryAreaTypeVenue) StoryAreaTypeType() string { + return TypeStoryAreaTypeVenue +} + +// An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked +type StoryAreaTypeSuggestedReaction struct { + meta + // Type of the reaction + ReactionType ReactionType `json:"reaction_type"` + // Number of times the reaction was added + TotalCount int32 `json:"total_count"` + // True, if reaction has a dark background + IsDark bool `json:"is_dark"` + // True, if reaction corner is flipped + IsFlipped bool `json:"is_flipped"` +} + +func (entity *StoryAreaTypeSuggestedReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeSuggestedReaction + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeSuggestedReaction) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeSuggestedReaction) GetType() string { + return TypeStoryAreaTypeSuggestedReaction +} + +func (*StoryAreaTypeSuggestedReaction) StoryAreaTypeType() string { + return TypeStoryAreaTypeSuggestedReaction +} + +func (storyAreaTypeSuggestedReaction *StoryAreaTypeSuggestedReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + ReactionType json.RawMessage `json:"reaction_type"` + TotalCount int32 `json:"total_count"` + IsDark bool `json:"is_dark"` + IsFlipped bool `json:"is_flipped"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyAreaTypeSuggestedReaction.TotalCount = tmp.TotalCount + storyAreaTypeSuggestedReaction.IsDark = tmp.IsDark + storyAreaTypeSuggestedReaction.IsFlipped = tmp.IsFlipped + + fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType) + storyAreaTypeSuggestedReaction.ReactionType = fieldReactionType + + return nil +} + +// Describes a clickable rectangle area on a story media +type StoryArea struct { + meta + // Position of the area + Position *StoryAreaPosition `json:"position"` + // Type of the area + Type StoryAreaType `json:"type"` +} + +func (entity *StoryArea) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryArea + + return json.Marshal((*stub)(entity)) +} + +func (*StoryArea) GetClass() string { + return ClassStoryArea +} + +func (*StoryArea) GetType() string { + return TypeStoryArea +} + +func (storyArea *StoryArea) UnmarshalJSON(data []byte) error { + var tmp struct { + Position *StoryAreaPosition `json:"position"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyArea.Position = tmp.Position + + fieldType, _ := UnmarshalStoryAreaType(tmp.Type) + storyArea.Type = fieldType + + return nil +} + +// An area pointing to a location +type InputStoryAreaTypeLocation struct { + meta + // The location + Location *Location `json:"location"` +} + +func (entity *InputStoryAreaTypeLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeLocation + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeLocation) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeLocation) GetType() string { + return TypeInputStoryAreaTypeLocation +} + +func (*InputStoryAreaTypeLocation) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeLocation +} + +// An area pointing to a venue found by the bot getOption("venue_search_bot_username") +type InputStoryAreaTypeFoundVenue struct { + meta + // Identifier of the inline query, used to found the venue + QueryId JsonInt64 `json:"query_id"` + // Identifier of the inline query result + ResultId string `json:"result_id"` +} + +func (entity *InputStoryAreaTypeFoundVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeFoundVenue + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeFoundVenue) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeFoundVenue) GetType() string { + return TypeInputStoryAreaTypeFoundVenue +} + +func (*InputStoryAreaTypeFoundVenue) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeFoundVenue +} + +// An area pointing to a venue already added to the story +type InputStoryAreaTypePreviousVenue struct { + meta + // Provider of the venue + VenueProvider string `json:"venue_provider"` + // Identifier of the venue in the provider database + VenueId string `json:"venue_id"` +} + +func (entity *InputStoryAreaTypePreviousVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypePreviousVenue + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypePreviousVenue) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypePreviousVenue) GetType() string { + return TypeInputStoryAreaTypePreviousVenue +} + +func (*InputStoryAreaTypePreviousVenue) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypePreviousVenue +} + +// An area pointing to a suggested reaction +type InputStoryAreaTypeSuggestedReaction struct { + meta + // Type of the reaction + ReactionType ReactionType `json:"reaction_type"` + // True, if reaction has a dark background + IsDark bool `json:"is_dark"` + // True, if reaction corner is flipped + IsFlipped bool `json:"is_flipped"` +} + +func (entity *InputStoryAreaTypeSuggestedReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeSuggestedReaction + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeSuggestedReaction) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeSuggestedReaction) GetType() string { + return TypeInputStoryAreaTypeSuggestedReaction +} + +func (*InputStoryAreaTypeSuggestedReaction) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeSuggestedReaction +} + +func (inputStoryAreaTypeSuggestedReaction *InputStoryAreaTypeSuggestedReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + ReactionType json.RawMessage `json:"reaction_type"` + IsDark bool `json:"is_dark"` + IsFlipped bool `json:"is_flipped"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryAreaTypeSuggestedReaction.IsDark = tmp.IsDark + inputStoryAreaTypeSuggestedReaction.IsFlipped = tmp.IsFlipped + + fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType) + inputStoryAreaTypeSuggestedReaction.ReactionType = fieldReactionType + + return nil +} + +// Describes a clickable rectangle area on a story media to be added +type InputStoryArea struct { + meta + // Position of the area + Position *StoryAreaPosition `json:"position"` + // Type of the area + Type InputStoryAreaType `json:"type"` +} + +func (entity *InputStoryArea) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryArea + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryArea) GetClass() string { + return ClassInputStoryArea +} + +func (*InputStoryArea) GetType() string { + return TypeInputStoryArea +} + +func (inputStoryArea *InputStoryArea) UnmarshalJSON(data []byte) error { + var tmp struct { + Position *StoryAreaPosition `json:"position"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryArea.Position = tmp.Position + + fieldType, _ := UnmarshalInputStoryAreaType(tmp.Type) + inputStoryArea.Type = fieldType + + return nil +} + +// Contains a list of story areas to be added +type InputStoryAreas struct { + meta + // List of 0-10 input story areas + Areas []*InputStoryArea `json:"areas"` +} + +func (entity *InputStoryAreas) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreas + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreas) GetClass() string { + return ClassInputStoryAreas +} + +func (*InputStoryAreas) GetType() string { + return TypeInputStoryAreas +} + +// Describes a video file sent in a story +type StoryVideo struct { + meta + // Duration of the video, in seconds + Duration float64 `json:"duration"` + // Video width + Width int32 `json:"width"` + // Video height + Height int32 `json:"height"` + // True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets + HasStickers bool `json:"has_stickers"` + // True, if the video has no sound + IsAnimation bool `json:"is_animation"` + // Video minithumbnail; may be null + Minithumbnail *Minithumbnail `json:"minithumbnail"` + // Video thumbnail in JPEG or MPEG4 format; may be null + Thumbnail *Thumbnail `json:"thumbnail"` + // Size of file prefix, which is supposed to be preloaded, in bytes + PreloadPrefixSize int32 `json:"preload_prefix_size"` + // File containing the video + Video *File `json:"video"` +} + +func (entity *StoryVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryVideo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryVideo) GetClass() string { + return ClassStoryVideo +} + +func (*StoryVideo) GetType() string { + return TypeStoryVideo +} + +// A photo story +type StoryContentPhoto struct { + meta + // The photo + Photo *Photo `json:"photo"` +} + +func (entity *StoryContentPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentPhoto) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentPhoto) GetType() string { + return TypeStoryContentPhoto +} + +func (*StoryContentPhoto) StoryContentType() string { + return TypeStoryContentPhoto +} + +// A video story +type StoryContentVideo struct { + meta + // The video in MPEG4 format + Video *StoryVideo `json:"video"` + // Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null + AlternativeVideo *StoryVideo `json:"alternative_video"` +} + +func (entity *StoryContentVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentVideo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentVideo) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentVideo) GetType() string { + return TypeStoryContentVideo +} + +func (*StoryContentVideo) StoryContentType() string { + return TypeStoryContentVideo +} + +// A story content that is not supported in the current TDLib version +type StoryContentUnsupported struct { + meta +} + +func (entity *StoryContentUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentUnsupported) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentUnsupported) GetType() string { + return TypeStoryContentUnsupported +} + +func (*StoryContentUnsupported) StoryContentType() string { + return TypeStoryContentUnsupported +} + +// A photo story +type InputStoryContentPhoto struct { + meta + // Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920 + Photo InputFile `json:"photo"` + // File identifiers of the stickers added to the photo, if applicable + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` +} + +func (entity *InputStoryContentPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryContentPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryContentPhoto) GetClass() string { + return ClassInputStoryContent +} + +func (*InputStoryContentPhoto) GetType() string { + return TypeInputStoryContentPhoto +} + +func (*InputStoryContentPhoto) InputStoryContentType() string { + return TypeInputStoryContentPhoto +} + +func (inputStoryContentPhoto *InputStoryContentPhoto) UnmarshalJSON(data []byte) error { + var tmp struct { + Photo json.RawMessage `json:"photo"` + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryContentPhoto.AddedStickerFileIds = tmp.AddedStickerFileIds + + fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) + inputStoryContentPhoto.Photo = fieldPhoto + + return nil +} + +// A video story +type InputStoryContentVideo struct { + meta + // Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second + Video InputFile `json:"video"` + // File identifiers of the stickers added to the video, if applicable + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + // Precise duration of the video, in seconds; 0-60 + Duration float64 `json:"duration"` + // True, if the video has no sound + IsAnimation bool `json:"is_animation"` +} + +func (entity *InputStoryContentVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryContentVideo + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryContentVideo) GetClass() string { + return ClassInputStoryContent +} + +func (*InputStoryContentVideo) GetType() string { + return TypeInputStoryContentVideo +} + +func (*InputStoryContentVideo) InputStoryContentType() string { + return TypeInputStoryContentVideo +} + +func (inputStoryContentVideo *InputStoryContentVideo) UnmarshalJSON(data []byte) error { + var tmp struct { + Video json.RawMessage `json:"video"` + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + Duration float64 `json:"duration"` + IsAnimation bool `json:"is_animation"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryContentVideo.AddedStickerFileIds = tmp.AddedStickerFileIds + inputStoryContentVideo.Duration = tmp.Duration + inputStoryContentVideo.IsAnimation = tmp.IsAnimation + + fieldVideo, _ := UnmarshalInputFile(tmp.Video) + inputStoryContentVideo.Video = fieldVideo + + return nil +} + +// The list of stories, shown in the main chat list and folder chat lists +type StoryListMain struct { + meta +} + +func (entity *StoryListMain) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryListMain + + return json.Marshal((*stub)(entity)) +} + +func (*StoryListMain) GetClass() string { + return ClassStoryList +} + +func (*StoryListMain) GetType() string { + return TypeStoryListMain +} + +func (*StoryListMain) StoryListType() string { + return TypeStoryListMain +} + +// The list of stories, shown in the Arvhive chat list +type StoryListArchive struct { + meta +} + +func (entity *StoryListArchive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryListArchive + + return json.Marshal((*stub)(entity)) +} + +func (*StoryListArchive) GetClass() string { + return ClassStoryList +} + +func (*StoryListArchive) GetType() string { + return TypeStoryListArchive +} + +func (*StoryListArchive) StoryListType() string { + return TypeStoryListArchive +} + +// Contains information about interactions with a story +type StoryInteractionInfo struct { + meta + // Number of times the story was viewed + ViewCount int32 `json:"view_count"` + // Number of times the story was forwarded; 0 if none or unknown + ForwardCount int32 `json:"forward_count"` + // Number of reactions added to the story; 0 if none or unknown + ReactionCount int32 `json:"reaction_count"` + // Identifiers of at most 3 recent viewers of the story + RecentViewerUserIds []int64 `json:"recent_viewer_user_ids"` +} + +func (entity *StoryInteractionInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractionInfo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractionInfo) GetClass() string { + return ClassStoryInteractionInfo +} + +func (*StoryInteractionInfo) GetType() string { + return TypeStoryInteractionInfo +} + +// Represents a story +type Story struct { + meta + // Unique story identifier among stories of the given sender + Id int32 `json:"id"` + // Identifier of the chat that posted the story + SenderChatId int64 `json:"sender_chat_id"` + // Point in time (Unix timestamp) when the story was published + Date int32 `json:"date"` + // True, if the story is being sent by the current user + IsBeingSent bool `json:"is_being_sent"` + // True, if the story is being edited by the current user + IsBeingEdited bool `json:"is_being_edited"` + // True, if the story was edited + IsEdited bool `json:"is_edited"` + // True, if the story is saved in the sender's profile and will be available there after expiration + IsPinned bool `json:"is_pinned"` + // True, if the story is visible only for the current user + IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` + // True, if the story can be deleted + CanBeDeleted bool `json:"can_be_deleted"` + // True, if the story can be edited + CanBeEdited bool `json:"can_be_edited"` + // True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden + CanBeForwarded bool `json:"can_be_forwarded"` + // True, if the story can be replied in the chat with the story sender + CanBeReplied bool `json:"can_be_replied"` + // True, if the story's is_pinned value can be changed + CanToggleIsPinned bool `json:"can_toggle_is_pinned"` + // True, if users viewed the story can be received through getStoryViewers + CanGetViewers bool `json:"can_get_viewers"` + // True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago + HasExpiredViewers bool `json:"has_expired_viewers"` + // Information about interactions with the story; may be null if the story isn't owned or there were no interactions + InteractionInfo *StoryInteractionInfo `json:"interaction_info"` + // Type of the chosen reaction; may be null if none + ChosenReactionType ReactionType `json:"chosen_reaction_type"` + // Privacy rules affecting story visibility; may be approximate for non-owned stories + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` + // Content of the story + Content StoryContent `json:"content"` + // Clickable areas to be shown on the story content + Areas []*StoryArea `json:"areas"` + // Caption of the story + Caption *FormattedText `json:"caption"` +} + +func (entity *Story) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Story + + return json.Marshal((*stub)(entity)) +} + +func (*Story) GetClass() string { + return ClassStory +} + +func (*Story) GetType() string { + return TypeStory +} + +func (story *Story) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + SenderChatId int64 `json:"sender_chat_id"` + Date int32 `json:"date"` + IsBeingSent bool `json:"is_being_sent"` + IsBeingEdited bool `json:"is_being_edited"` + IsEdited bool `json:"is_edited"` + IsPinned bool `json:"is_pinned"` + IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` + CanBeDeleted bool `json:"can_be_deleted"` + CanBeEdited bool `json:"can_be_edited"` + CanBeForwarded bool `json:"can_be_forwarded"` + CanBeReplied bool `json:"can_be_replied"` + CanToggleIsPinned bool `json:"can_toggle_is_pinned"` + CanGetViewers bool `json:"can_get_viewers"` + HasExpiredViewers bool `json:"has_expired_viewers"` + InteractionInfo *StoryInteractionInfo `json:"interaction_info"` + ChosenReactionType json.RawMessage `json:"chosen_reaction_type"` + PrivacySettings json.RawMessage `json:"privacy_settings"` + Content json.RawMessage `json:"content"` + Areas []*StoryArea `json:"areas"` + Caption *FormattedText `json:"caption"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + story.Id = tmp.Id + story.SenderChatId = tmp.SenderChatId + story.Date = tmp.Date + story.IsBeingSent = tmp.IsBeingSent + story.IsBeingEdited = tmp.IsBeingEdited + story.IsEdited = tmp.IsEdited + story.IsPinned = tmp.IsPinned + story.IsVisibleOnlyForSelf = tmp.IsVisibleOnlyForSelf + story.CanBeDeleted = tmp.CanBeDeleted + story.CanBeEdited = tmp.CanBeEdited + story.CanBeForwarded = tmp.CanBeForwarded + story.CanBeReplied = tmp.CanBeReplied + story.CanToggleIsPinned = tmp.CanToggleIsPinned + story.CanGetViewers = tmp.CanGetViewers + story.HasExpiredViewers = tmp.HasExpiredViewers + story.InteractionInfo = tmp.InteractionInfo + story.Areas = tmp.Areas + story.Caption = tmp.Caption + + fieldChosenReactionType, _ := UnmarshalReactionType(tmp.ChosenReactionType) + story.ChosenReactionType = fieldChosenReactionType + + fieldPrivacySettings, _ := UnmarshalStoryPrivacySettings(tmp.PrivacySettings) + story.PrivacySettings = fieldPrivacySettings + + fieldContent, _ := UnmarshalStoryContent(tmp.Content) + story.Content = fieldContent + + return nil +} + +// Represents a list of stories +type Stories struct { + meta + // Approximate total number of stories found + TotalCount int32 `json:"total_count"` + // The list of stories + Stories []*Story `json:"stories"` +} + +func (entity *Stories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Stories + + return json.Marshal((*stub)(entity)) +} + +func (*Stories) GetClass() string { + return ClassStories +} + +func (*Stories) GetType() string { + return TypeStories +} + +// Contains basic information about a story +type StoryInfo struct { + meta + // Unique story identifier among stories of the given sender + StoryId int32 `json:"story_id"` + // Point in time (Unix timestamp) when the story was published + Date int32 `json:"date"` + // True, if the story is available only to close friends + IsForCloseFriends bool `json:"is_for_close_friends"` +} + +func (entity *StoryInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInfo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInfo) GetClass() string { + return ClassStoryInfo +} + +func (*StoryInfo) GetType() string { + return TypeStoryInfo +} + +// Describes active stories posted by a chat +type ChatActiveStories struct { + meta + // Identifier of the chat that posted the stories + ChatId int64 `json:"chat_id"` + // Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list + List StoryList `json:"list"` + // A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order + Order int64 `json:"order"` + // Identifier of the last read active story + MaxReadStoryId int32 `json:"max_read_story_id"` + // Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers) + Stories []*StoryInfo `json:"stories"` +} + +func (entity *ChatActiveStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActiveStories + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActiveStories) GetClass() string { + return ClassChatActiveStories +} + +func (*ChatActiveStories) GetType() string { + return TypeChatActiveStories +} + +func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + List json.RawMessage `json:"list"` + Order int64 `json:"order"` + MaxReadStoryId int32 `json:"max_read_story_id"` + Stories []*StoryInfo `json:"stories"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatActiveStories.ChatId = tmp.ChatId + chatActiveStories.Order = tmp.Order + chatActiveStories.MaxReadStoryId = tmp.MaxReadStoryId + chatActiveStories.Stories = tmp.Stories + + fieldList, _ := UnmarshalStoryList(tmp.List) + chatActiveStories.List = fieldList + + return nil +} + +// The chat created a Telegram Premium gift code for a user +type ChatBoostSourceGiftCode struct { + meta + // Identifier of a user, for which the gift code was created + UserId int64 `json:"user_id"` + // The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed + GiftCode string `json:"gift_code"` +} + +func (entity *ChatBoostSourceGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSourceGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSourceGiftCode) GetClass() string { + return ClassChatBoostSource +} + +func (*ChatBoostSourceGiftCode) GetType() string { + return TypeChatBoostSourceGiftCode +} + +func (*ChatBoostSourceGiftCode) ChatBoostSourceType() string { + return TypeChatBoostSourceGiftCode +} + +// The chat created a Telegram Premium giveaway +type ChatBoostSourceGiveaway struct { + meta + // Identifier of a user that won in the giveaway; 0 if none + UserId int64 `json:"user_id"` + // The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise + GiftCode string `json:"gift_code"` + // Identifier of the corresponding giveaway message; can be an identifier of a deleted message + GiveawayMessageId int64 `json:"giveaway_message_id"` + // True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, because there were not enough participants + IsUnclaimed bool `json:"is_unclaimed"` +} + +func (entity *ChatBoostSourceGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSourceGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSourceGiveaway) GetClass() string { + return ClassChatBoostSource +} + +func (*ChatBoostSourceGiveaway) GetType() string { + return TypeChatBoostSourceGiveaway +} + +func (*ChatBoostSourceGiveaway) ChatBoostSourceType() string { + return TypeChatBoostSourceGiveaway +} + +// A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat +type ChatBoostSourcePremium struct { + meta + // Identifier of the user + UserId int64 `json:"user_id"` +} + +func (entity *ChatBoostSourcePremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSourcePremium + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSourcePremium) GetClass() string { + return ClassChatBoostSource +} + +func (*ChatBoostSourcePremium) GetType() string { + return TypeChatBoostSourcePremium +} + +func (*ChatBoostSourcePremium) ChatBoostSourceType() string { + return TypeChatBoostSourcePremium +} + +// Describes a prepaid Telegram Premium giveaway +type PrepaidPremiumGiveaway struct { + meta + // Unique identifier of the prepaid giveaway + Id JsonInt64 `json:"id"` + // Number of users which will receive Telegram Premium subscription gift codes + WinnerCount int32 `json:"winner_count"` + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // Point in time (Unix timestamp) when the giveaway was paid + PaymentDate int32 `json:"payment_date"` +} + +func (entity *PrepaidPremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PrepaidPremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*PrepaidPremiumGiveaway) GetClass() string { + return ClassPrepaidPremiumGiveaway +} + +func (*PrepaidPremiumGiveaway) GetType() string { + return TypePrepaidPremiumGiveaway +} + +// Describes current boost status of a chat +type ChatBoostStatus struct { + meta + // An HTTP URL, which can be used to boost the chat + BoostUrl string `json:"boost_url"` + // Identifiers of boost slots of the current user applied to the chat + AppliedSlotIds []int32 `json:"applied_slot_ids"` + // Current boost level of the chat + Level int32 `json:"level"` + // The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn't an administrator in the chat + GiftCodeBoostCount int32 `json:"gift_code_boost_count"` + // The number of boosts received by the chat + BoostCount int32 `json:"boost_count"` + // The number of boosts added to reach the current level + CurrentLevelBoostCount int32 `json:"current_level_boost_count"` + // The number of boosts needed to reach the next level; 0 if the next level isn't available + NextLevelBoostCount int32 `json:"next_level_boost_count"` + // Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat + PremiumMemberCount int32 `json:"premium_member_count"` + // A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat + PremiumMemberPercentage float64 `json:"premium_member_percentage"` + // The list of prepaid giveaways available for the chat; only for chat administrators + PrepaidGiveaways []*PrepaidPremiumGiveaway `json:"prepaid_giveaways"` +} + +func (entity *ChatBoostStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostStatus + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostStatus) GetClass() string { + return ClassChatBoostStatus +} + +func (*ChatBoostStatus) GetType() string { + return TypeChatBoostStatus +} + +// Describes a boost applied to a chat +type ChatBoost struct { + meta + // Unique identifier of the boost + Id string `json:"id"` + // The number of identical boosts applied + Count int32 `json:"count"` + // Source of the boost + Source ChatBoostSource `json:"source"` + // Point in time (Unix timestamp) when the chat was boosted + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the boost will expire + ExpirationDate int32 `json:"expiration_date"` +} + +func (entity *ChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoost) GetClass() string { + return ClassChatBoost +} + +func (*ChatBoost) GetType() string { + return TypeChatBoost +} + +func (chatBoost *ChatBoost) UnmarshalJSON(data []byte) error { + var tmp struct { + Id string `json:"id"` + Count int32 `json:"count"` + Source json.RawMessage `json:"source"` + StartDate int32 `json:"start_date"` + ExpirationDate int32 `json:"expiration_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatBoost.Id = tmp.Id + chatBoost.Count = tmp.Count + chatBoost.StartDate = tmp.StartDate + chatBoost.ExpirationDate = tmp.ExpirationDate + + fieldSource, _ := UnmarshalChatBoostSource(tmp.Source) + chatBoost.Source = fieldSource + + return nil +} + +// Contains a list of boosts applied to a chat +type FoundChatBoosts struct { + meta + // Total number of boosts applied to the chat + TotalCount int32 `json:"total_count"` + // List of boosts + Boosts []*ChatBoost `json:"boosts"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *FoundChatBoosts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundChatBoosts + + return json.Marshal((*stub)(entity)) +} + +func (*FoundChatBoosts) GetClass() string { + return ClassFoundChatBoosts +} + +func (*FoundChatBoosts) GetType() string { + return TypeFoundChatBoosts +} + +// Describes a slot for chat boost +type ChatBoostSlot struct { + meta + // Unique identifier of the slot + SlotId int32 `json:"slot_id"` + // Identifier of the currently boosted chat; 0 if none + CurrentlyBoostedChatId int64 `json:"currently_boosted_chat_id"` + // Point in time (Unix timestamp) when the chat was boosted; 0 if none + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the boost will expire + ExpirationDate int32 `json:"expiration_date"` + // Point in time (Unix timestamp) after which the boost can be used for another chat + CooldownUntilDate int32 `json:"cooldown_until_date"` +} + +func (entity *ChatBoostSlot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSlot + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSlot) GetClass() string { + return ClassChatBoostSlot +} + +func (*ChatBoostSlot) GetType() string { + return TypeChatBoostSlot +} + +// Contains a list of chat boost slots +type ChatBoostSlots struct { + meta + // List of boost slots + Slots []*ChatBoostSlot `json:"slots"` +} + +func (entity *ChatBoostSlots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSlots + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSlots) GetClass() string { + return ClassChatBoostSlots +} + +func (*ChatBoostSlots) GetType() string { + return TypeChatBoostSlots +} + // The call wasn't discarded, or the reason is unknown type CallDiscardReasonEmpty struct { meta @@ -17802,7 +24781,7 @@ type CallProtocol struct { UdpReflector bool `json:"udp_reflector"` // The minimum supported API layer; use 65 MinLayer int32 `json:"min_layer"` - // The maximum supported API layer; use 65 + // The maximum supported API layer; use 92 MaxLayer int32 `json:"max_layer"` // List of supported tgcalls versions LibraryVersions []string `json:"library_versions"` @@ -17829,6 +24808,8 @@ type CallServerTypeTelegramReflector struct { meta // A peer tag to be used with the reflector PeerTag []byte `json:"peer_tag"` + // True, if the server uses TCP instead of UDP + IsTcp bool `json:"is_tcp"` } func (entity *CallServerTypeTelegramReflector) MarshalJSON() ([]byte, error) { @@ -18105,12 +25086,14 @@ func (*CallStateHangingUp) CallStateType() string { // The call has ended successfully type CallStateDiscarded struct { meta - // The reason, why the call has ended + // The reason why the call has ended Reason CallDiscardReason `json:"reason"` // True, if the call rating must be sent to the server NeedRating bool `json:"need_rating"` // True, if the call debug information must be sent to the server NeedDebugInformation bool `json:"need_debug_information"` + // True, if the call log must be sent to the server + NeedLog bool `json:"need_log"` } func (entity *CallStateDiscarded) MarshalJSON() ([]byte, error) { @@ -18138,6 +25121,7 @@ func (callStateDiscarded *CallStateDiscarded) UnmarshalJSON(data []byte) error { Reason json.RawMessage `json:"reason"` NeedRating bool `json:"need_rating"` NeedDebugInformation bool `json:"need_debug_information"` + NeedLog bool `json:"need_log"` } err := json.Unmarshal(data, &tmp) @@ -18147,6 +25131,7 @@ func (callStateDiscarded *CallStateDiscarded) UnmarshalJSON(data []byte) error { callStateDiscarded.NeedRating = tmp.NeedRating callStateDiscarded.NeedDebugInformation = tmp.NeedDebugInformation + callStateDiscarded.NeedLog = tmp.NeedLog fieldReason, _ := UnmarshalCallDiscardReason(tmp.Reason) callStateDiscarded.Reason = fieldReason @@ -18256,6 +25241,81 @@ func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string { return TypeGroupCallVideoQualityFull } +// Describes an available stream in a group call +type GroupCallStream struct { + meta + // Identifier of an audio/video channel + ChannelId int32 `json:"channel_id"` + // Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds + Scale int32 `json:"scale"` + // Point in time when the stream currently ends; Unix timestamp in milliseconds + TimeOffset int64 `json:"time_offset"` +} + +func (entity *GroupCallStream) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallStream + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallStream) GetClass() string { + return ClassGroupCallStream +} + +func (*GroupCallStream) GetType() string { + return TypeGroupCallStream +} + +// Represents a list of group call streams +type GroupCallStreams struct { + meta + // A list of group call streams + Streams []*GroupCallStream `json:"streams"` +} + +func (entity *GroupCallStreams) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallStreams + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallStreams) GetClass() string { + return ClassGroupCallStreams +} + +func (*GroupCallStreams) GetType() string { + return TypeGroupCallStreams +} + +// Represents an RTMP URL +type RtmpUrl struct { + meta + // The URL + Url string `json:"url"` + // Stream key + StreamKey string `json:"stream_key"` +} + +func (entity *RtmpUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RtmpUrl + + return json.Marshal((*stub)(entity)) +} + +func (*RtmpUrl) GetClass() string { + return ClassRtmpUrl +} + +func (*RtmpUrl) GetType() string { + return TypeRtmpUrl +} + // Describes a recently speaking participant in a group call type GroupCallRecentSpeaker struct { meta @@ -18313,6 +25373,8 @@ type GroupCall struct { EnabledStartNotification bool `json:"enabled_start_notification"` // True, if the call is active IsActive bool `json:"is_active"` + // True, if the chat is an RTMP stream instead of an ordinary video chat + IsRtmpStream bool `json:"is_rtmp_stream"` // True, if the call is joined IsJoined bool `json:"is_joined"` // True, if user was kicked from the call because of network loss and the call needs to be rejoined @@ -18321,6 +25383,8 @@ type GroupCall struct { CanBeManaged bool `json:"can_be_managed"` // Number of participants in the group call ParticipantCount int32 `json:"participant_count"` + // True, if group call participants, which are muted, aren't returned in participant list + HasHiddenListeners bool `json:"has_hidden_listeners"` // True, if all group call participants are loaded LoadedAllParticipants bool `json:"loaded_all_participants"` // At most 3 recently speaking users in the group call @@ -18391,7 +25455,7 @@ type GroupCallParticipantVideoInfo struct { SourceGroups []*GroupCallVideoSourceGroup `json:"source_groups"` // Video channel endpoint identifier EndpointId string `json:"endpoint_id"` - // True if the video is paused. This flag needs to be ignored, if new video frames are received + // True, if the video is paused. This flag needs to be ignored, if new video frames are received IsPaused bool `json:"is_paused"` } @@ -18800,6 +25864,60 @@ func (call *Call) UnmarshalJSON(data []byte) error { return nil } +// Settings for Firebase Authentication in the official Android application +type FirebaseAuthenticationSettingsAndroid struct { + meta +} + +func (entity *FirebaseAuthenticationSettingsAndroid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FirebaseAuthenticationSettingsAndroid + + return json.Marshal((*stub)(entity)) +} + +func (*FirebaseAuthenticationSettingsAndroid) GetClass() string { + return ClassFirebaseAuthenticationSettings +} + +func (*FirebaseAuthenticationSettingsAndroid) GetType() string { + return TypeFirebaseAuthenticationSettingsAndroid +} + +func (*FirebaseAuthenticationSettingsAndroid) FirebaseAuthenticationSettingsType() string { + return TypeFirebaseAuthenticationSettingsAndroid +} + +// Settings for Firebase Authentication in the official iOS application +type FirebaseAuthenticationSettingsIos struct { + meta + // Device token from Apple Push Notification service + DeviceToken string `json:"device_token"` + // True, if App Sandbox is enabled + IsAppSandbox bool `json:"is_app_sandbox"` +} + +func (entity *FirebaseAuthenticationSettingsIos) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FirebaseAuthenticationSettingsIos + + return json.Marshal((*stub)(entity)) +} + +func (*FirebaseAuthenticationSettingsIos) GetClass() string { + return ClassFirebaseAuthenticationSettings +} + +func (*FirebaseAuthenticationSettingsIos) GetType() string { + return TypeFirebaseAuthenticationSettingsIos +} + +func (*FirebaseAuthenticationSettingsIos) FirebaseAuthenticationSettingsType() string { + return TypeFirebaseAuthenticationSettingsIos +} + // Contains settings for the authentication of the user's phone number type PhoneNumberAuthenticationSettings struct { meta @@ -18811,6 +25929,8 @@ type PhoneNumberAuthenticationSettings struct { IsCurrentPhoneNumber bool `json:"is_current_phone_number"` // For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details AllowSmsRetrieverApi bool `json:"allow_sms_retriever_api"` + // For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication + FirebaseAuthenticationSettings FirebaseAuthenticationSettings `json:"firebase_authentication_settings"` // List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions AuthenticationTokens []string `json:"authentication_tokens"` } @@ -18831,6 +25951,228 @@ func (*PhoneNumberAuthenticationSettings) GetType() string { return TypePhoneNumberAuthenticationSettings } +func (phoneNumberAuthenticationSettings *PhoneNumberAuthenticationSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + AllowFlashCall bool `json:"allow_flash_call"` + AllowMissedCall bool `json:"allow_missed_call"` + IsCurrentPhoneNumber bool `json:"is_current_phone_number"` + AllowSmsRetrieverApi bool `json:"allow_sms_retriever_api"` + FirebaseAuthenticationSettings json.RawMessage `json:"firebase_authentication_settings"` + AuthenticationTokens []string `json:"authentication_tokens"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + phoneNumberAuthenticationSettings.AllowFlashCall = tmp.AllowFlashCall + phoneNumberAuthenticationSettings.AllowMissedCall = tmp.AllowMissedCall + phoneNumberAuthenticationSettings.IsCurrentPhoneNumber = tmp.IsCurrentPhoneNumber + phoneNumberAuthenticationSettings.AllowSmsRetrieverApi = tmp.AllowSmsRetrieverApi + phoneNumberAuthenticationSettings.AuthenticationTokens = tmp.AuthenticationTokens + + fieldFirebaseAuthenticationSettings, _ := UnmarshalFirebaseAuthenticationSettings(tmp.FirebaseAuthenticationSettings) + phoneNumberAuthenticationSettings.FirebaseAuthenticationSettings = fieldFirebaseAuthenticationSettings + + return nil +} + +// Represents a reaction applied to a message +type AddedReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // Identifier of the chat member, applied the reaction + SenderId MessageSender `json:"sender_id"` + // True, if the reaction was added by the current user + IsOutgoing bool `json:"is_outgoing"` + // Point in time (Unix timestamp) when the reaction was added + Date int32 `json:"date"` +} + +func (entity *AddedReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AddedReaction + + return json.Marshal((*stub)(entity)) +} + +func (*AddedReaction) GetClass() string { + return ClassAddedReaction +} + +func (*AddedReaction) GetType() string { + return TypeAddedReaction +} + +func (addedReaction *AddedReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + SenderId json.RawMessage `json:"sender_id"` + IsOutgoing bool `json:"is_outgoing"` + Date int32 `json:"date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + addedReaction.IsOutgoing = tmp.IsOutgoing + addedReaction.Date = tmp.Date + + fieldType, _ := UnmarshalReactionType(tmp.Type) + addedReaction.Type = fieldType + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + addedReaction.SenderId = fieldSenderId + + return nil +} + +// Represents a list of reactions added to a message +type AddedReactions struct { + meta + // The total number of found reactions + TotalCount int32 `json:"total_count"` + // The list of added reactions + Reactions []*AddedReaction `json:"reactions"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *AddedReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AddedReactions + + return json.Marshal((*stub)(entity)) +} + +func (*AddedReactions) GetClass() string { + return ClassAddedReactions +} + +func (*AddedReactions) GetType() string { + return TypeAddedReactions +} + +// Represents an available reaction +type AvailableReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // True, if Telegram Premium is needed to send the reaction + NeedsPremium bool `json:"needs_premium"` +} + +func (entity *AvailableReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AvailableReaction + + return json.Marshal((*stub)(entity)) +} + +func (*AvailableReaction) GetClass() string { + return ClassAvailableReaction +} + +func (*AvailableReaction) GetType() string { + return TypeAvailableReaction +} + +func (availableReaction *AvailableReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + NeedsPremium bool `json:"needs_premium"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + availableReaction.NeedsPremium = tmp.NeedsPremium + + fieldType, _ := UnmarshalReactionType(tmp.Type) + availableReaction.Type = fieldType + + return nil +} + +// Represents a list of reactions that can be added to a message +type AvailableReactions struct { + meta + // List of reactions to be shown at the top + TopReactions []*AvailableReaction `json:"top_reactions"` + // List of recently used reactions + RecentReactions []*AvailableReaction `json:"recent_reactions"` + // List of popular reactions + PopularReactions []*AvailableReaction `json:"popular_reactions"` + // True, if custom emoji reactions could be added by Telegram Premium subscribers + AllowCustomEmoji bool `json:"allow_custom_emoji"` +} + +func (entity *AvailableReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AvailableReactions + + return json.Marshal((*stub)(entity)) +} + +func (*AvailableReactions) GetClass() string { + return ClassAvailableReactions +} + +func (*AvailableReactions) GetType() string { + return TypeAvailableReactions +} + +// Contains information about a emoji reaction +type EmojiReaction struct { + meta + // Text representation of the reaction + Emoji string `json:"emoji"` + // Reaction title + Title string `json:"title"` + // True, if the reaction can be added to new messages and enabled in chats + IsActive bool `json:"is_active"` + // Static icon for the reaction + StaticIcon *Sticker `json:"static_icon"` + // Appear animation for the reaction + AppearAnimation *Sticker `json:"appear_animation"` + // Select animation for the reaction + SelectAnimation *Sticker `json:"select_animation"` + // Activate animation for the reaction + ActivateAnimation *Sticker `json:"activate_animation"` + // Effect animation for the reaction + EffectAnimation *Sticker `json:"effect_animation"` + // Around animation for the reaction; may be null + AroundAnimation *Sticker `json:"around_animation"` + // Center animation for the reaction; may be null + CenterAnimation *Sticker `json:"center_animation"` +} + +func (entity *EmojiReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiReaction + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiReaction) GetClass() string { + return ClassEmojiReaction +} + +func (*EmojiReaction) GetType() string { + return TypeEmojiReaction +} + // Represents a list of animations type Animations struct { meta @@ -18916,7 +26258,7 @@ func (*DiceStickersSlotMachine) DiceStickersType() string { return TypeDiceStickersSlotMachine } -// Represents the result of an ImportContacts request +// Represents the result of an importContacts request type ImportedContacts struct { meta // User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user @@ -18941,6 +26283,306 @@ func (*ImportedContacts) GetType() string { return TypeImportedContacts } +// The speech recognition is ongoing +type SpeechRecognitionResultPending struct { + meta + // Partially recognized text + PartialText string `json:"partial_text"` +} + +func (entity *SpeechRecognitionResultPending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SpeechRecognitionResultPending + + return json.Marshal((*stub)(entity)) +} + +func (*SpeechRecognitionResultPending) GetClass() string { + return ClassSpeechRecognitionResult +} + +func (*SpeechRecognitionResultPending) GetType() string { + return TypeSpeechRecognitionResultPending +} + +func (*SpeechRecognitionResultPending) SpeechRecognitionResultType() string { + return TypeSpeechRecognitionResultPending +} + +// The speech recognition successfully finished +type SpeechRecognitionResultText struct { + meta + // Recognized text + Text string `json:"text"` +} + +func (entity *SpeechRecognitionResultText) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SpeechRecognitionResultText + + return json.Marshal((*stub)(entity)) +} + +func (*SpeechRecognitionResultText) GetClass() string { + return ClassSpeechRecognitionResult +} + +func (*SpeechRecognitionResultText) GetType() string { + return TypeSpeechRecognitionResultText +} + +func (*SpeechRecognitionResultText) SpeechRecognitionResultType() string { + return TypeSpeechRecognitionResultText +} + +// The speech recognition failed +type SpeechRecognitionResultError struct { + meta + // Recognition error + Error *Error `json:"error"` +} + +func (entity *SpeechRecognitionResultError) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SpeechRecognitionResultError + + return json.Marshal((*stub)(entity)) +} + +func (*SpeechRecognitionResultError) GetClass() string { + return ClassSpeechRecognitionResult +} + +func (*SpeechRecognitionResultError) GetType() string { + return TypeSpeechRecognitionResultError +} + +func (*SpeechRecognitionResultError) SpeechRecognitionResultType() string { + return TypeSpeechRecognitionResultError +} + +// Describes a color to highlight a bot added to attachment menu +type AttachmentMenuBotColor struct { + meta + // Color in the RGB24 format for light themes + LightColor int32 `json:"light_color"` + // Color in the RGB24 format for dark themes + DarkColor int32 `json:"dark_color"` +} + +func (entity *AttachmentMenuBotColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AttachmentMenuBotColor + + return json.Marshal((*stub)(entity)) +} + +func (*AttachmentMenuBotColor) GetClass() string { + return ClassAttachmentMenuBotColor +} + +func (*AttachmentMenuBotColor) GetType() string { + return TypeAttachmentMenuBotColor +} + +// Represents a bot, which can be added to attachment or side menu +type AttachmentMenuBot struct { + meta + // User identifier of the bot + BotUserId int64 `json:"bot_user_id"` + // True, if the bot supports opening from attachment menu in the chat with the bot + SupportsSelfChat bool `json:"supports_self_chat"` + // True, if the bot supports opening from attachment menu in private chats with ordinary users + SupportsUserChats bool `json:"supports_user_chats"` + // True, if the bot supports opening from attachment menu in private chats with other bots + SupportsBotChats bool `json:"supports_bot_chats"` + // True, if the bot supports opening from attachment menu in basic group and supergroup chats + SupportsGroupChats bool `json:"supports_group_chats"` + // True, if the bot supports opening from attachment menu in channel chats + SupportsChannelChats bool `json:"supports_channel_chats"` + // True, if the user must be asked for the permission to send messages to the bot + RequestWriteAccess bool `json:"request_write_access"` + // True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed + IsAdded bool `json:"is_added"` + // True, if the bot must be shown in the attachment menu + ShowInAttachmentMenu bool `json:"show_in_attachment_menu"` + // True, if the bot must be shown in the side menu + ShowInSideMenu bool `json:"show_in_side_menu"` + // True, if a disclaimer, why the bot is shown in the side menu, is needed + ShowDisclaimerInSideMenu bool `json:"show_disclaimer_in_side_menu"` + // Name for the bot in attachment menu + Name string `json:"name"` + // Color to highlight selected name of the bot if appropriate; may be null + NameColor *AttachmentMenuBotColor `json:"name_color"` + // Default icon for the bot in SVG format; may be null + DefaultIcon *File `json:"default_icon"` + // Icon for the bot in SVG format for the official iOS app; may be null + IosStaticIcon *File `json:"ios_static_icon"` + // Icon for the bot in TGS format for the official iOS app; may be null + IosAnimatedIcon *File `json:"ios_animated_icon"` + // Icon for the bot in PNG format for the official iOS app side menu; may be null + IosSideMenuIcon *File `json:"ios_side_menu_icon"` + // Icon for the bot in TGS format for the official Android app; may be null + AndroidIcon *File `json:"android_icon"` + // Icon for the bot in SVG format for the official Android app side menu; may be null + AndroidSideMenuIcon *File `json:"android_side_menu_icon"` + // Icon for the bot in TGS format for the official native macOS app; may be null + MacosIcon *File `json:"macos_icon"` + // Icon for the bot in PNG format for the official macOS app side menu; may be null + MacosSideMenuIcon *File `json:"macos_side_menu_icon"` + // Color to highlight selected icon of the bot if appropriate; may be null + IconColor *AttachmentMenuBotColor `json:"icon_color"` + // Default placeholder for opened Web Apps in SVG format; may be null + WebAppPlaceholder *File `json:"web_app_placeholder"` +} + +func (entity *AttachmentMenuBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AttachmentMenuBot + + return json.Marshal((*stub)(entity)) +} + +func (*AttachmentMenuBot) GetClass() string { + return ClassAttachmentMenuBot +} + +func (*AttachmentMenuBot) GetType() string { + return TypeAttachmentMenuBot +} + +// Information about the message sent by answerWebAppQuery +type SentWebAppMessage struct { + meta + // Identifier of the sent inline message, if known + InlineMessageId string `json:"inline_message_id"` +} + +func (entity *SentWebAppMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SentWebAppMessage + + return json.Marshal((*stub)(entity)) +} + +func (*SentWebAppMessage) GetClass() string { + return ClassSentWebAppMessage +} + +func (*SentWebAppMessage) GetType() string { + return TypeSentWebAppMessage +} + +// The user connected a website by logging in using Telegram Login Widget on it +type BotWriteAccessAllowReasonConnectedWebsite struct { + meta + // Domain name of the connected website + DomainName string `json:"domain_name"` +} + +func (entity *BotWriteAccessAllowReasonConnectedWebsite) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonConnectedWebsite + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonConnectedWebsite) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonConnectedWebsite) GetType() string { + return TypeBotWriteAccessAllowReasonConnectedWebsite +} + +func (*BotWriteAccessAllowReasonConnectedWebsite) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonConnectedWebsite +} + +// The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu +type BotWriteAccessAllowReasonAddedToAttachmentMenu struct { + meta +} + +func (entity *BotWriteAccessAllowReasonAddedToAttachmentMenu) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonAddedToAttachmentMenu + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonAddedToAttachmentMenu) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonAddedToAttachmentMenu) GetType() string { + return TypeBotWriteAccessAllowReasonAddedToAttachmentMenu +} + +func (*BotWriteAccessAllowReasonAddedToAttachmentMenu) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonAddedToAttachmentMenu +} + +// The user launched a Web App using getWebAppLinkUrl +type BotWriteAccessAllowReasonLaunchedWebApp struct { + meta + // Information about the Web App + WebApp *WebApp `json:"web_app"` +} + +func (entity *BotWriteAccessAllowReasonLaunchedWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonLaunchedWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonLaunchedWebApp) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonLaunchedWebApp) GetType() string { + return TypeBotWriteAccessAllowReasonLaunchedWebApp +} + +func (*BotWriteAccessAllowReasonLaunchedWebApp) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonLaunchedWebApp +} + +// The user accepted bot's request to send messages with allowBotToSendMessages +type BotWriteAccessAllowReasonAcceptedRequest struct { + meta +} + +func (entity *BotWriteAccessAllowReasonAcceptedRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonAcceptedRequest + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonAcceptedRequest) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonAcceptedRequest) GetType() string { + return TypeBotWriteAccessAllowReasonAcceptedRequest +} + +func (*BotWriteAccessAllowReasonAcceptedRequest) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonAcceptedRequest +} + // Contains an HTTP URL type HttpUrl struct { meta @@ -18964,6 +26606,31 @@ func (*HttpUrl) GetType() string { return TypeHttpUrl } +// Contains an HTTPS URL, which can be used to get information about a user +type UserLink struct { + meta + // The URL + Url string `json:"url"` + // Left time for which the link is valid, in seconds; 0 if the link is a public username link + ExpiresIn int32 `json:"expires_in"` +} + +func (entity *UserLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserLink + + return json.Marshal((*stub)(entity)) +} + +func (*UserLink) GetClass() string { + return ClassUserLink +} + +func (*UserLink) GetType() string { + return TypeUserLink +} + // Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video type InputInlineQueryResultAnimation struct { meta @@ -19562,14 +27229,14 @@ func (inputInlineQueryResultPhoto *InputInlineQueryResultPhoto) UnmarshalJSON(da return nil } -// Represents a link to a WEBP or TGS sticker +// Represents a link to a WEBP, TGS, or WEBM sticker type InputInlineQueryResultSticker struct { meta // Unique identifier of the query result Id string `json:"id"` // URL of the sticker thumbnail, if it exists ThumbnailUrl string `json:"thumbnail_url"` - // The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB) + // The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB) StickerUrl string `json:"sticker_url"` // Width of the sticker StickerWidth int32 `json:"sticker_width"` @@ -20234,19 +27901,115 @@ func (*InlineQueryResultVoiceNote) InlineQueryResultType() string { return TypeInlineQueryResultVoiceNote } +// Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter +type InlineQueryResultsButtonTypeStartBot struct { + meta + // The parameter for the bot start message + Parameter string `json:"parameter"` +} + +func (entity *InlineQueryResultsButtonTypeStartBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultsButtonTypeStartBot + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultsButtonTypeStartBot) GetClass() string { + return ClassInlineQueryResultsButtonType +} + +func (*InlineQueryResultsButtonTypeStartBot) GetType() string { + return TypeInlineQueryResultsButtonTypeStartBot +} + +func (*InlineQueryResultsButtonTypeStartBot) InlineQueryResultsButtonTypeType() string { + return TypeInlineQueryResultsButtonTypeStartBot +} + +// Describes the button that opens a Web App by calling getWebAppUrl +type InlineQueryResultsButtonTypeWebApp struct { + meta + // An HTTP URL to pass to getWebAppUrl + Url string `json:"url"` +} + +func (entity *InlineQueryResultsButtonTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultsButtonTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultsButtonTypeWebApp) GetClass() string { + return ClassInlineQueryResultsButtonType +} + +func (*InlineQueryResultsButtonTypeWebApp) GetType() string { + return TypeInlineQueryResultsButtonTypeWebApp +} + +func (*InlineQueryResultsButtonTypeWebApp) InlineQueryResultsButtonTypeType() string { + return TypeInlineQueryResultsButtonTypeWebApp +} + +// Represents a button to be shown above inline query results +type InlineQueryResultsButton struct { + meta + // The text of the button + Text string `json:"text"` + // Type of the button + Type InlineQueryResultsButtonType `json:"type"` +} + +func (entity *InlineQueryResultsButton) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultsButton + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultsButton) GetClass() string { + return ClassInlineQueryResultsButton +} + +func (*InlineQueryResultsButton) GetType() string { + return TypeInlineQueryResultsButton +} + +func (inlineQueryResultsButton *InlineQueryResultsButton) UnmarshalJSON(data []byte) error { + var tmp struct { + Text string `json:"text"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inlineQueryResultsButton.Text = tmp.Text + + fieldType, _ := UnmarshalInlineQueryResultsButtonType(tmp.Type) + inlineQueryResultsButton.Type = fieldType + + return nil +} + // Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query type InlineQueryResults struct { meta // Unique identifier of the inline query InlineQueryId JsonInt64 `json:"inline_query_id"` - // The offset for the next request. If empty, there are no more results - NextOffset string `json:"next_offset"` + // Button to be shown above inline query results; may be null + Button *InlineQueryResultsButton `json:"button"` // Results of the query Results []InlineQueryResult `json:"results"` - // If non-empty, this text must be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter - SwitchPmText string `json:"switch_pm_text"` - // Parameter for the bot start message - SwitchPmParameter string `json:"switch_pm_parameter"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` } func (entity *InlineQueryResults) MarshalJSON() ([]byte, error) { @@ -20267,11 +28030,10 @@ func (*InlineQueryResults) GetType() string { func (inlineQueryResults *InlineQueryResults) UnmarshalJSON(data []byte) error { var tmp struct { - InlineQueryId JsonInt64 `json:"inline_query_id"` - NextOffset string `json:"next_offset"` - Results []json.RawMessage `json:"results"` - SwitchPmText string `json:"switch_pm_text"` - SwitchPmParameter string `json:"switch_pm_parameter"` + InlineQueryId JsonInt64 `json:"inline_query_id"` + Button *InlineQueryResultsButton `json:"button"` + Results []json.RawMessage `json:"results"` + NextOffset string `json:"next_offset"` } err := json.Unmarshal(data, &tmp) @@ -20280,9 +28042,8 @@ func (inlineQueryResults *InlineQueryResults) UnmarshalJSON(data []byte) error { } inlineQueryResults.InlineQueryId = tmp.InlineQueryId + inlineQueryResults.Button = tmp.Button inlineQueryResults.NextOffset = tmp.NextOffset - inlineQueryResults.SwitchPmText = tmp.SwitchPmText - inlineQueryResults.SwitchPmParameter = tmp.SwitchPmParameter fieldResults, _ := UnmarshalListOfInlineQueryResult(tmp.Results) inlineQueryResults.Results = fieldResults @@ -20320,7 +28081,7 @@ func (*CallbackQueryPayloadData) CallbackQueryPayloadType() string { // The payload for a callback button requiring password type CallbackQueryPayloadDataWithPassword struct { meta - // The password for the current user + // The 2-step verification password for the current user Password string `json:"password"` // Data that was attached to the callback button Data []byte `json:"data"` @@ -20507,6 +28268,8 @@ type ChatEventMessageDeleted struct { meta // Deleted message Message *Message `json:"message"` + // True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive + CanReportAntiSpamFalsePositive bool `json:"can_report_anti_spam_false_positive"` } func (entity *ChatEventMessageDeleted) MarshalJSON() ([]byte, error) { @@ -20529,33 +28292,6 @@ func (*ChatEventMessageDeleted) ChatEventActionType() string { return TypeChatEventMessageDeleted } -// A poll in a message was stopped -type ChatEventPollStopped struct { - meta - // The message with the poll - Message *Message `json:"message"` -} - -func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPollStopped - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPollStopped) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPollStopped) GetType() string { - return TypeChatEventPollStopped -} - -func (*ChatEventPollStopped) ChatEventActionType() string { - return TypeChatEventPollStopped -} - // A message was pinned type ChatEventMessagePinned struct { meta @@ -20610,6 +28346,33 @@ func (*ChatEventMessageUnpinned) ChatEventActionType() string { return TypeChatEventMessageUnpinned } +// A poll in a message was stopped +type ChatEventPollStopped struct { + meta + // The message with the poll + Message *Message `json:"message"` +} + +func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPollStopped + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPollStopped) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPollStopped) GetType() string { + return TypeChatEventPollStopped +} + +func (*ChatEventPollStopped) ChatEventActionType() string { + return TypeChatEventPollStopped +} + // A new member joined the chat type ChatEventMemberJoined struct { meta @@ -20640,6 +28403,8 @@ type ChatEventMemberJoinedByInviteLink struct { meta // Invite link used to join the chat InviteLink *ChatInviteLink `json:"invite_link"` + // True, if the user has joined the chat using an invite link for a chat folder + ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link"` } func (entity *ChatEventMemberJoinedByInviteLink) MarshalJSON() ([]byte, error) { @@ -20691,31 +28456,6 @@ func (*ChatEventMemberJoinedByRequest) ChatEventActionType() string { return TypeChatEventMemberJoinedByRequest } -// A member left the chat -type ChatEventMemberLeft struct { - meta -} - -func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberLeft - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberLeft) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberLeft) GetType() string { - return TypeChatEventMemberLeft -} - -func (*ChatEventMemberLeft) ChatEventActionType() string { - return TypeChatEventMemberLeft -} - // A new chat member was invited type ChatEventMemberInvited struct { meta @@ -20764,6 +28504,31 @@ func (chatEventMemberInvited *ChatEventMemberInvited) UnmarshalJSON(data []byte) return nil } +// A member left the chat +type ChatEventMemberLeft struct { + meta +} + +func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberLeft + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberLeft) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberLeft) GetType() string { + return TypeChatEventMemberLeft +} + +func (*ChatEventMemberLeft) ChatEventActionType() string { + return TypeChatEventMemberLeft +} + // A chat member has gained/lost administrator status, or the list of their administrator privileges has changed type ChatEventMemberPromoted struct { meta @@ -20873,62 +28638,53 @@ func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data [ return nil } -// The chat title was changed -type ChatEventTitleChanged struct { +// The chat available reactions were changed +type ChatEventAvailableReactionsChanged struct { meta - // Previous chat title - OldTitle string `json:"old_title"` - // New chat title - NewTitle string `json:"new_title"` + // Previous chat available reactions + OldAvailableReactions ChatAvailableReactions `json:"old_available_reactions"` + // New chat available reactions + NewAvailableReactions ChatAvailableReactions `json:"new_available_reactions"` } -func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) { +func (entity *ChatEventAvailableReactionsChanged) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventTitleChanged + type stub ChatEventAvailableReactionsChanged return json.Marshal((*stub)(entity)) } -func (*ChatEventTitleChanged) GetClass() string { +func (*ChatEventAvailableReactionsChanged) GetClass() string { return ClassChatEventAction } -func (*ChatEventTitleChanged) GetType() string { - return TypeChatEventTitleChanged +func (*ChatEventAvailableReactionsChanged) GetType() string { + return TypeChatEventAvailableReactionsChanged } -func (*ChatEventTitleChanged) ChatEventActionType() string { - return TypeChatEventTitleChanged +func (*ChatEventAvailableReactionsChanged) ChatEventActionType() string { + return TypeChatEventAvailableReactionsChanged } -// The chat permissions was changed -type ChatEventPermissionsChanged struct { - meta - // Previous chat permissions - OldPermissions *ChatPermissions `json:"old_permissions"` - // New chat permissions - NewPermissions *ChatPermissions `json:"new_permissions"` -} +func (chatEventAvailableReactionsChanged *ChatEventAvailableReactionsChanged) UnmarshalJSON(data []byte) error { + var tmp struct { + OldAvailableReactions json.RawMessage `json:"old_available_reactions"` + NewAvailableReactions json.RawMessage `json:"new_available_reactions"` + } -func (entity *ChatEventPermissionsChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - type stub ChatEventPermissionsChanged + fieldOldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.OldAvailableReactions) + chatEventAvailableReactionsChanged.OldAvailableReactions = fieldOldAvailableReactions - return json.Marshal((*stub)(entity)) -} + fieldNewAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.NewAvailableReactions) + chatEventAvailableReactionsChanged.NewAvailableReactions = fieldNewAvailableReactions -func (*ChatEventPermissionsChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPermissionsChanged) GetType() string { - return TypeChatEventPermissionsChanged -} - -func (*ChatEventPermissionsChanged) ChatEventActionType() string { - return TypeChatEventPermissionsChanged + return nil } // The chat description was changed @@ -20960,91 +28716,6 @@ func (*ChatEventDescriptionChanged) ChatEventActionType() string { return TypeChatEventDescriptionChanged } -// The chat username was changed -type ChatEventUsernameChanged struct { - meta - // Previous chat username - OldUsername string `json:"old_username"` - // New chat username - NewUsername string `json:"new_username"` -} - -func (entity *ChatEventUsernameChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventUsernameChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventUsernameChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventUsernameChanged) GetType() string { - return TypeChatEventUsernameChanged -} - -func (*ChatEventUsernameChanged) ChatEventActionType() string { - return TypeChatEventUsernameChanged -} - -// The chat photo was changed -type ChatEventPhotoChanged struct { - meta - // Previous chat photo value; may be null - OldPhoto *ChatPhoto `json:"old_photo"` - // New chat photo value; may be null - NewPhoto *ChatPhoto `json:"new_photo"` -} - -func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPhotoChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPhotoChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPhotoChanged) GetType() string { - return TypeChatEventPhotoChanged -} - -func (*ChatEventPhotoChanged) ChatEventActionType() string { - return TypeChatEventPhotoChanged -} - -// The can_invite_users permission of a supergroup chat was toggled -type ChatEventInvitesToggled struct { - meta - // New value of can_invite_users permission - CanInviteUsers bool `json:"can_invite_users"` -} - -func (entity *ChatEventInvitesToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventInvitesToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventInvitesToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventInvitesToggled) GetType() string { - return TypeChatEventInvitesToggled -} - -func (*ChatEventInvitesToggled) ChatEventActionType() string { - return TypeChatEventInvitesToggled -} - // The linked chat of a supergroup was changed type ChatEventLinkedChatChanged struct { meta @@ -21074,147 +28745,6 @@ func (*ChatEventLinkedChatChanged) ChatEventActionType() string { return TypeChatEventLinkedChatChanged } -// The slow_mode_delay setting of a supergroup was changed -type ChatEventSlowModeDelayChanged struct { - meta - // Previous value of slow_mode_delay, in seconds - OldSlowModeDelay int32 `json:"old_slow_mode_delay"` - // New value of slow_mode_delay, in seconds - NewSlowModeDelay int32 `json:"new_slow_mode_delay"` -} - -func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventSlowModeDelayChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventSlowModeDelayChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventSlowModeDelayChanged) GetType() string { - return TypeChatEventSlowModeDelayChanged -} - -func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { - return TypeChatEventSlowModeDelayChanged -} - -// The message TTL was changed -type ChatEventMessageTtlChanged struct { - meta - // Previous value of message_ttl - OldMessageTtl int32 `json:"old_message_ttl"` - // New value of message_ttl - NewMessageTtl int32 `json:"new_message_ttl"` -} - -func (entity *ChatEventMessageTtlChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMessageTtlChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMessageTtlChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMessageTtlChanged) GetType() string { - return TypeChatEventMessageTtlChanged -} - -func (*ChatEventMessageTtlChanged) ChatEventActionType() string { - return TypeChatEventMessageTtlChanged -} - -// The sign_messages setting of a channel was toggled -type ChatEventSignMessagesToggled struct { - meta - // New value of sign_messages - SignMessages bool `json:"sign_messages"` -} - -func (entity *ChatEventSignMessagesToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventSignMessagesToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventSignMessagesToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventSignMessagesToggled) GetType() string { - return TypeChatEventSignMessagesToggled -} - -func (*ChatEventSignMessagesToggled) ChatEventActionType() string { - return TypeChatEventSignMessagesToggled -} - -// The has_protected_content setting of a channel was toggled -type ChatEventHasProtectedContentToggled struct { - meta - // New value of has_protected_content - HasProtectedContent bool `json:"has_protected_content"` -} - -func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventHasProtectedContentToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventHasProtectedContentToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventHasProtectedContentToggled) GetType() string { - return TypeChatEventHasProtectedContentToggled -} - -func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { - return TypeChatEventHasProtectedContentToggled -} - -// The supergroup sticker set was changed -type ChatEventStickerSetChanged struct { - meta - // Previous identifier of the chat sticker set; 0 if none - OldStickerSetId JsonInt64 `json:"old_sticker_set_id"` - // New identifier of the chat sticker set; 0 if none - NewStickerSetId JsonInt64 `json:"new_sticker_set_id"` -} - -func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventStickerSetChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventStickerSetChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventStickerSetChanged) GetType() string { - return TypeChatEventStickerSetChanged -} - -func (*ChatEventStickerSetChanged) ChatEventActionType() string { - return TypeChatEventStickerSetChanged -} - // The supergroup location was changed type ChatEventLocationChanged struct { meta @@ -21244,6 +28774,350 @@ func (*ChatEventLocationChanged) ChatEventActionType() string { return TypeChatEventLocationChanged } +// The message auto-delete timer was changed +type ChatEventMessageAutoDeleteTimeChanged struct { + meta + // Previous value of message_auto_delete_time + OldMessageAutoDeleteTime int32 `json:"old_message_auto_delete_time"` + // New value of message_auto_delete_time + NewMessageAutoDeleteTime int32 `json:"new_message_auto_delete_time"` +} + +func (entity *ChatEventMessageAutoDeleteTimeChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMessageAutoDeleteTimeChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMessageAutoDeleteTimeChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMessageAutoDeleteTimeChanged) GetType() string { + return TypeChatEventMessageAutoDeleteTimeChanged +} + +func (*ChatEventMessageAutoDeleteTimeChanged) ChatEventActionType() string { + return TypeChatEventMessageAutoDeleteTimeChanged +} + +// The chat permissions was changed +type ChatEventPermissionsChanged struct { + meta + // Previous chat permissions + OldPermissions *ChatPermissions `json:"old_permissions"` + // New chat permissions + NewPermissions *ChatPermissions `json:"new_permissions"` +} + +func (entity *ChatEventPermissionsChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPermissionsChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPermissionsChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPermissionsChanged) GetType() string { + return TypeChatEventPermissionsChanged +} + +func (*ChatEventPermissionsChanged) ChatEventActionType() string { + return TypeChatEventPermissionsChanged +} + +// The chat photo was changed +type ChatEventPhotoChanged struct { + meta + // Previous chat photo value; may be null + OldPhoto *ChatPhoto `json:"old_photo"` + // New chat photo value; may be null + NewPhoto *ChatPhoto `json:"new_photo"` +} + +func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPhotoChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPhotoChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPhotoChanged) GetType() string { + return TypeChatEventPhotoChanged +} + +func (*ChatEventPhotoChanged) ChatEventActionType() string { + return TypeChatEventPhotoChanged +} + +// The slow_mode_delay setting of a supergroup was changed +type ChatEventSlowModeDelayChanged struct { + meta + // Previous value of slow_mode_delay, in seconds + OldSlowModeDelay int32 `json:"old_slow_mode_delay"` + // New value of slow_mode_delay, in seconds + NewSlowModeDelay int32 `json:"new_slow_mode_delay"` +} + +func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventSlowModeDelayChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventSlowModeDelayChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventSlowModeDelayChanged) GetType() string { + return TypeChatEventSlowModeDelayChanged +} + +func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { + return TypeChatEventSlowModeDelayChanged +} + +// The supergroup sticker set was changed +type ChatEventStickerSetChanged struct { + meta + // Previous identifier of the chat sticker set; 0 if none + OldStickerSetId JsonInt64 `json:"old_sticker_set_id"` + // New identifier of the chat sticker set; 0 if none + NewStickerSetId JsonInt64 `json:"new_sticker_set_id"` +} + +func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventStickerSetChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventStickerSetChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventStickerSetChanged) GetType() string { + return TypeChatEventStickerSetChanged +} + +func (*ChatEventStickerSetChanged) ChatEventActionType() string { + return TypeChatEventStickerSetChanged +} + +// The chat title was changed +type ChatEventTitleChanged struct { + meta + // Previous chat title + OldTitle string `json:"old_title"` + // New chat title + NewTitle string `json:"new_title"` +} + +func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventTitleChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventTitleChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventTitleChanged) GetType() string { + return TypeChatEventTitleChanged +} + +func (*ChatEventTitleChanged) ChatEventActionType() string { + return TypeChatEventTitleChanged +} + +// The chat editable username was changed +type ChatEventUsernameChanged struct { + meta + // Previous chat username + OldUsername string `json:"old_username"` + // New chat username + NewUsername string `json:"new_username"` +} + +func (entity *ChatEventUsernameChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventUsernameChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventUsernameChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventUsernameChanged) GetType() string { + return TypeChatEventUsernameChanged +} + +func (*ChatEventUsernameChanged) ChatEventActionType() string { + return TypeChatEventUsernameChanged +} + +// The chat active usernames were changed +type ChatEventActiveUsernamesChanged struct { + meta + // Previous list of active usernames + OldUsernames []string `json:"old_usernames"` + // New list of active usernames + NewUsernames []string `json:"new_usernames"` +} + +func (entity *ChatEventActiveUsernamesChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventActiveUsernamesChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventActiveUsernamesChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventActiveUsernamesChanged) GetType() string { + return TypeChatEventActiveUsernamesChanged +} + +func (*ChatEventActiveUsernamesChanged) ChatEventActionType() string { + return TypeChatEventActiveUsernamesChanged +} + +// The chat accent color was changed +type ChatEventAccentColorChanged struct { + meta + // Previous identifier of chat accent color + OldAccentColorId int32 `json:"old_accent_color_id"` + // New identifier of chat accent color + NewAccentColorId int32 `json:"new_accent_color_id"` +} + +func (entity *ChatEventAccentColorChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventAccentColorChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventAccentColorChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventAccentColorChanged) GetType() string { + return TypeChatEventAccentColorChanged +} + +func (*ChatEventAccentColorChanged) ChatEventActionType() string { + return TypeChatEventAccentColorChanged +} + +// The chat's custom emoji for reply background was changed +type ChatEventBackgroundCustomEmojiChanged struct { + meta + // Previous identifier of the custom emoji; 0 if none + OldBackgroundCustomEmojiId JsonInt64 `json:"old_background_custom_emoji_id"` + // New identifier of the custom emoji; 0 if none + NewBackgroundCustomEmojiId JsonInt64 `json:"new_background_custom_emoji_id"` +} + +func (entity *ChatEventBackgroundCustomEmojiChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventBackgroundCustomEmojiChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventBackgroundCustomEmojiChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventBackgroundCustomEmojiChanged) GetType() string { + return TypeChatEventBackgroundCustomEmojiChanged +} + +func (*ChatEventBackgroundCustomEmojiChanged) ChatEventActionType() string { + return TypeChatEventBackgroundCustomEmojiChanged +} + +// The has_protected_content setting of a channel was toggled +type ChatEventHasProtectedContentToggled struct { + meta + // New value of has_protected_content + HasProtectedContent bool `json:"has_protected_content"` +} + +func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventHasProtectedContentToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventHasProtectedContentToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventHasProtectedContentToggled) GetType() string { + return TypeChatEventHasProtectedContentToggled +} + +func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { + return TypeChatEventHasProtectedContentToggled +} + +// The can_invite_users permission of a supergroup chat was toggled +type ChatEventInvitesToggled struct { + meta + // New value of can_invite_users permission + CanInviteUsers bool `json:"can_invite_users"` +} + +func (entity *ChatEventInvitesToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventInvitesToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventInvitesToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventInvitesToggled) GetType() string { + return TypeChatEventInvitesToggled +} + +func (*ChatEventInvitesToggled) ChatEventActionType() string { + return TypeChatEventInvitesToggled +} + // The is_all_history_available setting of a supergroup was toggled type ChatEventIsAllHistoryAvailableToggled struct { meta @@ -21271,6 +29145,60 @@ func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string { return TypeChatEventIsAllHistoryAvailableToggled } +// The has_aggressive_anti_spam_enabled setting of a supergroup was toggled +type ChatEventHasAggressiveAntiSpamEnabledToggled struct { + meta + // New value of has_aggressive_anti_spam_enabled + HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` +} + +func (entity *ChatEventHasAggressiveAntiSpamEnabledToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventHasAggressiveAntiSpamEnabledToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventHasAggressiveAntiSpamEnabledToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventHasAggressiveAntiSpamEnabledToggled) GetType() string { + return TypeChatEventHasAggressiveAntiSpamEnabledToggled +} + +func (*ChatEventHasAggressiveAntiSpamEnabledToggled) ChatEventActionType() string { + return TypeChatEventHasAggressiveAntiSpamEnabledToggled +} + +// The sign_messages setting of a channel was toggled +type ChatEventSignMessagesToggled struct { + meta + // New value of sign_messages + SignMessages bool `json:"sign_messages"` +} + +func (entity *ChatEventSignMessagesToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventSignMessagesToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventSignMessagesToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventSignMessagesToggled) GetType() string { + return TypeChatEventSignMessagesToggled +} + +func (*ChatEventSignMessagesToggled) ChatEventActionType() string { + return TypeChatEventSignMessagesToggled +} + // A chat invite link was edited type ChatEventInviteLinkEdited struct { meta @@ -21408,6 +29336,33 @@ func (*ChatEventVideoChatEnded) ChatEventActionType() string { return TypeChatEventVideoChatEnded } +// The mute_new_participants setting of a video chat was toggled +type ChatEventVideoChatMuteNewParticipantsToggled struct { + meta + // New value of the mute_new_participants setting + MuteNewParticipants bool `json:"mute_new_participants"` +} + +func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatMuteNewParticipantsToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + // A video chat participant was muted or unmuted type ChatEventVideoChatParticipantIsMutedToggled struct { meta @@ -21504,31 +29459,197 @@ func (chatEventVideoChatParticipantVolumeLevelChanged *ChatEventVideoChatPartici return nil } -// The mute_new_participants setting of a video chat was toggled -type ChatEventVideoChatMuteNewParticipantsToggled struct { +// The is_forum setting of a channel was toggled +type ChatEventIsForumToggled struct { meta - // New value of the mute_new_participants setting - MuteNewParticipants bool `json:"mute_new_participants"` + // New value of is_forum + IsForum bool `json:"is_forum"` } -func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { +func (entity *ChatEventIsForumToggled) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatEventVideoChatMuteNewParticipantsToggled + type stub ChatEventIsForumToggled return json.Marshal((*stub)(entity)) } -func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { +func (*ChatEventIsForumToggled) GetClass() string { return ClassChatEventAction } -func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { - return TypeChatEventVideoChatMuteNewParticipantsToggled +func (*ChatEventIsForumToggled) GetType() string { + return TypeChatEventIsForumToggled } -func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { - return TypeChatEventVideoChatMuteNewParticipantsToggled +func (*ChatEventIsForumToggled) ChatEventActionType() string { + return TypeChatEventIsForumToggled +} + +// A new forum topic was created +type ChatEventForumTopicCreated struct { + meta + // Information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicCreated + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicCreated) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicCreated) GetType() string { + return TypeChatEventForumTopicCreated +} + +func (*ChatEventForumTopicCreated) ChatEventActionType() string { + return TypeChatEventForumTopicCreated +} + +// A forum topic was edited +type ChatEventForumTopicEdited struct { + meta + // Old information about the topic + OldTopicInfo *ForumTopicInfo `json:"old_topic_info"` + // New information about the topic + NewTopicInfo *ForumTopicInfo `json:"new_topic_info"` +} + +func (entity *ChatEventForumTopicEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicEdited + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicEdited) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicEdited) GetType() string { + return TypeChatEventForumTopicEdited +} + +func (*ChatEventForumTopicEdited) ChatEventActionType() string { + return TypeChatEventForumTopicEdited +} + +// A forum topic was closed or reopened +type ChatEventForumTopicToggleIsClosed struct { + meta + // New information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicToggleIsClosed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicToggleIsClosed + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicToggleIsClosed) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicToggleIsClosed) GetType() string { + return TypeChatEventForumTopicToggleIsClosed +} + +func (*ChatEventForumTopicToggleIsClosed) ChatEventActionType() string { + return TypeChatEventForumTopicToggleIsClosed +} + +// The General forum topic was hidden or unhidden +type ChatEventForumTopicToggleIsHidden struct { + meta + // New information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicToggleIsHidden) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicToggleIsHidden + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicToggleIsHidden) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicToggleIsHidden) GetType() string { + return TypeChatEventForumTopicToggleIsHidden +} + +func (*ChatEventForumTopicToggleIsHidden) ChatEventActionType() string { + return TypeChatEventForumTopicToggleIsHidden +} + +// A forum topic was deleted +type ChatEventForumTopicDeleted struct { + meta + // Information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicDeleted) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicDeleted) GetType() string { + return TypeChatEventForumTopicDeleted +} + +func (*ChatEventForumTopicDeleted) ChatEventActionType() string { + return TypeChatEventForumTopicDeleted +} + +// A pinned forum topic was changed +type ChatEventForumTopicPinned struct { + meta + // Information about the old pinned topic; may be null + OldTopicInfo *ForumTopicInfo `json:"old_topic_info"` + // Information about the new pinned topic; may be null + NewTopicInfo *ForumTopicInfo `json:"new_topic_info"` +} + +func (entity *ChatEventForumTopicPinned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicPinned + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicPinned) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicPinned) GetType() string { + return TypeChatEventForumTopicPinned +} + +func (*ChatEventForumTopicPinned) ChatEventActionType() string { + return TypeChatEventForumTopicPinned } // Represents a chat event @@ -21635,6 +29756,8 @@ type ChatEventLogFilters struct { InviteLinkChanges bool `json:"invite_link_changes"` // True, if video chat actions need to be returned VideoChatChanges bool `json:"video_chat_changes"` + // True, if forum-related actions need to be returned + ForumChanges bool `json:"forum_changes"` } func (entity *ChatEventLogFilters) MarshalJSON() ([]byte, error) { @@ -21680,7 +29803,7 @@ func (*LanguagePackStringValueOrdinary) LanguagePackStringValueType() string { return TypeLanguagePackStringValueOrdinary } -// A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info +// A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information type LanguagePackStringValuePluralized struct { meta // Value for zero objects @@ -21820,7 +29943,7 @@ type LanguagePackInfo struct { Name string `json:"name"` // Name of the language in that language NativeName string `json:"native_name"` - // A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info + // A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information PluralCode string `json:"plural_code"` // True, if the language pack is official IsOfficial bool `json:"is_official"` @@ -21879,6 +30002,1575 @@ func (*LocalizationTargetInfo) GetType() string { return TypeLocalizationTargetInfo } +// The maximum number of joined supergroups and channels +type PremiumLimitTypeSupergroupCount struct { + meta +} + +func (entity *PremiumLimitTypeSupergroupCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeSupergroupCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeSupergroupCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeSupergroupCount) GetType() string { + return TypePremiumLimitTypeSupergroupCount +} + +func (*PremiumLimitTypeSupergroupCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeSupergroupCount +} + +// The maximum number of pinned chats in the main chat list +type PremiumLimitTypePinnedChatCount struct { + meta +} + +func (entity *PremiumLimitTypePinnedChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypePinnedChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypePinnedChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypePinnedChatCount) GetType() string { + return TypePremiumLimitTypePinnedChatCount +} + +func (*PremiumLimitTypePinnedChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypePinnedChatCount +} + +// The maximum number of created public chats +type PremiumLimitTypeCreatedPublicChatCount struct { + meta +} + +func (entity *PremiumLimitTypeCreatedPublicChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeCreatedPublicChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeCreatedPublicChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeCreatedPublicChatCount) GetType() string { + return TypePremiumLimitTypeCreatedPublicChatCount +} + +func (*PremiumLimitTypeCreatedPublicChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeCreatedPublicChatCount +} + +// The maximum number of saved animations +type PremiumLimitTypeSavedAnimationCount struct { + meta +} + +func (entity *PremiumLimitTypeSavedAnimationCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeSavedAnimationCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeSavedAnimationCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeSavedAnimationCount) GetType() string { + return TypePremiumLimitTypeSavedAnimationCount +} + +func (*PremiumLimitTypeSavedAnimationCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeSavedAnimationCount +} + +// The maximum number of favorite stickers +type PremiumLimitTypeFavoriteStickerCount struct { + meta +} + +func (entity *PremiumLimitTypeFavoriteStickerCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeFavoriteStickerCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeFavoriteStickerCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeFavoriteStickerCount) GetType() string { + return TypePremiumLimitTypeFavoriteStickerCount +} + +func (*PremiumLimitTypeFavoriteStickerCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeFavoriteStickerCount +} + +// The maximum number of chat folders +type PremiumLimitTypeChatFolderCount struct { + meta +} + +func (entity *PremiumLimitTypeChatFolderCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeChatFolderCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeChatFolderCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeChatFolderCount) GetType() string { + return TypePremiumLimitTypeChatFolderCount +} + +func (*PremiumLimitTypeChatFolderCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFolderCount +} + +// The maximum number of pinned and always included, or always excluded chats in a chat folder +type PremiumLimitTypeChatFolderChosenChatCount struct { + meta +} + +func (entity *PremiumLimitTypeChatFolderChosenChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeChatFolderChosenChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeChatFolderChosenChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeChatFolderChosenChatCount) GetType() string { + return TypePremiumLimitTypeChatFolderChosenChatCount +} + +func (*PremiumLimitTypeChatFolderChosenChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFolderChosenChatCount +} + +// The maximum number of pinned chats in the archive chat list +type PremiumLimitTypePinnedArchivedChatCount struct { + meta +} + +func (entity *PremiumLimitTypePinnedArchivedChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypePinnedArchivedChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypePinnedArchivedChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypePinnedArchivedChatCount) GetType() string { + return TypePremiumLimitTypePinnedArchivedChatCount +} + +func (*PremiumLimitTypePinnedArchivedChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypePinnedArchivedChatCount +} + +// The maximum length of sent media caption +type PremiumLimitTypeCaptionLength struct { + meta +} + +func (entity *PremiumLimitTypeCaptionLength) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeCaptionLength + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeCaptionLength) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeCaptionLength) GetType() string { + return TypePremiumLimitTypeCaptionLength +} + +func (*PremiumLimitTypeCaptionLength) PremiumLimitTypeType() string { + return TypePremiumLimitTypeCaptionLength +} + +// The maximum length of the user's bio +type PremiumLimitTypeBioLength struct { + meta +} + +func (entity *PremiumLimitTypeBioLength) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeBioLength + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeBioLength) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeBioLength) GetType() string { + return TypePremiumLimitTypeBioLength +} + +func (*PremiumLimitTypeBioLength) PremiumLimitTypeType() string { + return TypePremiumLimitTypeBioLength +} + +// The maximum number of invite links for a chat folder +type PremiumLimitTypeChatFolderInviteLinkCount struct { + meta +} + +func (entity *PremiumLimitTypeChatFolderInviteLinkCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeChatFolderInviteLinkCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeChatFolderInviteLinkCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeChatFolderInviteLinkCount) GetType() string { + return TypePremiumLimitTypeChatFolderInviteLinkCount +} + +func (*PremiumLimitTypeChatFolderInviteLinkCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFolderInviteLinkCount +} + +// The maximum number of added shareable chat folders +type PremiumLimitTypeShareableChatFolderCount struct { + meta +} + +func (entity *PremiumLimitTypeShareableChatFolderCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeShareableChatFolderCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeShareableChatFolderCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeShareableChatFolderCount) GetType() string { + return TypePremiumLimitTypeShareableChatFolderCount +} + +func (*PremiumLimitTypeShareableChatFolderCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeShareableChatFolderCount +} + +// The maximum number of active stories +type PremiumLimitTypeActiveStoryCount struct { + meta +} + +func (entity *PremiumLimitTypeActiveStoryCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeActiveStoryCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeActiveStoryCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeActiveStoryCount) GetType() string { + return TypePremiumLimitTypeActiveStoryCount +} + +func (*PremiumLimitTypeActiveStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeActiveStoryCount +} + +// The maximum number of stories sent per week +type PremiumLimitTypeWeeklySentStoryCount struct { + meta +} + +func (entity *PremiumLimitTypeWeeklySentStoryCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeWeeklySentStoryCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeWeeklySentStoryCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeWeeklySentStoryCount) GetType() string { + return TypePremiumLimitTypeWeeklySentStoryCount +} + +func (*PremiumLimitTypeWeeklySentStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeWeeklySentStoryCount +} + +// The maximum number of stories sent per month +type PremiumLimitTypeMonthlySentStoryCount struct { + meta +} + +func (entity *PremiumLimitTypeMonthlySentStoryCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeMonthlySentStoryCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeMonthlySentStoryCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeMonthlySentStoryCount) GetType() string { + return TypePremiumLimitTypeMonthlySentStoryCount +} + +func (*PremiumLimitTypeMonthlySentStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeMonthlySentStoryCount +} + +// The maximum length of captions of sent stories +type PremiumLimitTypeStoryCaptionLength struct { + meta +} + +func (entity *PremiumLimitTypeStoryCaptionLength) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeStoryCaptionLength + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeStoryCaptionLength) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeStoryCaptionLength) GetType() string { + return TypePremiumLimitTypeStoryCaptionLength +} + +func (*PremiumLimitTypeStoryCaptionLength) PremiumLimitTypeType() string { + return TypePremiumLimitTypeStoryCaptionLength +} + +// The maximum number of suggested reaction areas on a story +type PremiumLimitTypeStorySuggestedReactionAreaCount struct { + meta +} + +func (entity *PremiumLimitTypeStorySuggestedReactionAreaCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeStorySuggestedReactionAreaCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeStorySuggestedReactionAreaCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeStorySuggestedReactionAreaCount) GetType() string { + return TypePremiumLimitTypeStorySuggestedReactionAreaCount +} + +func (*PremiumLimitTypeStorySuggestedReactionAreaCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeStorySuggestedReactionAreaCount +} + +// Increased limits +type PremiumFeatureIncreasedLimits struct { + meta +} + +func (entity *PremiumFeatureIncreasedLimits) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureIncreasedLimits + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureIncreasedLimits) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureIncreasedLimits) GetType() string { + return TypePremiumFeatureIncreasedLimits +} + +func (*PremiumFeatureIncreasedLimits) PremiumFeatureType() string { + return TypePremiumFeatureIncreasedLimits +} + +// Increased maximum upload file size +type PremiumFeatureIncreasedUploadFileSize struct { + meta +} + +func (entity *PremiumFeatureIncreasedUploadFileSize) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureIncreasedUploadFileSize + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureIncreasedUploadFileSize) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureIncreasedUploadFileSize) GetType() string { + return TypePremiumFeatureIncreasedUploadFileSize +} + +func (*PremiumFeatureIncreasedUploadFileSize) PremiumFeatureType() string { + return TypePremiumFeatureIncreasedUploadFileSize +} + +// Improved download speed +type PremiumFeatureImprovedDownloadSpeed struct { + meta +} + +func (entity *PremiumFeatureImprovedDownloadSpeed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureImprovedDownloadSpeed + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureImprovedDownloadSpeed) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureImprovedDownloadSpeed) GetType() string { + return TypePremiumFeatureImprovedDownloadSpeed +} + +func (*PremiumFeatureImprovedDownloadSpeed) PremiumFeatureType() string { + return TypePremiumFeatureImprovedDownloadSpeed +} + +// The ability to convert voice notes to text +type PremiumFeatureVoiceRecognition struct { + meta +} + +func (entity *PremiumFeatureVoiceRecognition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureVoiceRecognition + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureVoiceRecognition) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureVoiceRecognition) GetType() string { + return TypePremiumFeatureVoiceRecognition +} + +func (*PremiumFeatureVoiceRecognition) PremiumFeatureType() string { + return TypePremiumFeatureVoiceRecognition +} + +// Disabled ads +type PremiumFeatureDisabledAds struct { + meta +} + +func (entity *PremiumFeatureDisabledAds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureDisabledAds + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureDisabledAds) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureDisabledAds) GetType() string { + return TypePremiumFeatureDisabledAds +} + +func (*PremiumFeatureDisabledAds) PremiumFeatureType() string { + return TypePremiumFeatureDisabledAds +} + +// Allowed to use more reactions +type PremiumFeatureUniqueReactions struct { + meta +} + +func (entity *PremiumFeatureUniqueReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureUniqueReactions + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureUniqueReactions) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureUniqueReactions) GetType() string { + return TypePremiumFeatureUniqueReactions +} + +func (*PremiumFeatureUniqueReactions) PremiumFeatureType() string { + return TypePremiumFeatureUniqueReactions +} + +// Allowed to use premium stickers with unique effects +type PremiumFeatureUniqueStickers struct { + meta +} + +func (entity *PremiumFeatureUniqueStickers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureUniqueStickers + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureUniqueStickers) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureUniqueStickers) GetType() string { + return TypePremiumFeatureUniqueStickers +} + +func (*PremiumFeatureUniqueStickers) PremiumFeatureType() string { + return TypePremiumFeatureUniqueStickers +} + +// Allowed to use custom emoji stickers in message texts and captions +type PremiumFeatureCustomEmoji struct { + meta +} + +func (entity *PremiumFeatureCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureCustomEmoji) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureCustomEmoji) GetType() string { + return TypePremiumFeatureCustomEmoji +} + +func (*PremiumFeatureCustomEmoji) PremiumFeatureType() string { + return TypePremiumFeatureCustomEmoji +} + +// Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram +type PremiumFeatureAdvancedChatManagement struct { + meta +} + +func (entity *PremiumFeatureAdvancedChatManagement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAdvancedChatManagement + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAdvancedChatManagement) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAdvancedChatManagement) GetType() string { + return TypePremiumFeatureAdvancedChatManagement +} + +func (*PremiumFeatureAdvancedChatManagement) PremiumFeatureType() string { + return TypePremiumFeatureAdvancedChatManagement +} + +// A badge in the user's profile +type PremiumFeatureProfileBadge struct { + meta +} + +func (entity *PremiumFeatureProfileBadge) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureProfileBadge + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureProfileBadge) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureProfileBadge) GetType() string { + return TypePremiumFeatureProfileBadge +} + +func (*PremiumFeatureProfileBadge) PremiumFeatureType() string { + return TypePremiumFeatureProfileBadge +} + +// An emoji status shown along with the user's name +type PremiumFeatureEmojiStatus struct { + meta +} + +func (entity *PremiumFeatureEmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureEmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureEmojiStatus) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureEmojiStatus) GetType() string { + return TypePremiumFeatureEmojiStatus +} + +func (*PremiumFeatureEmojiStatus) PremiumFeatureType() string { + return TypePremiumFeatureEmojiStatus +} + +// Profile photo animation on message and chat screens +type PremiumFeatureAnimatedProfilePhoto struct { + meta +} + +func (entity *PremiumFeatureAnimatedProfilePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAnimatedProfilePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAnimatedProfilePhoto) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAnimatedProfilePhoto) GetType() string { + return TypePremiumFeatureAnimatedProfilePhoto +} + +func (*PremiumFeatureAnimatedProfilePhoto) PremiumFeatureType() string { + return TypePremiumFeatureAnimatedProfilePhoto +} + +// The ability to set a custom emoji as a forum topic icon +type PremiumFeatureForumTopicIcon struct { + meta +} + +func (entity *PremiumFeatureForumTopicIcon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureForumTopicIcon + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureForumTopicIcon) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureForumTopicIcon) GetType() string { + return TypePremiumFeatureForumTopicIcon +} + +func (*PremiumFeatureForumTopicIcon) PremiumFeatureType() string { + return TypePremiumFeatureForumTopicIcon +} + +// Allowed to set a premium application icons +type PremiumFeatureAppIcons struct { + meta +} + +func (entity *PremiumFeatureAppIcons) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAppIcons + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAppIcons) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAppIcons) GetType() string { + return TypePremiumFeatureAppIcons +} + +func (*PremiumFeatureAppIcons) PremiumFeatureType() string { + return TypePremiumFeatureAppIcons +} + +// Allowed to translate chat messages real-time +type PremiumFeatureRealTimeChatTranslation struct { + meta +} + +func (entity *PremiumFeatureRealTimeChatTranslation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureRealTimeChatTranslation + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureRealTimeChatTranslation) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureRealTimeChatTranslation) GetType() string { + return TypePremiumFeatureRealTimeChatTranslation +} + +func (*PremiumFeatureRealTimeChatTranslation) PremiumFeatureType() string { + return TypePremiumFeatureRealTimeChatTranslation +} + +// Allowed to use many additional features for stories +type PremiumFeatureUpgradedStories struct { + meta +} + +func (entity *PremiumFeatureUpgradedStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureUpgradedStories + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureUpgradedStories) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureUpgradedStories) GetType() string { + return TypePremiumFeatureUpgradedStories +} + +func (*PremiumFeatureUpgradedStories) PremiumFeatureType() string { + return TypePremiumFeatureUpgradedStories +} + +// The ability to boost chats +type PremiumFeatureChatBoost struct { + meta +} + +func (entity *PremiumFeatureChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureChatBoost) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureChatBoost) GetType() string { + return TypePremiumFeatureChatBoost +} + +func (*PremiumFeatureChatBoost) PremiumFeatureType() string { + return TypePremiumFeatureChatBoost +} + +// The ability to choose accent color +type PremiumFeatureAccentColor struct { + meta +} + +func (entity *PremiumFeatureAccentColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAccentColor + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAccentColor) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAccentColor) GetType() string { + return TypePremiumFeatureAccentColor +} + +func (*PremiumFeatureAccentColor) PremiumFeatureType() string { + return TypePremiumFeatureAccentColor +} + +// User stories are displayed before stories of non-premium contacts and channels +type PremiumStoryFeaturePriorityOrder struct { + meta +} + +func (entity *PremiumStoryFeaturePriorityOrder) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeaturePriorityOrder + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeaturePriorityOrder) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeaturePriorityOrder) GetType() string { + return TypePremiumStoryFeaturePriorityOrder +} + +func (*PremiumStoryFeaturePriorityOrder) PremiumStoryFeatureType() string { + return TypePremiumStoryFeaturePriorityOrder +} + +// The ability to hide the fact that the user viewed other's stories +type PremiumStoryFeatureStealthMode struct { + meta +} + +func (entity *PremiumStoryFeatureStealthMode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureStealthMode + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureStealthMode) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureStealthMode) GetType() string { + return TypePremiumStoryFeatureStealthMode +} + +func (*PremiumStoryFeatureStealthMode) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureStealthMode +} + +// The ability to check who opened the current user's stories after they expire +type PremiumStoryFeaturePermanentViewsHistory struct { + meta +} + +func (entity *PremiumStoryFeaturePermanentViewsHistory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeaturePermanentViewsHistory + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeaturePermanentViewsHistory) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeaturePermanentViewsHistory) GetType() string { + return TypePremiumStoryFeaturePermanentViewsHistory +} + +func (*PremiumStoryFeaturePermanentViewsHistory) PremiumStoryFeatureType() string { + return TypePremiumStoryFeaturePermanentViewsHistory +} + +// The ability to set custom expiration duration for stories +type PremiumStoryFeatureCustomExpirationDuration struct { + meta +} + +func (entity *PremiumStoryFeatureCustomExpirationDuration) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureCustomExpirationDuration + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureCustomExpirationDuration) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureCustomExpirationDuration) GetType() string { + return TypePremiumStoryFeatureCustomExpirationDuration +} + +func (*PremiumStoryFeatureCustomExpirationDuration) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureCustomExpirationDuration +} + +// The ability to save other's unprotected stories +type PremiumStoryFeatureSaveStories struct { + meta +} + +func (entity *PremiumStoryFeatureSaveStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureSaveStories + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureSaveStories) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureSaveStories) GetType() string { + return TypePremiumStoryFeatureSaveStories +} + +func (*PremiumStoryFeatureSaveStories) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureSaveStories +} + +// The ability to use links and formatting in story caption +type PremiumStoryFeatureLinksAndFormatting struct { + meta +} + +func (entity *PremiumStoryFeatureLinksAndFormatting) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureLinksAndFormatting + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureLinksAndFormatting) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureLinksAndFormatting) GetType() string { + return TypePremiumStoryFeatureLinksAndFormatting +} + +func (*PremiumStoryFeatureLinksAndFormatting) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureLinksAndFormatting +} + +// Contains information about a limit, increased for Premium users +type PremiumLimit struct { + meta + // The type of the limit + Type PremiumLimitType `json:"type"` + // Default value of the limit + DefaultValue int32 `json:"default_value"` + // Value of the limit for Premium users + PremiumValue int32 `json:"premium_value"` +} + +func (entity *PremiumLimit) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimit + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimit) GetClass() string { + return ClassPremiumLimit +} + +func (*PremiumLimit) GetType() string { + return TypePremiumLimit +} + +func (premiumLimit *PremiumLimit) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + DefaultValue int32 `json:"default_value"` + PremiumValue int32 `json:"premium_value"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumLimit.DefaultValue = tmp.DefaultValue + premiumLimit.PremiumValue = tmp.PremiumValue + + fieldType, _ := UnmarshalPremiumLimitType(tmp.Type) + premiumLimit.Type = fieldType + + return nil +} + +// Contains information about features, available to Premium users +type PremiumFeatures struct { + meta + // The list of available features + Features []PremiumFeature `json:"features"` + // The list of limits, increased for Premium users + Limits []*PremiumLimit `json:"limits"` + // An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available + PaymentLink InternalLinkType `json:"payment_link"` +} + +func (entity *PremiumFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatures) GetClass() string { + return ClassPremiumFeatures +} + +func (*PremiumFeatures) GetType() string { + return TypePremiumFeatures +} + +func (premiumFeatures *PremiumFeatures) UnmarshalJSON(data []byte) error { + var tmp struct { + Features []json.RawMessage `json:"features"` + Limits []*PremiumLimit `json:"limits"` + PaymentLink json.RawMessage `json:"payment_link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumFeatures.Limits = tmp.Limits + + fieldFeatures, _ := UnmarshalListOfPremiumFeature(tmp.Features) + premiumFeatures.Features = fieldFeatures + + fieldPaymentLink, _ := UnmarshalInternalLinkType(tmp.PaymentLink) + premiumFeatures.PaymentLink = fieldPaymentLink + + return nil +} + +// A limit was exceeded +type PremiumSourceLimitExceeded struct { + meta + // Type of the exceeded limit + LimitType PremiumLimitType `json:"limit_type"` +} + +func (entity *PremiumSourceLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceLimitExceeded) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceLimitExceeded) GetType() string { + return TypePremiumSourceLimitExceeded +} + +func (*PremiumSourceLimitExceeded) PremiumSourceType() string { + return TypePremiumSourceLimitExceeded +} + +func (premiumSourceLimitExceeded *PremiumSourceLimitExceeded) UnmarshalJSON(data []byte) error { + var tmp struct { + LimitType json.RawMessage `json:"limit_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldLimitType, _ := UnmarshalPremiumLimitType(tmp.LimitType) + premiumSourceLimitExceeded.LimitType = fieldLimitType + + return nil +} + +// A user tried to use a Premium feature +type PremiumSourceFeature struct { + meta + // The used feature + Feature PremiumFeature `json:"feature"` +} + +func (entity *PremiumSourceFeature) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceFeature + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceFeature) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceFeature) GetType() string { + return TypePremiumSourceFeature +} + +func (*PremiumSourceFeature) PremiumSourceType() string { + return TypePremiumSourceFeature +} + +func (premiumSourceFeature *PremiumSourceFeature) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFeature, _ := UnmarshalPremiumFeature(tmp.Feature) + premiumSourceFeature.Feature = fieldFeature + + return nil +} + +// A user tried to use a Premium story feature +type PremiumSourceStoryFeature struct { + meta + // The used feature + Feature PremiumStoryFeature `json:"feature"` +} + +func (entity *PremiumSourceStoryFeature) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceStoryFeature + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceStoryFeature) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceStoryFeature) GetType() string { + return TypePremiumSourceStoryFeature +} + +func (*PremiumSourceStoryFeature) PremiumSourceType() string { + return TypePremiumSourceStoryFeature +} + +func (premiumSourceStoryFeature *PremiumSourceStoryFeature) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFeature, _ := UnmarshalPremiumStoryFeature(tmp.Feature) + premiumSourceStoryFeature.Feature = fieldFeature + + return nil +} + +// A user opened an internal link of the type internalLinkTypePremiumFeatures +type PremiumSourceLink struct { + meta + // The referrer from the link + Referrer string `json:"referrer"` +} + +func (entity *PremiumSourceLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceLink + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceLink) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceLink) GetType() string { + return TypePremiumSourceLink +} + +func (*PremiumSourceLink) PremiumSourceType() string { + return TypePremiumSourceLink +} + +// A user opened the Premium features screen from settings +type PremiumSourceSettings struct { + meta +} + +func (entity *PremiumSourceSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceSettings + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceSettings) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceSettings) GetType() string { + return TypePremiumSourceSettings +} + +func (*PremiumSourceSettings) PremiumSourceType() string { + return TypePremiumSourceSettings +} + +// Describes a promotion animation for a Premium feature +type PremiumFeaturePromotionAnimation struct { + meta + // Premium feature + Feature PremiumFeature `json:"feature"` + // Promotion animation for the feature + Animation *Animation `json:"animation"` +} + +func (entity *PremiumFeaturePromotionAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeaturePromotionAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeaturePromotionAnimation) GetClass() string { + return ClassPremiumFeaturePromotionAnimation +} + +func (*PremiumFeaturePromotionAnimation) GetType() string { + return TypePremiumFeaturePromotionAnimation +} + +func (premiumFeaturePromotionAnimation *PremiumFeaturePromotionAnimation) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + Animation *Animation `json:"animation"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumFeaturePromotionAnimation.Animation = tmp.Animation + + fieldFeature, _ := UnmarshalPremiumFeature(tmp.Feature) + premiumFeaturePromotionAnimation.Feature = fieldFeature + + return nil +} + +// Contains state of Telegram Premium subscription and promotion videos for Premium features +type PremiumState struct { + meta + // Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription + State *FormattedText `json:"state"` + // The list of available options for buying Telegram Premium + PaymentOptions []*PremiumStatePaymentOption `json:"payment_options"` + // The list of available promotion animations for Premium features + Animations []*PremiumFeaturePromotionAnimation `json:"animations"` +} + +func (entity *PremiumState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumState + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumState) GetClass() string { + return ClassPremiumState +} + +func (*PremiumState) GetType() string { + return TypePremiumState +} + +// The user subscribing to Telegram Premium +type StorePaymentPurposePremiumSubscription struct { + meta + // Pass true if this is a restore of a Telegram Premium purchase; only for App Store + IsRestore bool `json:"is_restore"` + // Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store + IsUpgrade bool `json:"is_upgrade"` +} + +func (entity *StorePaymentPurposePremiumSubscription) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposePremiumSubscription + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposePremiumSubscription) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposePremiumSubscription) GetType() string { + return TypeStorePaymentPurposePremiumSubscription +} + +func (*StorePaymentPurposePremiumSubscription) StorePaymentPurposeType() string { + return TypeStorePaymentPurposePremiumSubscription +} + +// The user gifting Telegram Premium to another user +type StorePaymentPurposeGiftedPremium struct { + meta + // Identifier of the user to which Premium was gifted + UserId int64 `json:"user_id"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` +} + +func (entity *StorePaymentPurposeGiftedPremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposeGiftedPremium + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposeGiftedPremium) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposeGiftedPremium) GetType() string { + return TypeStorePaymentPurposeGiftedPremium +} + +func (*StorePaymentPurposeGiftedPremium) StorePaymentPurposeType() string { + return TypeStorePaymentPurposeGiftedPremium +} + +// The user creating Telegram Premium gift codes for other users +type StorePaymentPurposePremiumGiftCodes struct { + meta + // Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none + BoostedChatId int64 `json:"boosted_chat_id"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Identifiers of the users which can activate the gift codes + UserIds []int64 `json:"user_ids"` +} + +func (entity *StorePaymentPurposePremiumGiftCodes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposePremiumGiftCodes + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposePremiumGiftCodes) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposePremiumGiftCodes) GetType() string { + return TypeStorePaymentPurposePremiumGiftCodes +} + +func (*StorePaymentPurposePremiumGiftCodes) StorePaymentPurposeType() string { + return TypeStorePaymentPurposePremiumGiftCodes +} + +// The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +type StorePaymentPurposePremiumGiveaway struct { + meta + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` +} + +func (entity *StorePaymentPurposePremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposePremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposePremiumGiveaway) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposePremiumGiveaway) GetType() string { + return TypeStorePaymentPurposePremiumGiveaway +} + +func (*StorePaymentPurposePremiumGiveaway) StorePaymentPurposeType() string { + return TypeStorePaymentPurposePremiumGiveaway +} + +// The user creating Telegram Premium gift codes for other users +type TelegramPaymentPurposePremiumGiftCodes struct { + meta + // Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none + BoostedChatId int64 `json:"boosted_chat_id"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Identifiers of the users which can activate the gift codes + UserIds []int64 `json:"user_ids"` + // Number of month the Telegram Premium subscription will be active for the users + MonthCount int32 `json:"month_count"` +} + +func (entity *TelegramPaymentPurposePremiumGiftCodes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TelegramPaymentPurposePremiumGiftCodes + + return json.Marshal((*stub)(entity)) +} + +func (*TelegramPaymentPurposePremiumGiftCodes) GetClass() string { + return ClassTelegramPaymentPurpose +} + +func (*TelegramPaymentPurposePremiumGiftCodes) GetType() string { + return TypeTelegramPaymentPurposePremiumGiftCodes +} + +func (*TelegramPaymentPurposePremiumGiftCodes) TelegramPaymentPurposeType() string { + return TypeTelegramPaymentPurposePremiumGiftCodes +} + +// The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +type TelegramPaymentPurposePremiumGiveaway struct { + meta + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Number of users which will be able to activate the gift codes + WinnerCount int32 `json:"winner_count"` + // Number of month the Telegram Premium subscription will be active for the users + MonthCount int32 `json:"month_count"` +} + +func (entity *TelegramPaymentPurposePremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TelegramPaymentPurposePremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*TelegramPaymentPurposePremiumGiveaway) GetClass() string { + return ClassTelegramPaymentPurpose +} + +func (*TelegramPaymentPurposePremiumGiveaway) GetType() string { + return TypeTelegramPaymentPurposePremiumGiveaway +} + +func (*TelegramPaymentPurposePremiumGiveaway) TelegramPaymentPurposeType() string { + return TypeTelegramPaymentPurposePremiumGiveaway +} + // A token for Firebase Cloud Messaging type DeviceTokenFirebaseCloudMessaging struct { meta @@ -22188,6 +31880,35 @@ func (*DeviceTokenTizenPush) DeviceTokenType() string { return TypeDeviceTokenTizenPush } +// A token for HUAWEI Push Service +type DeviceTokenHuaweiPush struct { + meta + // Device registration token; may be empty to deregister a device + Token string `json:"token"` + // True, if push notifications must be additionally encrypted + Encrypt bool `json:"encrypt"` +} + +func (entity *DeviceTokenHuaweiPush) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenHuaweiPush + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenHuaweiPush) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenHuaweiPush) GetType() string { + return TypeDeviceTokenHuaweiPush +} + +func (*DeviceTokenHuaweiPush) DeviceTokenType() string { + return TypeDeviceTokenHuaweiPush +} + // Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification type PushReceiverId struct { meta @@ -22245,7 +31966,7 @@ type BackgroundFillGradient struct { TopColor int32 `json:"top_color"` // A bottom color of the background in the RGB24 format BottomColor int32 `json:"bottom_color"` - // Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45 + // Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45 RotationAngle int32 `json:"rotation_angle"` } @@ -22424,89 +32145,6 @@ func (backgroundTypeFill *BackgroundTypeFill) UnmarshalJSON(data []byte) error { return nil } -// Describes a chat background -type Background struct { - meta - // Unique background identifier - Id JsonInt64 `json:"id"` - // True, if this is one of default backgrounds - IsDefault bool `json:"is_default"` - // True, if the background is dark and is recommended to be used with dark theme - IsDark bool `json:"is_dark"` - // Unique background name - Name string `json:"name"` - // Document with the background; may be null. Null only for filled backgrounds - Document *Document `json:"document"` - // Type of the background - Type BackgroundType `json:"type"` -} - -func (entity *Background) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Background - - return json.Marshal((*stub)(entity)) -} - -func (*Background) GetClass() string { - return ClassBackground -} - -func (*Background) GetType() string { - return TypeBackground -} - -func (background *Background) UnmarshalJSON(data []byte) error { - var tmp struct { - Id JsonInt64 `json:"id"` - IsDefault bool `json:"is_default"` - IsDark bool `json:"is_dark"` - Name string `json:"name"` - Document *Document `json:"document"` - Type json.RawMessage `json:"type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - background.Id = tmp.Id - background.IsDefault = tmp.IsDefault - background.IsDark = tmp.IsDark - background.Name = tmp.Name - background.Document = tmp.Document - - fieldType, _ := UnmarshalBackgroundType(tmp.Type) - background.Type = fieldType - - return nil -} - -// Contains a list of backgrounds -type Backgrounds struct { - meta - // A list of backgrounds - Backgrounds []*Background `json:"backgrounds"` -} - -func (entity *Backgrounds) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Backgrounds - - return json.Marshal((*stub)(entity)) -} - -func (*Backgrounds) GetClass() string { - return ClassBackgrounds -} - -func (*Backgrounds) GetType() string { - return TypeBackgrounds -} - // A background from a local file type InputBackgroundLocal struct { meta @@ -22577,6 +32215,33 @@ func (*InputBackgroundRemote) InputBackgroundType() string { return TypeInputBackgroundRemote } +// A background previously set in the chat; for chat backgrounds only +type InputBackgroundPrevious struct { + meta + // Identifier of the message with the background + MessageId int64 `json:"message_id"` +} + +func (entity *InputBackgroundPrevious) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputBackgroundPrevious + + return json.Marshal((*stub)(entity)) +} + +func (*InputBackgroundPrevious) GetClass() string { + return ClassInputBackground +} + +func (*InputBackgroundPrevious) GetType() string { + return TypeInputBackgroundPrevious +} + +func (*InputBackgroundPrevious) InputBackgroundType() string { + return TypeInputBackgroundPrevious +} + // Describes theme settings type ThemeSettings struct { meta @@ -22683,6 +32348,160 @@ func (*Hashtags) GetType() string { return TypeHashtags } +// A story can be sent +type CanSendStoryResultOk struct { + meta +} + +func (entity *CanSendStoryResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultOk) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultOk) GetType() string { + return TypeCanSendStoryResultOk +} + +func (*CanSendStoryResultOk) CanSendStoryResultType() string { + return TypeCanSendStoryResultOk +} + +// The user must subscribe to Telegram Premium to be able to post stories +type CanSendStoryResultPremiumNeeded struct { + meta +} + +func (entity *CanSendStoryResultPremiumNeeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultPremiumNeeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultPremiumNeeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultPremiumNeeded) GetType() string { + return TypeCanSendStoryResultPremiumNeeded +} + +func (*CanSendStoryResultPremiumNeeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultPremiumNeeded +} + +// The channel chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat +type CanSendStoryResultBoostNeeded struct { + meta +} + +func (entity *CanSendStoryResultBoostNeeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultBoostNeeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultBoostNeeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultBoostNeeded) GetType() string { + return TypeCanSendStoryResultBoostNeeded +} + +func (*CanSendStoryResultBoostNeeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultBoostNeeded +} + +// The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire +type CanSendStoryResultActiveStoryLimitExceeded struct { + meta +} + +func (entity *CanSendStoryResultActiveStoryLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultActiveStoryLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultActiveStoryLimitExceeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultActiveStoryLimitExceeded) GetType() string { + return TypeCanSendStoryResultActiveStoryLimitExceeded +} + +func (*CanSendStoryResultActiveStoryLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultActiveStoryLimitExceeded +} + +// The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time +type CanSendStoryResultWeeklyLimitExceeded struct { + meta + // Time left before the user can send the next story + RetryAfter int32 `json:"retry_after"` +} + +func (entity *CanSendStoryResultWeeklyLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultWeeklyLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultWeeklyLimitExceeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultWeeklyLimitExceeded) GetType() string { + return TypeCanSendStoryResultWeeklyLimitExceeded +} + +func (*CanSendStoryResultWeeklyLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultWeeklyLimitExceeded +} + +// The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time +type CanSendStoryResultMonthlyLimitExceeded struct { + meta + // Time left before the user can send the next story + RetryAfter int32 `json:"retry_after"` +} + +func (entity *CanSendStoryResultMonthlyLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultMonthlyLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultMonthlyLimitExceeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultMonthlyLimitExceeded) GetType() string { + return TypeCanSendStoryResultMonthlyLimitExceeded +} + +func (*CanSendStoryResultMonthlyLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultMonthlyLimitExceeded +} + // The session can be used type CanTransferOwnershipResultOk struct { meta @@ -22862,29 +32681,54 @@ func (*CheckChatUsernameResultUsernameOccupied) CheckChatUsernameResultType() st return TypeCheckChatUsernameResultUsernameOccupied } -// The user has too much chats with username, one of them must be made private first -type CheckChatUsernameResultPublicChatsTooMuch struct { +// The username can be purchased at fragment.com +type CheckChatUsernameResultUsernamePurchasable struct { meta } -func (entity *CheckChatUsernameResultPublicChatsTooMuch) MarshalJSON() ([]byte, error) { +func (entity *CheckChatUsernameResultUsernamePurchasable) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub CheckChatUsernameResultPublicChatsTooMuch + type stub CheckChatUsernameResultUsernamePurchasable return json.Marshal((*stub)(entity)) } -func (*CheckChatUsernameResultPublicChatsTooMuch) GetClass() string { +func (*CheckChatUsernameResultUsernamePurchasable) GetClass() string { return ClassCheckChatUsernameResult } -func (*CheckChatUsernameResultPublicChatsTooMuch) GetType() string { - return TypeCheckChatUsernameResultPublicChatsTooMuch +func (*CheckChatUsernameResultUsernamePurchasable) GetType() string { + return TypeCheckChatUsernameResultUsernamePurchasable } -func (*CheckChatUsernameResultPublicChatsTooMuch) CheckChatUsernameResultType() string { - return TypeCheckChatUsernameResultPublicChatsTooMuch +func (*CheckChatUsernameResultUsernamePurchasable) CheckChatUsernameResultType() string { + return TypeCheckChatUsernameResultUsernamePurchasable +} + +// The user has too many chats with username, one of them must be made private first +type CheckChatUsernameResultPublicChatsTooMany struct { + meta +} + +func (entity *CheckChatUsernameResultPublicChatsTooMany) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CheckChatUsernameResultPublicChatsTooMany + + return json.Marshal((*stub)(entity)) +} + +func (*CheckChatUsernameResultPublicChatsTooMany) GetClass() string { + return ClassCheckChatUsernameResult +} + +func (*CheckChatUsernameResultPublicChatsTooMany) GetType() string { + return TypeCheckChatUsernameResultPublicChatsTooMany +} + +func (*CheckChatUsernameResultPublicChatsTooMany) CheckChatUsernameResultType() string { + return TypeCheckChatUsernameResultPublicChatsTooMany } // The user can't be a member of a public supergroup @@ -23497,6 +33341,64 @@ func (*PushMessageContentPoll) PushMessageContentType() string { return TypePushMessageContentPoll } +// A message with a Telegram Premium gift code created for the user +type PushMessageContentPremiumGiftCode struct { + meta + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` +} + +func (entity *PushMessageContentPremiumGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentPremiumGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentPremiumGiftCode) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentPremiumGiftCode) GetType() string { + return TypePushMessageContentPremiumGiftCode +} + +func (*PushMessageContentPremiumGiftCode) PushMessageContentType() string { + return TypePushMessageContentPremiumGiftCode +} + +// A message with a Telegram Premium giveaway +type PushMessageContentPremiumGiveaway struct { + meta + // Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message + WinnerCount int32 `json:"winner_count"` + // Number of month the Telegram Premium subscription will be active after code activation; 0 for pinned message + MonthCount int32 `json:"month_count"` + // True, if the message is a pinned message with the specified content + IsPinned bool `json:"is_pinned"` +} + +func (entity *PushMessageContentPremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentPremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentPremiumGiveaway) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentPremiumGiveaway) GetType() string { + return TypePushMessageContentPremiumGiveaway +} + +func (*PushMessageContentPremiumGiveaway) PushMessageContentType() string { + return TypePushMessageContentPremiumGiveaway +} + // A screenshot of a message in the chat has been taken type PushMessageContentScreenshotTaken struct { meta @@ -23553,6 +33455,33 @@ func (*PushMessageContentSticker) PushMessageContentType() string { return TypePushMessageContentSticker } +// A message with a story +type PushMessageContentStory struct { + meta + // True, if the message is a pinned message with the specified content + IsPinned bool `json:"is_pinned"` +} + +func (entity *PushMessageContentStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentStory + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentStory) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentStory) GetType() string { + return TypePushMessageContentStory +} + +func (*PushMessageContentStory) PushMessageContentType() string { + return TypePushMessageContentStory +} + // A text message type PushMessageContentText struct { meta @@ -23781,10 +33710,37 @@ func (*PushMessageContentChatChangeTitle) PushMessageContentType() string { return TypePushMessageContentChatChangeTitle } +// A chat background was edited +type PushMessageContentChatSetBackground struct { + meta + // True, if the set background is the same as the background of the current user + IsSame bool `json:"is_same"` +} + +func (entity *PushMessageContentChatSetBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentChatSetBackground + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentChatSetBackground) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentChatSetBackground) GetType() string { + return TypePushMessageContentChatSetBackground +} + +func (*PushMessageContentChatSetBackground) PushMessageContentType() string { + return TypePushMessageContentChatSetBackground +} + // A chat theme was edited type PushMessageContentChatSetTheme struct { meta - // If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one + // If non-empty, name of a new theme, set for the chat. Otherwise, the chat theme was reset to the default one ThemeName string `json:"theme_name"` } @@ -23889,6 +33845,58 @@ func (*PushMessageContentChatJoinByRequest) PushMessageContentType() string { return TypePushMessageContentChatJoinByRequest } +// A new recurring payment was made by the current user +type PushMessageContentRecurringPayment struct { + meta + // The paid amount + Amount string `json:"amount"` +} + +func (entity *PushMessageContentRecurringPayment) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentRecurringPayment + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentRecurringPayment) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentRecurringPayment) GetType() string { + return TypePushMessageContentRecurringPayment +} + +func (*PushMessageContentRecurringPayment) PushMessageContentType() string { + return TypePushMessageContentRecurringPayment +} + +// A profile photo was suggested to the user +type PushMessageContentSuggestProfilePhoto struct { + meta +} + +func (entity *PushMessageContentSuggestProfilePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentSuggestProfilePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentSuggestProfilePhoto) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentSuggestProfilePhoto) GetType() string { + return TypePushMessageContentSuggestProfilePhoto +} + +func (*PushMessageContentSuggestProfilePhoto) PushMessageContentType() string { + return TypePushMessageContentSuggestProfilePhoto +} + // A forwarded messages type PushMessageContentMessageForwards struct { meta @@ -23923,7 +33931,7 @@ type PushMessageContentMediaAlbum struct { TotalCount int32 `json:"total_count"` // True, if the album has at least one photo HasPhotos bool `json:"has_photos"` - // True, if the album has at least one video + // True, if the album has at least one video file HasVideos bool `json:"has_videos"` // True, if the album has at least one audio file HasAudios bool `json:"has_audios"` @@ -23956,6 +33964,8 @@ type NotificationTypeNewMessage struct { meta // The message Message *Message `json:"message"` + // True, if message content must be displayed in notifications + ShowPreview bool `json:"show_preview"` } func (entity *NotificationTypeNewMessage) MarshalJSON() ([]byte, error) { @@ -24033,7 +34043,7 @@ func (*NotificationTypeNewCall) NotificationTypeType() string { // New message was received through a push notification type NotificationTypeNewPushMessage struct { meta - // The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id + // The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat MessageId int64 `json:"message_id"` // Identifier of the sender of the message. Corresponding user or chat may be inaccessible SenderId MessageSender `json:"sender_id"` @@ -24192,6 +34202,62 @@ func (*NotificationGroupTypeCalls) NotificationGroupTypeType() string { return TypeNotificationGroupTypeCalls } +// Describes a notification sound in MP3 format +type NotificationSound struct { + meta + // Unique identifier of the notification sound + Id JsonInt64 `json:"id"` + // Duration of the sound, in seconds + Duration int32 `json:"duration"` + // Point in time (Unix timestamp) when the sound was created + Date int32 `json:"date"` + // Title of the notification sound + Title string `json:"title"` + // Arbitrary data, defined while the sound was uploaded + Data string `json:"data"` + // File containing the sound + Sound *File `json:"sound"` +} + +func (entity *NotificationSound) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSound + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSound) GetClass() string { + return ClassNotificationSound +} + +func (*NotificationSound) GetType() string { + return TypeNotificationSound +} + +// Contains a list of notification sounds +type NotificationSounds struct { + meta + // A list of notification sounds + NotificationSounds []*NotificationSound `json:"notification_sounds"` +} + +func (entity *NotificationSounds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSounds + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSounds) GetClass() string { + return ClassNotificationSounds +} + +func (*NotificationSounds) GetType() string { + return TypeNotificationSounds +} + // Contains information about a notification type Notification struct { meta @@ -24199,7 +34265,7 @@ type Notification struct { Id int32 `json:"id"` // Notification date Date int32 `json:"date"` - // True, if the notification was initially silent + // True, if the notification was explicitly sent without sound IsSilent bool `json:"is_silent"` // Notification type Type NotificationType `json:"type"` @@ -24626,6 +34692,112 @@ func (*JsonValueObject) JsonValueType() string { return TypeJsonValueObject } +// The story can be viewed by everyone +type StoryPrivacySettingsEveryone struct { + meta + // Identifiers of the users that can't see the story; always unknown and empty for non-owned stories + ExceptUserIds []int64 `json:"except_user_ids"` +} + +func (entity *StoryPrivacySettingsEveryone) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsEveryone + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsEveryone) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsEveryone) GetType() string { + return TypeStoryPrivacySettingsEveryone +} + +func (*StoryPrivacySettingsEveryone) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsEveryone +} + +// The story can be viewed by all contacts except chosen users +type StoryPrivacySettingsContacts struct { + meta + // User identifiers of the contacts that can't see the story; always unknown and empty for non-owned stories + ExceptUserIds []int64 `json:"except_user_ids"` +} + +func (entity *StoryPrivacySettingsContacts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsContacts + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsContacts) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsContacts) GetType() string { + return TypeStoryPrivacySettingsContacts +} + +func (*StoryPrivacySettingsContacts) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsContacts +} + +// The story can be viewed by all close friends +type StoryPrivacySettingsCloseFriends struct { + meta +} + +func (entity *StoryPrivacySettingsCloseFriends) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsCloseFriends + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsCloseFriends) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsCloseFriends) GetType() string { + return TypeStoryPrivacySettingsCloseFriends +} + +func (*StoryPrivacySettingsCloseFriends) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsCloseFriends +} + +// The story can be viewed by certain specified users +type StoryPrivacySettingsSelectedUsers struct { + meta + // Identifiers of the users; always unknown and empty for non-owned stories + UserIds []int64 `json:"user_ids"` +} + +func (entity *StoryPrivacySettingsSelectedUsers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsSelectedUsers + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsSelectedUsers) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsSelectedUsers) GetType() string { + return TypeStoryPrivacySettingsSelectedUsers +} + +func (*StoryPrivacySettingsSelectedUsers) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsSelectedUsers +} + // A rule to allow all users to do something type UserPrivacySettingRuleAllowAll struct { meta @@ -24651,7 +34823,7 @@ func (*UserPrivacySettingRuleAllowAll) UserPrivacySettingRuleType() string { return TypeUserPrivacySettingRuleAllowAll } -// A rule to allow all of a user's contacts to do something +// A rule to allow all contacts of the user to do something type UserPrivacySettingRuleAllowContacts struct { meta } @@ -24755,7 +34927,7 @@ func (*UserPrivacySettingRuleRestrictAll) UserPrivacySettingRuleType() string { return TypeUserPrivacySettingRuleRestrictAll } -// A rule to restrict all contacts of a user from doing something +// A rule to restrict all contacts of the user from doing something type UserPrivacySettingRuleRestrictContacts struct { meta } @@ -24973,6 +35145,31 @@ func (*UserPrivacySettingShowPhoneNumber) UserPrivacySettingType() string { return TypeUserPrivacySettingShowPhoneNumber } +// A privacy setting for managing whether the user's bio is visible +type UserPrivacySettingShowBio struct { + meta +} + +func (entity *UserPrivacySettingShowBio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingShowBio + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingShowBio) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingShowBio) GetType() string { + return TypeUserPrivacySettingShowBio +} + +func (*UserPrivacySettingShowBio) UserPrivacySettingType() string { + return TypeUserPrivacySettingShowBio +} + // A privacy setting for managing whether the user can be invited to chats type UserPrivacySettingAllowChatInvites struct { meta @@ -25073,6 +35270,31 @@ func (*UserPrivacySettingAllowFindingByPhoneNumber) UserPrivacySettingType() str return TypeUserPrivacySettingAllowFindingByPhoneNumber } +// A privacy setting for managing whether the user can receive voice and video messages in private chats +type UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages struct { + meta +} + +func (entity *UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) GetType() string { + return TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages +} + +func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) UserPrivacySettingType() string { + return TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages +} + // Contains information about the period of inactivity after which the current user's account will automatically be deleted type AccountTtl struct { meta @@ -25096,6 +35318,454 @@ func (*AccountTtl) GetType() string { return TypeAccountTtl } +// Contains default auto-delete timer setting for new chats +type MessageAutoDeleteTime struct { + meta + // Message auto-delete time, in seconds. If 0, then messages aren't deleted automatically + Time int32 `json:"time"` +} + +func (entity *MessageAutoDeleteTime) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageAutoDeleteTime + + return json.Marshal((*stub)(entity)) +} + +func (*MessageAutoDeleteTime) GetClass() string { + return ClassMessageAutoDeleteTime +} + +func (*MessageAutoDeleteTime) GetType() string { + return TypeMessageAutoDeleteTime +} + +// The session is running on an Android device +type SessionTypeAndroid struct { + meta +} + +func (entity *SessionTypeAndroid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeAndroid + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeAndroid) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeAndroid) GetType() string { + return TypeSessionTypeAndroid +} + +func (*SessionTypeAndroid) SessionTypeType() string { + return TypeSessionTypeAndroid +} + +// The session is running on a generic Apple device +type SessionTypeApple struct { + meta +} + +func (entity *SessionTypeApple) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeApple + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeApple) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeApple) GetType() string { + return TypeSessionTypeApple +} + +func (*SessionTypeApple) SessionTypeType() string { + return TypeSessionTypeApple +} + +// The session is running on the Brave browser +type SessionTypeBrave struct { + meta +} + +func (entity *SessionTypeBrave) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeBrave + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeBrave) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeBrave) GetType() string { + return TypeSessionTypeBrave +} + +func (*SessionTypeBrave) SessionTypeType() string { + return TypeSessionTypeBrave +} + +// The session is running on the Chrome browser +type SessionTypeChrome struct { + meta +} + +func (entity *SessionTypeChrome) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeChrome + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeChrome) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeChrome) GetType() string { + return TypeSessionTypeChrome +} + +func (*SessionTypeChrome) SessionTypeType() string { + return TypeSessionTypeChrome +} + +// The session is running on the Edge browser +type SessionTypeEdge struct { + meta +} + +func (entity *SessionTypeEdge) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeEdge + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeEdge) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeEdge) GetType() string { + return TypeSessionTypeEdge +} + +func (*SessionTypeEdge) SessionTypeType() string { + return TypeSessionTypeEdge +} + +// The session is running on the Firefox browser +type SessionTypeFirefox struct { + meta +} + +func (entity *SessionTypeFirefox) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeFirefox + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeFirefox) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeFirefox) GetType() string { + return TypeSessionTypeFirefox +} + +func (*SessionTypeFirefox) SessionTypeType() string { + return TypeSessionTypeFirefox +} + +// The session is running on an iPad device +type SessionTypeIpad struct { + meta +} + +func (entity *SessionTypeIpad) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeIpad + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeIpad) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeIpad) GetType() string { + return TypeSessionTypeIpad +} + +func (*SessionTypeIpad) SessionTypeType() string { + return TypeSessionTypeIpad +} + +// The session is running on an iPhone device +type SessionTypeIphone struct { + meta +} + +func (entity *SessionTypeIphone) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeIphone + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeIphone) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeIphone) GetType() string { + return TypeSessionTypeIphone +} + +func (*SessionTypeIphone) SessionTypeType() string { + return TypeSessionTypeIphone +} + +// The session is running on a Linux device +type SessionTypeLinux struct { + meta +} + +func (entity *SessionTypeLinux) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeLinux + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeLinux) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeLinux) GetType() string { + return TypeSessionTypeLinux +} + +func (*SessionTypeLinux) SessionTypeType() string { + return TypeSessionTypeLinux +} + +// The session is running on a Mac device +type SessionTypeMac struct { + meta +} + +func (entity *SessionTypeMac) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeMac + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeMac) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeMac) GetType() string { + return TypeSessionTypeMac +} + +func (*SessionTypeMac) SessionTypeType() string { + return TypeSessionTypeMac +} + +// The session is running on the Opera browser +type SessionTypeOpera struct { + meta +} + +func (entity *SessionTypeOpera) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeOpera + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeOpera) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeOpera) GetType() string { + return TypeSessionTypeOpera +} + +func (*SessionTypeOpera) SessionTypeType() string { + return TypeSessionTypeOpera +} + +// The session is running on the Safari browser +type SessionTypeSafari struct { + meta +} + +func (entity *SessionTypeSafari) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeSafari + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeSafari) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeSafari) GetType() string { + return TypeSessionTypeSafari +} + +func (*SessionTypeSafari) SessionTypeType() string { + return TypeSessionTypeSafari +} + +// The session is running on an Ubuntu device +type SessionTypeUbuntu struct { + meta +} + +func (entity *SessionTypeUbuntu) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeUbuntu + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeUbuntu) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeUbuntu) GetType() string { + return TypeSessionTypeUbuntu +} + +func (*SessionTypeUbuntu) SessionTypeType() string { + return TypeSessionTypeUbuntu +} + +// The session is running on an unknown type of device +type SessionTypeUnknown struct { + meta +} + +func (entity *SessionTypeUnknown) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeUnknown + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeUnknown) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeUnknown) GetType() string { + return TypeSessionTypeUnknown +} + +func (*SessionTypeUnknown) SessionTypeType() string { + return TypeSessionTypeUnknown +} + +// The session is running on the Vivaldi browser +type SessionTypeVivaldi struct { + meta +} + +func (entity *SessionTypeVivaldi) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeVivaldi + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeVivaldi) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeVivaldi) GetType() string { + return TypeSessionTypeVivaldi +} + +func (*SessionTypeVivaldi) SessionTypeType() string { + return TypeSessionTypeVivaldi +} + +// The session is running on a Windows device +type SessionTypeWindows struct { + meta +} + +func (entity *SessionTypeWindows) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeWindows + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeWindows) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeWindows) GetType() string { + return TypeSessionTypeWindows +} + +func (*SessionTypeWindows) SessionTypeType() string { + return TypeSessionTypeWindows +} + +// The session is running on an Xbox console +type SessionTypeXbox struct { + meta +} + +func (entity *SessionTypeXbox) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SessionTypeXbox + + return json.Marshal((*stub)(entity)) +} + +func (*SessionTypeXbox) GetClass() string { + return ClassSessionType +} + +func (*SessionTypeXbox) GetType() string { + return TypeSessionTypeXbox +} + +func (*SessionTypeXbox) SessionTypeType() string { + return TypeSessionTypeXbox +} + // Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order type Session struct { meta @@ -25103,12 +35773,16 @@ type Session struct { Id JsonInt64 `json:"id"` // True, if this session is the current session IsCurrent bool `json:"is_current"` - // True, if a password is needed to complete authorization of the session + // True, if a 2-step verification password is needed to complete authorization of the session IsPasswordPending bool `json:"is_password_pending"` + // True, if the session wasn't confirmed from another session + IsUnconfirmed bool `json:"is_unconfirmed"` // True, if incoming secret chats can be accepted by the session CanAcceptSecretChats bool `json:"can_accept_secret_chats"` // True, if incoming calls can be accepted by the session CanAcceptCalls bool `json:"can_accept_calls"` + // Session type based on the system and application version, which can be used to display a corresponding icon + Type SessionType `json:"type"` // Telegram API identifier, as provided by the application ApiId int32 `json:"api_id"` // Name of the application, as provided by the application @@ -25128,11 +35802,9 @@ type Session struct { // Point in time (Unix timestamp) when the session was last used LastActiveDate int32 `json:"last_active_date"` // IP address from which the session was created, in human-readable format - Ip string `json:"ip"` - // A two-letter country code for the country from which the session was created, based on the IP address - Country string `json:"country"` - // Region code from which the session was created, based on the IP address - Region string `json:"region"` + IpAddress string `json:"ip_address"` + // A human-readable description of the location from which the session was created, based on the IP address + Location string `json:"location"` } func (entity *Session) MarshalJSON() ([]byte, error) { @@ -25151,6 +35823,57 @@ func (*Session) GetType() string { return TypeSession } +func (session *Session) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + IsCurrent bool `json:"is_current"` + IsPasswordPending bool `json:"is_password_pending"` + IsUnconfirmed bool `json:"is_unconfirmed"` + CanAcceptSecretChats bool `json:"can_accept_secret_chats"` + CanAcceptCalls bool `json:"can_accept_calls"` + Type json.RawMessage `json:"type"` + ApiId int32 `json:"api_id"` + ApplicationName string `json:"application_name"` + ApplicationVersion string `json:"application_version"` + IsOfficialApplication bool `json:"is_official_application"` + DeviceModel string `json:"device_model"` + Platform string `json:"platform"` + SystemVersion string `json:"system_version"` + LogInDate int32 `json:"log_in_date"` + LastActiveDate int32 `json:"last_active_date"` + IpAddress string `json:"ip_address"` + Location string `json:"location"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + session.Id = tmp.Id + session.IsCurrent = tmp.IsCurrent + session.IsPasswordPending = tmp.IsPasswordPending + session.IsUnconfirmed = tmp.IsUnconfirmed + session.CanAcceptSecretChats = tmp.CanAcceptSecretChats + session.CanAcceptCalls = tmp.CanAcceptCalls + session.ApiId = tmp.ApiId + session.ApplicationName = tmp.ApplicationName + session.ApplicationVersion = tmp.ApplicationVersion + session.IsOfficialApplication = tmp.IsOfficialApplication + session.DeviceModel = tmp.DeviceModel + session.Platform = tmp.Platform + session.SystemVersion = tmp.SystemVersion + session.LogInDate = tmp.LogInDate + session.LastActiveDate = tmp.LastActiveDate + session.IpAddress = tmp.IpAddress + session.Location = tmp.Location + + fieldType, _ := UnmarshalSessionType(tmp.Type) + session.Type = fieldType + + return nil +} + // Contains a list of sessions type Sessions struct { meta @@ -25176,6 +35899,35 @@ func (*Sessions) GetType() string { return TypeSessions } +// Contains information about an unconfirmed session +type UnconfirmedSession struct { + meta + // Session identifier + Id JsonInt64 `json:"id"` + // Point in time (Unix timestamp) when the user has logged in + LogInDate int32 `json:"log_in_date"` + // Model of the device that was used for the session creation, as provided by the application + DeviceModel string `json:"device_model"` + // A human-readable description of the location from which the session was created, based on the IP address + Location string `json:"location"` +} + +func (entity *UnconfirmedSession) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UnconfirmedSession + + return json.Marshal((*stub)(entity)) +} + +func (*UnconfirmedSession) GetClass() string { + return ClassUnconfirmedSession +} + +func (*UnconfirmedSession) GetType() string { + return TypeUnconfirmedSession +} + // Contains information about one website the current user is logged in with Telegram type ConnectedWebsite struct { meta @@ -25194,8 +35946,8 @@ type ConnectedWebsite struct { // Point in time (Unix timestamp) when obtained authorization was last used LastActiveDate int32 `json:"last_active_date"` // IP address from which the user was logged in, in human-readable format - Ip string `json:"ip"` - // Human-readable description of a country and a region, from which the user was logged in, based on the IP address + IpAddress string `json:"ip_address"` + // Human-readable description of a country and a region from which the user was logged in, based on the IP address Location string `json:"location"` } @@ -25239,206 +35991,357 @@ func (*ConnectedWebsites) GetType() string { } // The chat contains spam messages -type ChatReportReasonSpam struct { +type ReportReasonSpam struct { meta } -func (entity *ChatReportReasonSpam) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonSpam) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonSpam + type stub ReportReasonSpam return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonSpam) GetClass() string { - return ClassChatReportReason +func (*ReportReasonSpam) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonSpam) GetType() string { - return TypeChatReportReasonSpam +func (*ReportReasonSpam) GetType() string { + return TypeReportReasonSpam } -func (*ChatReportReasonSpam) ChatReportReasonType() string { - return TypeChatReportReasonSpam +func (*ReportReasonSpam) ReportReasonType() string { + return TypeReportReasonSpam } // The chat promotes violence -type ChatReportReasonViolence struct { +type ReportReasonViolence struct { meta } -func (entity *ChatReportReasonViolence) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonViolence) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonViolence + type stub ReportReasonViolence return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonViolence) GetClass() string { - return ClassChatReportReason +func (*ReportReasonViolence) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonViolence) GetType() string { - return TypeChatReportReasonViolence +func (*ReportReasonViolence) GetType() string { + return TypeReportReasonViolence } -func (*ChatReportReasonViolence) ChatReportReasonType() string { - return TypeChatReportReasonViolence +func (*ReportReasonViolence) ReportReasonType() string { + return TypeReportReasonViolence } // The chat contains pornographic messages -type ChatReportReasonPornography struct { +type ReportReasonPornography struct { meta } -func (entity *ChatReportReasonPornography) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonPornography) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonPornography + type stub ReportReasonPornography return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonPornography) GetClass() string { - return ClassChatReportReason +func (*ReportReasonPornography) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonPornography) GetType() string { - return TypeChatReportReasonPornography +func (*ReportReasonPornography) GetType() string { + return TypeReportReasonPornography } -func (*ChatReportReasonPornography) ChatReportReasonType() string { - return TypeChatReportReasonPornography +func (*ReportReasonPornography) ReportReasonType() string { + return TypeReportReasonPornography } // The chat has child abuse related content -type ChatReportReasonChildAbuse struct { +type ReportReasonChildAbuse struct { meta } -func (entity *ChatReportReasonChildAbuse) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonChildAbuse) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonChildAbuse + type stub ReportReasonChildAbuse return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonChildAbuse) GetClass() string { - return ClassChatReportReason +func (*ReportReasonChildAbuse) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonChildAbuse) GetType() string { - return TypeChatReportReasonChildAbuse +func (*ReportReasonChildAbuse) GetType() string { + return TypeReportReasonChildAbuse } -func (*ChatReportReasonChildAbuse) ChatReportReasonType() string { - return TypeChatReportReasonChildAbuse +func (*ReportReasonChildAbuse) ReportReasonType() string { + return TypeReportReasonChildAbuse } // The chat contains copyrighted content -type ChatReportReasonCopyright struct { +type ReportReasonCopyright struct { meta } -func (entity *ChatReportReasonCopyright) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonCopyright) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonCopyright + type stub ReportReasonCopyright return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonCopyright) GetClass() string { - return ClassChatReportReason +func (*ReportReasonCopyright) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonCopyright) GetType() string { - return TypeChatReportReasonCopyright +func (*ReportReasonCopyright) GetType() string { + return TypeReportReasonCopyright } -func (*ChatReportReasonCopyright) ChatReportReasonType() string { - return TypeChatReportReasonCopyright +func (*ReportReasonCopyright) ReportReasonType() string { + return TypeReportReasonCopyright } // The location-based chat is unrelated to its stated location -type ChatReportReasonUnrelatedLocation struct { +type ReportReasonUnrelatedLocation struct { meta } -func (entity *ChatReportReasonUnrelatedLocation) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonUnrelatedLocation) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonUnrelatedLocation + type stub ReportReasonUnrelatedLocation return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonUnrelatedLocation) GetClass() string { - return ClassChatReportReason +func (*ReportReasonUnrelatedLocation) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonUnrelatedLocation) GetType() string { - return TypeChatReportReasonUnrelatedLocation +func (*ReportReasonUnrelatedLocation) GetType() string { + return TypeReportReasonUnrelatedLocation } -func (*ChatReportReasonUnrelatedLocation) ChatReportReasonType() string { - return TypeChatReportReasonUnrelatedLocation +func (*ReportReasonUnrelatedLocation) ReportReasonType() string { + return TypeReportReasonUnrelatedLocation } // The chat represents a fake account -type ChatReportReasonFake struct { +type ReportReasonFake struct { meta } -func (entity *ChatReportReasonFake) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonFake) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonFake + type stub ReportReasonFake return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonFake) GetClass() string { - return ClassChatReportReason +func (*ReportReasonFake) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonFake) GetType() string { - return TypeChatReportReasonFake +func (*ReportReasonFake) GetType() string { + return TypeReportReasonFake } -func (*ChatReportReasonFake) ChatReportReasonType() string { - return TypeChatReportReasonFake +func (*ReportReasonFake) ReportReasonType() string { + return TypeReportReasonFake +} + +// The chat has illegal drugs related content +type ReportReasonIllegalDrugs struct { + meta +} + +func (entity *ReportReasonIllegalDrugs) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportReasonIllegalDrugs + + return json.Marshal((*stub)(entity)) +} + +func (*ReportReasonIllegalDrugs) GetClass() string { + return ClassReportReason +} + +func (*ReportReasonIllegalDrugs) GetType() string { + return TypeReportReasonIllegalDrugs +} + +func (*ReportReasonIllegalDrugs) ReportReasonType() string { + return TypeReportReasonIllegalDrugs +} + +// The chat contains messages with personal details +type ReportReasonPersonalDetails struct { + meta +} + +func (entity *ReportReasonPersonalDetails) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportReasonPersonalDetails + + return json.Marshal((*stub)(entity)) +} + +func (*ReportReasonPersonalDetails) GetClass() string { + return ClassReportReason +} + +func (*ReportReasonPersonalDetails) GetType() string { + return TypeReportReasonPersonalDetails +} + +func (*ReportReasonPersonalDetails) ReportReasonType() string { + return TypeReportReasonPersonalDetails } // A custom reason provided by the user -type ChatReportReasonCustom struct { +type ReportReasonCustom struct { meta } -func (entity *ChatReportReasonCustom) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonCustom) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonCustom + type stub ReportReasonCustom return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonCustom) GetClass() string { - return ClassChatReportReason +func (*ReportReasonCustom) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonCustom) GetType() string { - return TypeChatReportReasonCustom +func (*ReportReasonCustom) GetType() string { + return TypeReportReasonCustom } -func (*ChatReportReasonCustom) ChatReportReasonType() string { - return TypeChatReportReasonCustom +func (*ReportReasonCustom) ReportReasonType() string { + return TypeReportReasonCustom } -// The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link +// The currently opened chat needs to be kept +type TargetChatCurrent struct { + meta +} + +func (entity *TargetChatCurrent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TargetChatCurrent + + return json.Marshal((*stub)(entity)) +} + +func (*TargetChatCurrent) GetClass() string { + return ClassTargetChat +} + +func (*TargetChatCurrent) GetType() string { + return TypeTargetChatCurrent +} + +func (*TargetChatCurrent) TargetChatType() string { + return TypeTargetChatCurrent +} + +// The chat needs to be chosen by the user among chats of the specified types +type TargetChatChosen struct { + meta + // True, if private chats with ordinary users are allowed + AllowUserChats bool `json:"allow_user_chats"` + // True, if private chats with other bots are allowed + AllowBotChats bool `json:"allow_bot_chats"` + // True, if basic group and supergroup chats are allowed + AllowGroupChats bool `json:"allow_group_chats"` + // True, if channel chats are allowed + AllowChannelChats bool `json:"allow_channel_chats"` +} + +func (entity *TargetChatChosen) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TargetChatChosen + + return json.Marshal((*stub)(entity)) +} + +func (*TargetChatChosen) GetClass() string { + return ClassTargetChat +} + +func (*TargetChatChosen) GetType() string { + return TypeTargetChatChosen +} + +func (*TargetChatChosen) TargetChatType() string { + return TypeTargetChatChosen +} + +// The chat needs to be open with the provided internal link +type TargetChatInternalLink struct { + meta + // An internal link pointing to the chat + Link InternalLinkType `json:"link"` +} + +func (entity *TargetChatInternalLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TargetChatInternalLink + + return json.Marshal((*stub)(entity)) +} + +func (*TargetChatInternalLink) GetClass() string { + return ClassTargetChat +} + +func (*TargetChatInternalLink) GetType() string { + return TypeTargetChatInternalLink +} + +func (*TargetChatInternalLink) TargetChatType() string { + return TypeTargetChatInternalLink +} + +func (targetChatInternalLink *TargetChatInternalLink) UnmarshalJSON(data []byte) error { + var tmp struct { + Link json.RawMessage `json:"link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + targetChatInternalLink.Link = fieldLink + + return nil +} + +// The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link type InternalLinkTypeActiveSessions struct { meta } @@ -25463,6 +36366,58 @@ func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string { return TypeInternalLinkTypeActiveSessions } +// The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL +type InternalLinkTypeAttachmentMenuBot struct { + meta + // Target chat to be opened + TargetChat TargetChat `json:"target_chat"` + // Username of the bot + BotUsername string `json:"bot_username"` + // URL to be passed to openWebApp + Url string `json:"url"` +} + +func (entity *InternalLinkTypeAttachmentMenuBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeAttachmentMenuBot + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeAttachmentMenuBot) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeAttachmentMenuBot) GetType() string { + return TypeInternalLinkTypeAttachmentMenuBot +} + +func (*InternalLinkTypeAttachmentMenuBot) InternalLinkTypeType() string { + return TypeInternalLinkTypeAttachmentMenuBot +} + +func (internalLinkTypeAttachmentMenuBot *InternalLinkTypeAttachmentMenuBot) UnmarshalJSON(data []byte) error { + var tmp struct { + TargetChat json.RawMessage `json:"target_chat"` + BotUsername string `json:"bot_username"` + Url string `json:"url"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + internalLinkTypeAttachmentMenuBot.BotUsername = tmp.BotUsername + internalLinkTypeAttachmentMenuBot.Url = tmp.Url + + fieldTargetChat, _ := UnmarshalTargetChat(tmp.TargetChat) + internalLinkTypeAttachmentMenuBot.TargetChat = fieldTargetChat + + return nil +} + // The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode type InternalLinkTypeAuthenticationCode struct { meta @@ -25517,6 +36472,35 @@ func (*InternalLinkTypeBackground) InternalLinkTypeType() string { return TypeInternalLinkTypeBackground } +// The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights +type InternalLinkTypeBotAddToChannel struct { + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // Expected administrator rights for the bot + AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` +} + +func (entity *InternalLinkTypeBotAddToChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeBotAddToChannel + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeBotAddToChannel) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeBotAddToChannel) GetType() string { + return TypeInternalLinkTypeBotAddToChannel +} + +func (*InternalLinkTypeBotAddToChannel) InternalLinkTypeType() string { + return TypeInternalLinkTypeBotAddToChannel +} + // The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed type InternalLinkTypeBotStart struct { meta @@ -25524,6 +36508,8 @@ type InternalLinkTypeBotStart struct { BotUsername string `json:"bot_username"` // The parameter to be passed to sendBotStartMessage StartParameter string `json:"start_parameter"` + // True, if sendBotStartMessage must be called automatically without showing the START button + Autostart bool `json:"autostart"` } func (entity *InternalLinkTypeBotStart) MarshalJSON() ([]byte, error) { @@ -25546,13 +36532,15 @@ func (*InternalLinkTypeBotStart) InternalLinkTypeType() string { return TypeInternalLinkTypeBotStart } -// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group +// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot's username added to the chat. type InternalLinkTypeBotStartInGroup struct { meta // Username of the bot BotUsername string `json:"bot_username"` // The parameter to be passed to sendBotStartMessage StartParameter string `json:"start_parameter"` + // Expected administrator rights for the bot; may be null + AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` } func (entity *InternalLinkTypeBotStartInGroup) MarshalJSON() ([]byte, error) { @@ -25600,6 +36588,85 @@ func (*InternalLinkTypeChangePhoneNumber) InternalLinkTypeType() string { return TypeInternalLinkTypeChangePhoneNumber } +// The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. If the user wants to boost the chat and the chat can be boosted, then call boostChat +type InternalLinkTypeChatBoost struct { + meta + // URL to be passed to getChatBoostLinkInfo + Url string `json:"url"` +} + +func (entity *InternalLinkTypeChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChatBoost) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChatBoost) GetType() string { + return TypeInternalLinkTypeChatBoost +} + +func (*InternalLinkTypeChatBoost) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatBoost +} + +// The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link +type InternalLinkTypeChatFolderInvite struct { + meta + // Internal representation of the invite link + InviteLink string `json:"invite_link"` +} + +func (entity *InternalLinkTypeChatFolderInvite) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChatFolderInvite + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChatFolderInvite) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChatFolderInvite) GetType() string { + return TypeInternalLinkTypeChatFolderInvite +} + +func (*InternalLinkTypeChatFolderInvite) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatFolderInvite +} + +// The link is a link to the folder section of the app settings +type InternalLinkTypeChatFolderSettings struct { + meta +} + +func (entity *InternalLinkTypeChatFolderSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChatFolderSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChatFolderSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChatFolderSettings) GetType() string { + return TypeInternalLinkTypeChatFolderSettings +} + +func (*InternalLinkTypeChatFolderSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatFolderSettings +} + // The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link type InternalLinkTypeChatInvite struct { meta @@ -25627,29 +36694,54 @@ func (*InternalLinkTypeChatInvite) InternalLinkTypeType() string { return TypeInternalLinkTypeChatInvite } -// The link is a link to the filter settings section of the app -type InternalLinkTypeFilterSettings struct { +// The link is a link to the default message auto-delete timer settings section of the app settings +type InternalLinkTypeDefaultMessageAutoDeleteTimerSettings struct { meta } -func (entity *InternalLinkTypeFilterSettings) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeFilterSettings + type stub InternalLinkTypeDefaultMessageAutoDeleteTimerSettings return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeFilterSettings) GetClass() string { +func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeFilterSettings) GetType() string { - return TypeInternalLinkTypeFilterSettings +func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetType() string { + return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings } -func (*InternalLinkTypeFilterSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeFilterSettings +func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings +} + +// The link is a link to the edit profile section of the app settings +type InternalLinkTypeEditProfileSettings struct { + meta +} + +func (entity *InternalLinkTypeEditProfileSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeEditProfileSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeEditProfileSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeEditProfileSettings) GetType() string { + return TypeInternalLinkTypeEditProfileSettings +} + +func (*InternalLinkTypeEditProfileSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeEditProfileSettings } // The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame @@ -25681,6 +36773,62 @@ func (*InternalLinkTypeGame) InternalLinkTypeType() string { return TypeInternalLinkTypeGame } +// The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link +type InternalLinkTypeInstantView struct { + meta + // URL to be passed to getWebPageInstantView + Url string `json:"url"` + // An URL to open if getWebPageInstantView fails + FallbackUrl string `json:"fallback_url"` +} + +func (entity *InternalLinkTypeInstantView) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeInstantView + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeInstantView) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeInstantView) GetType() string { + return TypeInternalLinkTypeInstantView +} + +func (*InternalLinkTypeInstantView) InternalLinkTypeType() string { + return TypeInternalLinkTypeInstantView +} + +// The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link +type InternalLinkTypeInvoice struct { + meta + // Name of the invoice + InvoiceName string `json:"invoice_name"` +} + +func (entity *InternalLinkTypeInvoice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeInvoice + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeInvoice) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeInvoice) GetType() string { + return TypeInternalLinkTypeInvoice +} + +func (*InternalLinkTypeInvoice) InternalLinkTypeType() string { + return TypeInternalLinkTypeInvoice +} + // The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link type InternalLinkTypeLanguagePack struct { meta @@ -25708,7 +36856,32 @@ func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string { return TypeInternalLinkTypeLanguagePack } -// The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link +// The link is a link to the language section of the app settings +type InternalLinkTypeLanguageSettings struct { + meta +} + +func (entity *InternalLinkTypeLanguageSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeLanguageSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeLanguageSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeLanguageSettings) GetType() string { + return TypeInternalLinkTypeLanguageSettings +} + +func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeLanguageSettings +} + +// The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link type InternalLinkTypeMessage struct { meta // URL to be passed to getMessageLinkInfo @@ -25764,7 +36937,7 @@ func (*InternalLinkTypeMessageDraft) InternalLinkTypeType() string { return TypeInternalLinkTypeMessageDraft } -// The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the app, otherwise ignore it +// The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it type InternalLinkTypePassportDataRequest struct { meta // User identifier of the service's bot @@ -25775,7 +36948,7 @@ type InternalLinkTypePassportDataRequest struct { PublicKey string `json:"public_key"` // Unique request identifier provided by the service Nonce string `json:"nonce"` - // An HTTP URL to open once the request is finished or canceled with the parameter tg_passport=success or tg_passport=cancel respectively. If empty, then the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel needs to be opened instead + // An HTTP URL to open once the request is finished, canceled, or failed with the parameters tg_passport=success, tg_passport=cancel, or tg_passport=error&error=... respectively. If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise CallbackUrl string `json:"callback_url"` } @@ -25828,10 +37001,89 @@ func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string { return TypeInternalLinkTypePhoneNumberConfirmation } +// The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link +type InternalLinkTypePremiumFeatures struct { + meta + // Referrer specified in the link + Referrer string `json:"referrer"` +} + +func (entity *InternalLinkTypePremiumFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePremiumFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePremiumFeatures) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePremiumFeatures) GetType() string { + return TypeInternalLinkTypePremiumFeatures +} + +func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumFeatures +} + +// The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode +type InternalLinkTypePremiumGiftCode struct { + meta + // The Telegram Premium gift code + Code string `json:"code"` +} + +func (entity *InternalLinkTypePremiumGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePremiumGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePremiumGiftCode) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePremiumGiftCode) GetType() string { + return TypeInternalLinkTypePremiumGiftCode +} + +func (*InternalLinkTypePremiumGiftCode) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumGiftCode +} + +// The link is a link to the privacy and security section of the app settings +type InternalLinkTypePrivacyAndSecuritySettings struct { + meta +} + +func (entity *InternalLinkTypePrivacyAndSecuritySettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePrivacyAndSecuritySettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePrivacyAndSecuritySettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePrivacyAndSecuritySettings) GetType() string { + return TypeInternalLinkTypePrivacyAndSecuritySettings +} + +func (*InternalLinkTypePrivacyAndSecuritySettings) InternalLinkTypeType() string { + return TypeInternalLinkTypePrivacyAndSecuritySettings +} + // The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy type InternalLinkTypeProxy struct { meta - // Proxy server IP address + // Proxy server domain or IP address Server string `json:"server"` // Proxy server port Port int32 `json:"port"` @@ -25932,7 +37184,32 @@ func (*InternalLinkTypeQrCodeAuthentication) InternalLinkTypeType() string { return TypeInternalLinkTypeQrCodeAuthentication } -// The link is a link to app settings +// The link forces restore of App Store purchases when opened. For official iOS application only +type InternalLinkTypeRestorePurchases struct { + meta +} + +func (entity *InternalLinkTypeRestorePurchases) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeRestorePurchases + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeRestorePurchases) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeRestorePurchases) GetType() string { + return TypeInternalLinkTypeRestorePurchases +} + +func (*InternalLinkTypeRestorePurchases) InternalLinkTypeType() string { + return TypeInternalLinkTypeRestorePurchases +} + +// The link is a link to application settings type InternalLinkTypeSettings struct { meta } @@ -25957,11 +37234,42 @@ func (*InternalLinkTypeSettings) InternalLinkTypeType() string { return TypeInternalLinkTypeSettings } +// The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the bot is added to side menu, then use getWebAppUrl with the given URL +type InternalLinkTypeSideMenuBot struct { + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // URL to be passed to getWebAppUrl + Url string `json:"url"` +} + +func (entity *InternalLinkTypeSideMenuBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeSideMenuBot + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeSideMenuBot) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeSideMenuBot) GetType() string { + return TypeInternalLinkTypeSideMenuBot +} + +func (*InternalLinkTypeSideMenuBot) InternalLinkTypeType() string { + return TypeInternalLinkTypeSideMenuBot +} + // The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set type InternalLinkTypeStickerSet struct { meta // Name of the sticker set StickerSetName string `json:"sticker_set_name"` + // True, if the sticker set is expected to contain custom emoji + ExpectCustomEmoji bool `json:"expect_custom_emoji"` } func (entity *InternalLinkTypeStickerSet) MarshalJSON() ([]byte, error) { @@ -25984,6 +37292,35 @@ func (*InternalLinkTypeStickerSet) InternalLinkTypeType() string { return TypeInternalLinkTypeStickerSet } +// The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier +type InternalLinkTypeStory struct { + meta + // Username of the sender of the story + StorySenderUsername string `json:"story_sender_username"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *InternalLinkTypeStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeStory + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeStory) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeStory) GetType() string { + return TypeInternalLinkTypeStory +} + +func (*InternalLinkTypeStory) InternalLinkTypeType() string { + return TypeInternalLinkTypeStory +} + // The link is a link to a theme. TDLib has no theme support yet type InternalLinkTypeTheme struct { meta @@ -26011,7 +37348,7 @@ func (*InternalLinkTypeTheme) InternalLinkTypeType() string { return TypeInternalLinkTypeTheme } -// The link is a link to the theme settings section of the app +// The link is a link to the theme section of the app settings type InternalLinkTypeThemeSettings struct { meta } @@ -26088,7 +37425,61 @@ func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { return TypeInternalLinkTypeUnsupportedProxy } -// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link +// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link +type InternalLinkTypeUserPhoneNumber struct { + meta + // Phone number of the user + PhoneNumber string `json:"phone_number"` +} + +func (entity *InternalLinkTypeUserPhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeUserPhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeUserPhoneNumber) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeUserPhoneNumber) GetType() string { + return TypeInternalLinkTypeUserPhoneNumber +} + +func (*InternalLinkTypeUserPhoneNumber) InternalLinkTypeType() string { + return TypeInternalLinkTypeUserPhoneNumber +} + +// The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link +type InternalLinkTypeUserToken struct { + meta + // The token + Token string `json:"token"` +} + +func (entity *InternalLinkTypeUserToken) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeUserToken + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeUserToken) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeUserToken) GetType() string { + return TypeInternalLinkTypeUserToken +} + +func (*InternalLinkTypeUserToken) InternalLinkTypeType() string { + return TypeInternalLinkTypeUserToken +} + +// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link type InternalLinkTypeVideoChat struct { meta // Username of the chat with the video chat @@ -26119,10 +37510,41 @@ func (*InternalLinkTypeVideoChat) InternalLinkTypeType() string { return TypeInternalLinkTypeVideoChat } -// Contains an HTTPS link to a message in a supergroup or channel +// The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being a third-party apps instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App +type InternalLinkTypeWebApp struct { + meta + // Username of the bot that owns the Web App + BotUsername string `json:"bot_username"` + // Short name of the Web App + WebAppShortName string `json:"web_app_short_name"` + // Start parameter to be passed to getWebAppLinkUrl + StartParameter string `json:"start_parameter"` +} + +func (entity *InternalLinkTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeWebApp) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeWebApp) GetType() string { + return TypeInternalLinkTypeWebApp +} + +func (*InternalLinkTypeWebApp) InternalLinkTypeType() string { + return TypeInternalLinkTypeWebApp +} + +// Contains an HTTPS link to a message in a supergroup or channel, or a forum topic type MessageLink struct { meta - // Message link + // The link Link string `json:"link"` // True, if the link will work for non-members of the chat IsPublic bool `json:"is_public"` @@ -26144,21 +37566,21 @@ func (*MessageLink) GetType() string { return TypeMessageLink } -// Contains information about a link to a message in a chat +// Contains information about a link to a message or a forum topic in a chat type MessageLinkInfo struct { meta - // True, if the link is a public link for a message in a chat + // True, if the link is a public link for a message or a forum topic in a chat IsPublic bool `json:"is_public"` - // If found, identifier of the chat to which the message belongs, 0 otherwise + // If found, identifier of the chat to which the link points, 0 otherwise ChatId int64 `json:"chat_id"` + // If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing + MessageThreadId int64 `json:"message_thread_id"` // If found, the linked message; may be null Message *Message `json:"message"` - // Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview + // Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview MediaTimestamp int32 `json:"media_timestamp"` // True, if the whole media album to which the message belongs is linked ForAlbum bool `json:"for_album"` - // True, if the message is linked as a channel post comment or from a message thread - ForComment bool `json:"for_comment"` } func (entity *MessageLinkInfo) MarshalJSON() ([]byte, error) { @@ -26177,6 +37599,106 @@ func (*MessageLinkInfo) GetType() string { return TypeMessageLinkInfo } +// Contains an HTTPS link to boost a chat +type ChatBoostLink struct { + meta + // The link + Link string `json:"link"` + // True, if the link will work for non-members of the chat + IsPublic bool `json:"is_public"` +} + +func (entity *ChatBoostLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostLink + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostLink) GetClass() string { + return ClassChatBoostLink +} + +func (*ChatBoostLink) GetType() string { + return TypeChatBoostLink +} + +// Contains information about a link to boost a chat +type ChatBoostLinkInfo struct { + meta + // True, if the link will work for non-members of the chat + IsPublic bool `json:"is_public"` + // Identifier of the chat to which the link points; 0 if the chat isn't found + ChatId int64 `json:"chat_id"` +} + +func (entity *ChatBoostLinkInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostLinkInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostLinkInfo) GetClass() string { + return ClassChatBoostLinkInfo +} + +func (*ChatBoostLinkInfo) GetType() string { + return TypeChatBoostLinkInfo +} + +// The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions +type BlockListMain struct { + meta +} + +func (entity *BlockListMain) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BlockListMain + + return json.Marshal((*stub)(entity)) +} + +func (*BlockListMain) GetClass() string { + return ClassBlockList +} + +func (*BlockListMain) GetType() string { + return TypeBlockListMain +} + +func (*BlockListMain) BlockListType() string { + return TypeBlockListMain +} + +// The block list that disallows viewing of stories of the current user +type BlockListStories struct { + meta +} + +func (entity *BlockListStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BlockListStories + + return json.Marshal((*stub)(entity)) +} + +func (*BlockListStories) GetClass() string { + return ClassBlockList +} + +func (*BlockListStories) GetType() string { + return TypeBlockListStories +} + +func (*BlockListStories) BlockListType() string { + return TypeBlockListStories +} + // Contains a part of a file type FilePart struct { meta @@ -26300,6 +37822,31 @@ func (*FileTypeDocument) FileTypeType() string { return TypeFileTypeDocument } +// The file is a notification sound +type FileTypeNotificationSound struct { + meta +} + +func (entity *FileTypeNotificationSound) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypeNotificationSound + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypeNotificationSound) GetClass() string { + return ClassFileType +} + +func (*FileTypeNotificationSound) GetType() string { + return TypeFileTypeNotificationSound +} + +func (*FileTypeNotificationSound) FileTypeType() string { + return TypeFileTypeNotificationSound +} + // The file is a photo type FileTypePhoto struct { meta @@ -26325,6 +37872,31 @@ func (*FileTypePhoto) FileTypeType() string { return TypeFileTypePhoto } +// The file is a photo published as a story +type FileTypePhotoStory struct { + meta +} + +func (entity *FileTypePhotoStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypePhotoStory + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypePhotoStory) GetClass() string { + return ClassFileType +} + +func (*FileTypePhotoStory) GetType() string { + return TypeFileTypePhotoStory +} + +func (*FileTypePhotoStory) FileTypeType() string { + return TypeFileTypePhotoStory +} + // The file is a profile photo type FileTypeProfilePhoto struct { meta @@ -26550,6 +38122,31 @@ func (*FileTypeVideoNote) FileTypeType() string { return TypeFileTypeVideoNote } +// The file is a video published as a story +type FileTypeVideoStory struct { + meta +} + +func (entity *FileTypeVideoStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypeVideoStory + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypeVideoStory) GetClass() string { + return ClassFileType +} + +func (*FileTypeVideoStory) GetType() string { + return TypeFileTypeVideoStory +} + +func (*FileTypeVideoStory) FileTypeType() string { + return TypeFileTypeVideoStory +} + // The file is a voice note type FileTypeVoiceNote struct { meta @@ -27049,15 +38646,17 @@ type AutoDownloadSettings struct { // The maximum size of a photo file to be auto-downloaded, in bytes MaxPhotoFileSize int32 `json:"max_photo_file_size"` // The maximum size of a video file to be auto-downloaded, in bytes - MaxVideoFileSize int32 `json:"max_video_file_size"` + MaxVideoFileSize int64 `json:"max_video_file_size"` // The maximum size of other file types to be auto-downloaded, in bytes - MaxOtherFileSize int32 `json:"max_other_file_size"` + MaxOtherFileSize int64 `json:"max_other_file_size"` // The maximum suggested bitrate for uploaded videos, in kbit/s VideoUploadBitrate int32 `json:"video_upload_bitrate"` // True, if the beginning of video files needs to be preloaded for instant playback PreloadLargeVideos bool `json:"preload_large_videos"` // True, if the next audio track needs to be preloaded while the user is listening to an audio file PreloadNextAudio bool `json:"preload_next_audio"` + // True, if stories needs to be preloaded + PreloadStories bool `json:"preload_stories"` // True, if "use less data for calls" option needs to be enabled UseLessDataForCalls bool `json:"use_less_data_for_calls"` } @@ -27105,6 +38704,189 @@ func (*AutoDownloadSettingsPresets) GetType() string { return TypeAutoDownloadSettingsPresets } +// Autosave settings applied to all private chats without chat-specific settings +type AutosaveSettingsScopePrivateChats struct { + meta +} + +func (entity *AutosaveSettingsScopePrivateChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettingsScopePrivateChats + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettingsScopePrivateChats) GetClass() string { + return ClassAutosaveSettingsScope +} + +func (*AutosaveSettingsScopePrivateChats) GetType() string { + return TypeAutosaveSettingsScopePrivateChats +} + +func (*AutosaveSettingsScopePrivateChats) AutosaveSettingsScopeType() string { + return TypeAutosaveSettingsScopePrivateChats +} + +// Autosave settings applied to all basic group and supergroup chats without chat-specific settings +type AutosaveSettingsScopeGroupChats struct { + meta +} + +func (entity *AutosaveSettingsScopeGroupChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettingsScopeGroupChats + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettingsScopeGroupChats) GetClass() string { + return ClassAutosaveSettingsScope +} + +func (*AutosaveSettingsScopeGroupChats) GetType() string { + return TypeAutosaveSettingsScopeGroupChats +} + +func (*AutosaveSettingsScopeGroupChats) AutosaveSettingsScopeType() string { + return TypeAutosaveSettingsScopeGroupChats +} + +// Autosave settings applied to all channel chats without chat-specific settings +type AutosaveSettingsScopeChannelChats struct { + meta +} + +func (entity *AutosaveSettingsScopeChannelChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettingsScopeChannelChats + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettingsScopeChannelChats) GetClass() string { + return ClassAutosaveSettingsScope +} + +func (*AutosaveSettingsScopeChannelChats) GetType() string { + return TypeAutosaveSettingsScopeChannelChats +} + +func (*AutosaveSettingsScopeChannelChats) AutosaveSettingsScopeType() string { + return TypeAutosaveSettingsScopeChannelChats +} + +// Autosave settings applied to a chat +type AutosaveSettingsScopeChat struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +func (entity *AutosaveSettingsScopeChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettingsScopeChat + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettingsScopeChat) GetClass() string { + return ClassAutosaveSettingsScope +} + +func (*AutosaveSettingsScopeChat) GetType() string { + return TypeAutosaveSettingsScopeChat +} + +func (*AutosaveSettingsScopeChat) AutosaveSettingsScopeType() string { + return TypeAutosaveSettingsScopeChat +} + +// Contains autosave settings for an autosave settings scope +type ScopeAutosaveSettings struct { + meta + // True, if photo autosave is enabled + AutosavePhotos bool `json:"autosave_photos"` + // True, if video autosave is enabled + AutosaveVideos bool `json:"autosave_videos"` + // The maximum size of a video file to be autosaved, in bytes; 512 KB - 4000 MB + MaxVideoFileSize int64 `json:"max_video_file_size"` +} + +func (entity *ScopeAutosaveSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ScopeAutosaveSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ScopeAutosaveSettings) GetClass() string { + return ClassScopeAutosaveSettings +} + +func (*ScopeAutosaveSettings) GetType() string { + return TypeScopeAutosaveSettings +} + +// Contains autosave settings for a chat, which overrides default settings for the corresponding scope +type AutosaveSettingsException struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Autosave settings for the chat + Settings *ScopeAutosaveSettings `json:"settings"` +} + +func (entity *AutosaveSettingsException) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettingsException + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettingsException) GetClass() string { + return ClassAutosaveSettingsException +} + +func (*AutosaveSettingsException) GetType() string { + return TypeAutosaveSettingsException +} + +// Describes autosave settings +type AutosaveSettings struct { + meta + // Default autosave settings for private chats + PrivateChatSettings *ScopeAutosaveSettings `json:"private_chat_settings"` + // Default autosave settings for basic group and supergroup chats + GroupSettings *ScopeAutosaveSettings `json:"group_settings"` + // Default autosave settings for channel chats + ChannelSettings *ScopeAutosaveSettings `json:"channel_settings"` + // Autosave settings for specific chats + Exceptions []*AutosaveSettingsException `json:"exceptions"` +} + +func (entity *AutosaveSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettings + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettings) GetClass() string { + return ClassAutosaveSettings +} + +func (*AutosaveSettings) GetType() string { + return TypeAutosaveSettings +} + // Currently waiting for the network to become available. Use setNetworkType to change the available network type type ConnectionStateWaitingForNetwork struct { meta @@ -27405,6 +39187,54 @@ func (*TopChatCategoryForwardChats) TopChatCategoryType() string { return TypeTopChatCategoryForwardChats } +// Contains 0-based match position +type FoundPosition struct { + meta + // The position of the match + Position int32 `json:"position"` +} + +func (entity *FoundPosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundPosition + + return json.Marshal((*stub)(entity)) +} + +func (*FoundPosition) GetClass() string { + return ClassFoundPosition +} + +func (*FoundPosition) GetType() string { + return TypeFoundPosition +} + +// Contains 0-based positions of matched objects +type FoundPositions struct { + meta + // Total number of matched objects + TotalCount int32 `json:"total_count"` + // The positions of the matched objects + Positions []int32 `json:"positions"` +} + +func (entity *FoundPositions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundPositions + + return json.Marshal((*stub)(entity)) +} + +func (*FoundPositions) GetClass() string { + return ClassFoundPositions +} + +func (*FoundPositions) GetType() string { + return TypeFoundPositions +} + // A URL linking to a user type TMeUrlTypeUser struct { meta @@ -27462,7 +39292,7 @@ func (*TMeUrlTypeSupergroup) TMeUrlTypeType() string { // A chat invite link type TMeUrlTypeChatInvite struct { meta - // Chat invite link info + // Information about the chat invite link Info *ChatInviteLinkInfo `json:"info"` } @@ -27580,7 +39410,7 @@ func (*TMeUrls) GetType() string { return TypeTMeUrls } -// Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option +// Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings type SuggestedActionEnableArchiveAndMuteNewChats struct { meta } @@ -27710,7 +39540,7 @@ func (*SuggestedActionConvertToBroadcastGroup) SuggestedActionType() string { // Suggests the user to set a 2-step verification password to be able to log in again type SuggestedActionSetPassword struct { meta - // The number of days to pass between consecutive authorizations if the user declines to set password + // The number of days to pass between consecutive authorizations if the user declines to set password; if 0, then the user is advised to set the password for security reasons AuthorizationDelay int32 `json:"authorization_delay"` } @@ -27734,6 +39564,81 @@ func (*SuggestedActionSetPassword) SuggestedActionType() string { return TypeSuggestedActionSetPassword } +// Suggests the user to upgrade the Premium subscription from monthly payments to annual payments +type SuggestedActionUpgradePremium struct { + meta +} + +func (entity *SuggestedActionUpgradePremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionUpgradePremium + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionUpgradePremium) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionUpgradePremium) GetType() string { + return TypeSuggestedActionUpgradePremium +} + +func (*SuggestedActionUpgradePremium) SuggestedActionType() string { + return TypeSuggestedActionUpgradePremium +} + +// Suggests the user to restore a recently expired Premium subscription +type SuggestedActionRestorePremium struct { + meta +} + +func (entity *SuggestedActionRestorePremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionRestorePremium + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionRestorePremium) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionRestorePremium) GetType() string { + return TypeSuggestedActionRestorePremium +} + +func (*SuggestedActionRestorePremium) SuggestedActionType() string { + return TypeSuggestedActionRestorePremium +} + +// Suggests the user to subscribe to the Premium subscription with annual payments +type SuggestedActionSubscribeToAnnualPremium struct { + meta +} + +func (entity *SuggestedActionSubscribeToAnnualPremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionSubscribeToAnnualPremium + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionSubscribeToAnnualPremium) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionSubscribeToAnnualPremium) GetType() string { + return TypeSuggestedActionSubscribeToAnnualPremium +} + +func (*SuggestedActionSubscribeToAnnualPremium) SuggestedActionType() string { + return TypeSuggestedActionSubscribeToAnnualPremium +} + // Contains a counter type Count struct { meta @@ -27803,6 +39708,29 @@ func (*Seconds) GetType() string { return TypeSeconds } +// Contains size of downloaded prefix of a file +type FileDownloadedPrefixSize struct { + meta + // The prefix size, in bytes + Size int64 `json:"size"` +} + +func (entity *FileDownloadedPrefixSize) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileDownloadedPrefixSize + + return json.Marshal((*stub)(entity)) +} + +func (*FileDownloadedPrefixSize) GetClass() string { + return ClassFileDownloadedPrefixSize +} + +func (*FileDownloadedPrefixSize) GetType() string { + return TypeFileDownloadedPrefixSize +} + // Contains information about a tg: deep link type DeepLinkInfo struct { meta @@ -27972,7 +39900,7 @@ type Proxy struct { meta // Unique identifier of the proxy Id int32 `json:"id"` - // Proxy server IP address + // Proxy server domain or IP address Server string `json:"server"` // Proxy server port Port int32 `json:"port"` @@ -28050,42 +39978,41 @@ func (*Proxies) GetType() string { return TypeProxies } -// A static sticker in PNG format, which will be converted to WEBP server-side -type InputStickerStatic struct { +// A sticker to be added to a sticker set +type InputSticker struct { meta - // PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square + // File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements Sticker InputFile `json:"sticker"` - // Emojis corresponding to the sticker + // String with 1-20 emoji corresponding to the sticker Emojis string `json:"emojis"` - // For masks, position where the mask is placed; pass null if unspecified + // Position where the mask is placed; pass null if not specified MaskPosition *MaskPosition `json:"mask_position"` + // List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker + Keywords []string `json:"keywords"` } -func (entity *InputStickerStatic) MarshalJSON() ([]byte, error) { +func (entity *InputSticker) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InputStickerStatic + type stub InputSticker return json.Marshal((*stub)(entity)) } -func (*InputStickerStatic) GetClass() string { +func (*InputSticker) GetClass() string { return ClassInputSticker } -func (*InputStickerStatic) GetType() string { - return TypeInputStickerStatic +func (*InputSticker) GetType() string { + return TypeInputSticker } -func (*InputStickerStatic) InputStickerType() string { - return TypeInputStickerStatic -} - -func (inputStickerStatic *InputStickerStatic) UnmarshalJSON(data []byte) error { +func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { var tmp struct { Sticker json.RawMessage `json:"sticker"` Emojis string `json:"emojis"` MaskPosition *MaskPosition `json:"mask_position"` + Keywords []string `json:"keywords"` } err := json.Unmarshal(data, &tmp) @@ -28093,59 +40020,12 @@ func (inputStickerStatic *InputStickerStatic) UnmarshalJSON(data []byte) error { return err } - inputStickerStatic.Emojis = tmp.Emojis - inputStickerStatic.MaskPosition = tmp.MaskPosition + inputSticker.Emojis = tmp.Emojis + inputSticker.MaskPosition = tmp.MaskPosition + inputSticker.Keywords = tmp.Keywords fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputStickerStatic.Sticker = fieldSticker - - return nil -} - -// An animated sticker in TGS format -type InputStickerAnimated struct { - meta - // File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements - Sticker InputFile `json:"sticker"` - // Emojis corresponding to the sticker - Emojis string `json:"emojis"` -} - -func (entity *InputStickerAnimated) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputStickerAnimated - - return json.Marshal((*stub)(entity)) -} - -func (*InputStickerAnimated) GetClass() string { - return ClassInputSticker -} - -func (*InputStickerAnimated) GetType() string { - return TypeInputStickerAnimated -} - -func (*InputStickerAnimated) InputStickerType() string { - return TypeInputStickerAnimated -} - -func (inputStickerAnimated *InputStickerAnimated) UnmarshalJSON(data []byte) error { - var tmp struct { - Sticker json.RawMessage `json:"sticker"` - Emojis string `json:"emojis"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputStickerAnimated.Emojis = tmp.Emojis - - fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputStickerAnimated.Sticker = fieldSticker + inputSticker.Sticker = fieldSticker return nil } @@ -28522,7 +40402,7 @@ type ChatStatisticsChannel struct { MeanViewCount *StatisticalValue `json:"mean_view_count"` // Mean number of times the recently sent messages was shared MeanShareCount *StatisticalValue `json:"mean_share_count"` - // A percentage of users with enabled notifications for the chat + // A percentage of users with enabled notifications for the chat; 0-100 EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"` // A graph containing number of members in the chat MemberCountGraph StatisticalGraph `json:"member_count_graph"` @@ -29067,10 +40947,8 @@ type UpdateMessageSendFailed struct { Message *Message `json:"message"` // The previous temporary message identifier OldMessageId int64 `json:"old_message_id"` - // An error code - ErrorCode int32 `json:"error_code"` - // Error message - ErrorMessage string `json:"error_message"` + // The cause of the message sending failure + Error *Error `json:"error"` } func (entity *UpdateMessageSendFailed) MarshalJSON() ([]byte, error) { @@ -29263,7 +41141,7 @@ func (*UpdateMessageInteractionInfo) UpdateType() string { return TypeUpdateMessageInteractionInfo } -// The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the TTL timer for self-destructing messages +// The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the self-destruct timer type UpdateMessageContentOpened struct { meta // Chat identifier @@ -29323,6 +41201,39 @@ func (*UpdateMessageMentionRead) UpdateType() string { return TypeUpdateMessageMentionRead } +// The list of unread reactions added to a message was changed +type UpdateMessageUnreadReactions struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // The new list of unread reactions + UnreadReactions []*UnreadReaction `json:"unread_reactions"` + // The new number of messages with unread reactions left in the chat + UnreadReactionCount int32 `json:"unread_reaction_count"` +} + +func (entity *UpdateMessageUnreadReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateMessageUnreadReactions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateMessageUnreadReactions) GetClass() string { + return ClassUpdate +} + +func (*UpdateMessageUnreadReactions) GetType() string { + return TypeUpdateMessageUnreadReactions +} + +func (*UpdateMessageUnreadReactions) UpdateType() string { + return TypeUpdateMessageUnreadReactions +} + // A message with a live location was viewed. When the update is received, the application is supposed to update the live location type UpdateMessageLiveLocationViewed struct { meta @@ -29437,6 +41348,64 @@ func (*UpdateChatPhoto) UpdateType() string { return TypeUpdateChatPhoto } +// A chat accent color has changed +type UpdateChatAccentColor struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat accent color identifier + AccentColorId int32 `json:"accent_color_id"` +} + +func (entity *UpdateChatAccentColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatAccentColor + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatAccentColor) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatAccentColor) GetType() string { + return TypeUpdateChatAccentColor +} + +func (*UpdateChatAccentColor) UpdateType() string { + return TypeUpdateChatAccentColor +} + +// A chat's custom emoji for reply background has changed +type UpdateChatBackgroundCustomEmoji struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new tdentifier of a custom emoji to be shown on the reply header background + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` +} + +func (entity *UpdateChatBackgroundCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatBackgroundCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatBackgroundCustomEmoji) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatBackgroundCustomEmoji) GetType() string { + return TypeUpdateChatBackgroundCustomEmoji +} + +func (*UpdateChatBackgroundCustomEmoji) UpdateType() string { + return TypeUpdateChatBackgroundCustomEmoji +} + // Chat permissions was changed type UpdateChatPermissions struct { meta @@ -29466,12 +41435,12 @@ 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 type UpdateChatLastMessage struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // The new last message in the chat; may be null + // The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update LastMessage *Message `json:"last_message"` // The new chat positions in the chat lists Positions []*ChatPosition `json:"positions"` @@ -29497,7 +41466,7 @@ func (*UpdateChatLastMessage) UpdateType() string { return TypeUpdateChatLastMessage } -// The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent +// The position of a chat in a chat list has changed. An updateChatLastMessage or updateChatDraftMessage update might be sent instead of the update type UpdateChatPosition struct { meta // Chat identifier @@ -29634,6 +41603,54 @@ func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error return nil } +// The chat available reactions were changed +type UpdateChatAvailableReactions struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new reactions, available in the chat + AvailableReactions ChatAvailableReactions `json:"available_reactions"` +} + +func (entity *UpdateChatAvailableReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatAvailableReactions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatAvailableReactions) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatAvailableReactions) GetType() string { + return TypeUpdateChatAvailableReactions +} + +func (*UpdateChatAvailableReactions) UpdateType() string { + return TypeUpdateChatAvailableReactions +} + +func (updateChatAvailableReactions *UpdateChatAvailableReactions) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + AvailableReactions json.RawMessage `json:"available_reactions"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatAvailableReactions.ChatId = tmp.ChatId + + fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) + updateChatAvailableReactions.AvailableReactions = fieldAvailableReactions + + return nil +} + // A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied type UpdateChatDraftMessage struct { meta @@ -29713,33 +41730,33 @@ func (updateChatMessageSender *UpdateChatMessageSender) UnmarshalJSON(data []byt return nil } -// The message Time To Live setting for a chat was changed -type UpdateChatMessageTtl struct { +// The message auto-delete or self-destruct timer setting for a chat was changed +type UpdateChatMessageAutoDeleteTime struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // New value of message_ttl - MessageTtl int32 `json:"message_ttl"` + // New value of message_auto_delete_time + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` } -func (entity *UpdateChatMessageTtl) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatMessageAutoDeleteTime) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatMessageTtl + type stub UpdateChatMessageAutoDeleteTime return json.Marshal((*stub)(entity)) } -func (*UpdateChatMessageTtl) GetClass() string { +func (*UpdateChatMessageAutoDeleteTime) GetClass() string { return ClassUpdate } -func (*UpdateChatMessageTtl) GetType() string { - return TypeUpdateChatMessageTtl +func (*UpdateChatMessageAutoDeleteTime) GetType() string { + return TypeUpdateChatMessageAutoDeleteTime } -func (*UpdateChatMessageTtl) UpdateType() string { - return TypeUpdateChatMessageTtl +func (*UpdateChatMessageAutoDeleteTime) UpdateType() string { + return TypeUpdateChatMessageAutoDeleteTime } // Notification settings for a chat were changed @@ -29829,6 +41846,35 @@ func (*UpdateChatReplyMarkup) UpdateType() string { return TypeUpdateChatReplyMarkup } +// The chat background was changed +type UpdateChatBackground struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat background; may be null if background was reset to default + Background *ChatBackground `json:"background"` +} + +func (entity *UpdateChatBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatBackground + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatBackground) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatBackground) GetType() string { + return TypeUpdateChatBackground +} + +func (*UpdateChatBackground) UpdateType() string { + return TypeUpdateChatBackground +} + // The chat theme was changed type UpdateChatTheme struct { meta @@ -29887,6 +41933,35 @@ func (*UpdateChatUnreadMentionCount) UpdateType() string { return TypeUpdateChatUnreadMentionCount } +// The chat unread_reaction_count has changed +type UpdateChatUnreadReactionCount struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The number of messages with unread reactions left in the chat + UnreadReactionCount int32 `json:"unread_reaction_count"` +} + +func (entity *UpdateChatUnreadReactionCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatUnreadReactionCount + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatUnreadReactionCount) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatUnreadReactionCount) GetType() string { + return TypeUpdateChatUnreadReactionCount +} + +func (*UpdateChatUnreadReactionCount) UpdateType() string { + return TypeUpdateChatUnreadReactionCount +} + // A chat video chat state has changed type UpdateChatVideoChat struct { meta @@ -29974,62 +42049,33 @@ func (*UpdateChatHasProtectedContent) UpdateType() string { return TypeUpdateChatHasProtectedContent } -// A chat's has_scheduled_messages field has changed -type UpdateChatHasScheduledMessages struct { +// Translation of chat messages was enabled or disabled +type UpdateChatIsTranslatable struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // New value of has_scheduled_messages - HasScheduledMessages bool `json:"has_scheduled_messages"` + // New value of is_translatable + IsTranslatable bool `json:"is_translatable"` } -func (entity *UpdateChatHasScheduledMessages) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatIsTranslatable) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatHasScheduledMessages + type stub UpdateChatIsTranslatable return json.Marshal((*stub)(entity)) } -func (*UpdateChatHasScheduledMessages) GetClass() string { +func (*UpdateChatIsTranslatable) GetClass() string { return ClassUpdate } -func (*UpdateChatHasScheduledMessages) GetType() string { - return TypeUpdateChatHasScheduledMessages +func (*UpdateChatIsTranslatable) GetType() string { + return TypeUpdateChatIsTranslatable } -func (*UpdateChatHasScheduledMessages) UpdateType() string { - return TypeUpdateChatHasScheduledMessages -} - -// A chat was blocked or unblocked -type UpdateChatIsBlocked struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of is_blocked - IsBlocked bool `json:"is_blocked"` -} - -func (entity *UpdateChatIsBlocked) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatIsBlocked - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatIsBlocked) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatIsBlocked) GetType() string { - return TypeUpdateChatIsBlocked -} - -func (*UpdateChatIsBlocked) UpdateType() string { - return TypeUpdateChatIsBlocked +func (*UpdateChatIsTranslatable) UpdateType() string { + return TypeUpdateChatIsTranslatable } // A chat was marked as unread or was read @@ -30061,34 +42107,113 @@ func (*UpdateChatIsMarkedAsUnread) UpdateType() string { return TypeUpdateChatIsMarkedAsUnread } -// The list of chat filters or a chat filter has changed -type UpdateChatFilters struct { +// A chat was blocked or unblocked +type UpdateChatBlockList struct { meta - // The new list of chat filters - ChatFilters []*ChatFilterInfo `json:"chat_filters"` + // Chat identifier + ChatId int64 `json:"chat_id"` + // Block list to which the chat is added; may be null if none + BlockList BlockList `json:"block_list"` } -func (entity *UpdateChatFilters) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatBlockList) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatFilters + type stub UpdateChatBlockList return json.Marshal((*stub)(entity)) } -func (*UpdateChatFilters) GetClass() string { +func (*UpdateChatBlockList) GetClass() string { return ClassUpdate } -func (*UpdateChatFilters) GetType() string { - return TypeUpdateChatFilters +func (*UpdateChatBlockList) GetType() string { + return TypeUpdateChatBlockList } -func (*UpdateChatFilters) UpdateType() string { - return TypeUpdateChatFilters +func (*UpdateChatBlockList) UpdateType() string { + return TypeUpdateChatBlockList } -// The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed +func (updateChatBlockList *UpdateChatBlockList) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + BlockList json.RawMessage `json:"block_list"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatBlockList.ChatId = tmp.ChatId + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + updateChatBlockList.BlockList = fieldBlockList + + return nil +} + +// 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 list of chat folders or a chat folder has changed +type UpdateChatFolders struct { + meta + // The new list of chat folders + ChatFolders []*ChatFolderInfo `json:"chat_folders"` + // Position of the main chat list among chat folders, 0-based + MainChatListPosition int32 `json:"main_chat_list_position"` +} + +func (entity *UpdateChatFolders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatFolders + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatFolders) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatFolders) GetType() string { + return TypeUpdateChatFolders +} + +func (*UpdateChatFolders) UpdateType() string { + return TypeUpdateChatFolders +} + +// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed type UpdateChatOnlineMemberCount struct { meta // Identifier of the chat @@ -30117,6 +42242,35 @@ func (*UpdateChatOnlineMemberCount) UpdateType() string { return TypeUpdateChatOnlineMemberCount } +// Basic information about a topic in a forum chat was changed +type UpdateForumTopicInfo struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New information about the topic + Info *ForumTopicInfo `json:"info"` +} + +func (entity *UpdateForumTopicInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateForumTopicInfo + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateForumTopicInfo) GetClass() string { + return ClassUpdate +} + +func (*UpdateForumTopicInfo) GetType() string { + return TypeUpdateForumTopicInfo +} + +func (*UpdateForumTopicInfo) UpdateType() string { + return TypeUpdateForumTopicInfo +} + // Notification settings for some type of chats were updated type UpdateScopeNotificationSettings struct { meta @@ -30205,13 +42359,13 @@ type UpdateNotificationGroup struct { ChatId int64 `json:"chat_id"` // Chat identifier, which notification settings must be applied to the added notifications NotificationSettingsChatId int64 `json:"notification_settings_chat_id"` - // True, if the notifications must be shown without sound - IsSilent bool `json:"is_silent"` + // Identifier of the notification sound to be played; 0 if sound is disabled + NotificationSoundId JsonInt64 `json:"notification_sound_id"` // Total number of unread notifications in the group, can be bigger than number of active notifications TotalCount int32 `json:"total_count"` - // List of added group notifications, sorted by notification ID + // List of added group notifications, sorted by notification identifier AddedNotifications []*Notification `json:"added_notifications"` - // Identifiers of removed group notifications, sorted by notification ID + // Identifiers of removed group notifications, sorted by notification identifier RemovedNotificationIds []int32 `json:"removed_notification_ids"` } @@ -30241,7 +42395,7 @@ func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byt Type json.RawMessage `json:"type"` ChatId int64 `json:"chat_id"` NotificationSettingsChatId int64 `json:"notification_settings_chat_id"` - IsSilent bool `json:"is_silent"` + NotificationSoundId JsonInt64 `json:"notification_sound_id"` TotalCount int32 `json:"total_count"` AddedNotifications []*Notification `json:"added_notifications"` RemovedNotificationIds []int32 `json:"removed_notification_ids"` @@ -30255,7 +42409,7 @@ func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byt updateNotificationGroup.NotificationGroupId = tmp.NotificationGroupId updateNotificationGroup.ChatId = tmp.ChatId updateNotificationGroup.NotificationSettingsChatId = tmp.NotificationSettingsChatId - updateNotificationGroup.IsSilent = tmp.IsSilent + updateNotificationGroup.NotificationSoundId = tmp.NotificationSoundId updateNotificationGroup.TotalCount = tmp.TotalCount updateNotificationGroup.AddedNotifications = tmp.AddedNotifications updateNotificationGroup.RemovedNotificationIds = tmp.RemovedNotificationIds @@ -30791,6 +42945,128 @@ func (*UpdateFileGenerationStop) UpdateType() string { return TypeUpdateFileGenerationStop } +// The state of the file download list has changed +type UpdateFileDownloads struct { + meta + // Total size of files in the file download list, in bytes + TotalSize int64 `json:"total_size"` + // Total number of files in the file download list + TotalCount int32 `json:"total_count"` + // Total downloaded size of files in the file download list, in bytes + DownloadedSize int64 `json:"downloaded_size"` +} + +func (entity *UpdateFileDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileDownloads) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileDownloads) GetType() string { + return TypeUpdateFileDownloads +} + +func (*UpdateFileDownloads) UpdateType() string { + return TypeUpdateFileDownloads +} + +// A file was added to the file download list. This update is sent only after file download list is loaded for the first time +type UpdateFileAddedToDownloads struct { + meta + // The added file download + FileDownload *FileDownload `json:"file_download"` + // New number of being downloaded and recently downloaded files found + Counts *DownloadedFileCounts `json:"counts"` +} + +func (entity *UpdateFileAddedToDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileAddedToDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileAddedToDownloads) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileAddedToDownloads) GetType() string { + return TypeUpdateFileAddedToDownloads +} + +func (*UpdateFileAddedToDownloads) UpdateType() string { + return TypeUpdateFileAddedToDownloads +} + +// A file download was changed. This update is sent only after file download list is loaded for the first time +type UpdateFileDownload struct { + meta + // File identifier + FileId int32 `json:"file_id"` + // Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed + CompleteDate int32 `json:"complete_date"` + // True, if downloading of the file is paused + IsPaused bool `json:"is_paused"` + // New number of being downloaded and recently downloaded files found + Counts *DownloadedFileCounts `json:"counts"` +} + +func (entity *UpdateFileDownload) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileDownload + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileDownload) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileDownload) GetType() string { + return TypeUpdateFileDownload +} + +func (*UpdateFileDownload) UpdateType() string { + return TypeUpdateFileDownload +} + +// A file was removed from the file download list. This update is sent only after file download list is loaded for the first time +type UpdateFileRemovedFromDownloads struct { + meta + // File identifier + FileId int32 `json:"file_id"` + // New number of being downloaded and recently downloaded files found + Counts *DownloadedFileCounts `json:"counts"` +} + +func (entity *UpdateFileRemovedFromDownloads) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateFileRemovedFromDownloads + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateFileRemovedFromDownloads) GetClass() string { + return ClassUpdate +} + +func (*UpdateFileRemovedFromDownloads) GetType() string { + return TypeUpdateFileRemovedFromDownloads +} + +func (*UpdateFileRemovedFromDownloads) UpdateType() string { + return TypeUpdateFileRemovedFromDownloads +} + // New call was created or information about a call was updated type UpdateCall struct { meta @@ -31067,6 +43343,247 @@ func (updateUnreadChatCount *UpdateUnreadChatCount) UnmarshalJSON(data []byte) e return nil } +// A story was changed +type UpdateStory struct { + meta + // The new information about the story + Story *Story `json:"story"` +} + +func (entity *UpdateStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStory + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStory) GetClass() string { + return ClassUpdate +} + +func (*UpdateStory) GetType() string { + return TypeUpdateStory +} + +func (*UpdateStory) UpdateType() string { + return TypeUpdateStory +} + +// A story became inaccessible +type UpdateStoryDeleted struct { + meta + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *UpdateStoryDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStoryDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStoryDeleted) GetClass() string { + return ClassUpdate +} + +func (*UpdateStoryDeleted) GetType() string { + return TypeUpdateStoryDeleted +} + +func (*UpdateStoryDeleted) UpdateType() string { + return TypeUpdateStoryDeleted +} + +// A story has been successfully sent +type UpdateStorySendSucceeded struct { + meta + // The sent story + Story *Story `json:"story"` + // The previous temporary story identifier + OldStoryId int32 `json:"old_story_id"` +} + +func (entity *UpdateStorySendSucceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStorySendSucceeded + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStorySendSucceeded) GetClass() string { + return ClassUpdate +} + +func (*UpdateStorySendSucceeded) GetType() string { + return TypeUpdateStorySendSucceeded +} + +func (*UpdateStorySendSucceeded) UpdateType() string { + return TypeUpdateStorySendSucceeded +} + +// A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update +type UpdateStorySendFailed struct { + meta + // The failed to send story + Story *Story `json:"story"` + // The cause of the story sending failure + Error *Error `json:"error"` + // Type of the error; may be null if unknown + ErrorType CanSendStoryResult `json:"error_type"` +} + +func (entity *UpdateStorySendFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStorySendFailed + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStorySendFailed) GetClass() string { + return ClassUpdate +} + +func (*UpdateStorySendFailed) GetType() string { + return TypeUpdateStorySendFailed +} + +func (*UpdateStorySendFailed) UpdateType() string { + return TypeUpdateStorySendFailed +} + +func (updateStorySendFailed *UpdateStorySendFailed) UnmarshalJSON(data []byte) error { + var tmp struct { + Story *Story `json:"story"` + Error *Error `json:"error"` + ErrorType json.RawMessage `json:"error_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateStorySendFailed.Story = tmp.Story + updateStorySendFailed.Error = tmp.Error + + fieldErrorType, _ := UnmarshalCanSendStoryResult(tmp.ErrorType) + updateStorySendFailed.ErrorType = fieldErrorType + + return nil +} + +// The list of active stories posted by a specific chat has changed +type UpdateChatActiveStories struct { + meta + // The new list of active stories + ActiveStories *ChatActiveStories `json:"active_stories"` +} + +func (entity *UpdateChatActiveStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatActiveStories + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatActiveStories) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatActiveStories) GetType() string { + return TypeUpdateChatActiveStories +} + +func (*UpdateChatActiveStories) UpdateType() string { + return TypeUpdateChatActiveStories +} + +// Number of chats in a story list has changed +type UpdateStoryListChatCount struct { + meta + // The story list + StoryList StoryList `json:"story_list"` + // Approximate total number of chats with active stories in the list + ChatCount int32 `json:"chat_count"` +} + +func (entity *UpdateStoryListChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStoryListChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStoryListChatCount) GetClass() string { + return ClassUpdate +} + +func (*UpdateStoryListChatCount) GetType() string { + return TypeUpdateStoryListChatCount +} + +func (*UpdateStoryListChatCount) UpdateType() string { + return TypeUpdateStoryListChatCount +} + +func (updateStoryListChatCount *UpdateStoryListChatCount) UnmarshalJSON(data []byte) error { + var tmp struct { + StoryList json.RawMessage `json:"story_list"` + ChatCount int32 `json:"chat_count"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateStoryListChatCount.ChatCount = tmp.ChatCount + + fieldStoryList, _ := UnmarshalStoryList(tmp.StoryList) + updateStoryListChatCount.StoryList = fieldStoryList + + return nil +} + +// Story stealth mode settings have changed +type UpdateStoryStealthMode struct { + meta + // Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled + ActiveUntilDate int32 `json:"active_until_date"` + // Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown + CooldownUntilDate int32 `json:"cooldown_until_date"` +} + +func (entity *UpdateStoryStealthMode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStoryStealthMode + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStoryStealthMode) GetClass() string { + return ClassUpdate +} + +func (*UpdateStoryStealthMode) GetType() string { + return TypeUpdateStoryStealthMode +} + +func (*UpdateStoryStealthMode) UpdateType() string { + return TypeUpdateStoryStealthMode +} + // An option changed its value type UpdateOption struct { meta @@ -31145,8 +43662,8 @@ func (*UpdateStickerSet) UpdateType() string { // The list of installed sticker sets was updated type UpdateInstalledStickerSets struct { meta - // True, if the list of installed mask sticker sets was updated - IsMasks bool `json:"is_masks"` + // Type of the affected stickers + StickerType StickerType `json:"sticker_type"` // The new list of installed ordinary sticker sets StickerSetIds []JsonInt64 `json:"sticker_set_ids"` } @@ -31171,11 +43688,32 @@ func (*UpdateInstalledStickerSets) UpdateType() string { return TypeUpdateInstalledStickerSets } +func (updateInstalledStickerSets *UpdateInstalledStickerSets) UnmarshalJSON(data []byte) error { + var tmp struct { + StickerType json.RawMessage `json:"sticker_type"` + StickerSetIds []JsonInt64 `json:"sticker_set_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateInstalledStickerSets.StickerSetIds = tmp.StickerSetIds + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + updateInstalledStickerSets.StickerType = fieldStickerType + + return nil +} + // The list of trending sticker sets was updated or some of them were viewed type UpdateTrendingStickerSets struct { meta + // Type of the affected stickers + StickerType StickerType `json:"sticker_type"` // The prefix of the list of trending sticker sets with the newest trending sticker sets - StickerSets *StickerSets `json:"sticker_sets"` + StickerSets *TrendingStickerSets `json:"sticker_sets"` } func (entity *UpdateTrendingStickerSets) MarshalJSON() ([]byte, error) { @@ -31198,10 +43736,29 @@ func (*UpdateTrendingStickerSets) UpdateType() string { return TypeUpdateTrendingStickerSets } +func (updateTrendingStickerSets *UpdateTrendingStickerSets) UnmarshalJSON(data []byte) error { + var tmp struct { + StickerType json.RawMessage `json:"sticker_type"` + StickerSets *TrendingStickerSets `json:"sticker_sets"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateTrendingStickerSets.StickerSets = tmp.StickerSets + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + updateTrendingStickerSets.StickerType = fieldStickerType + + return nil +} + // The list of recently used stickers was updated type UpdateRecentStickers struct { meta - // True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated + // True, if the list of stickers attached to photo or video files was updated; otherwise, the list of sent stickers is updated IsAttached bool `json:"is_attached"` // The new list of file identifiers of recently used stickers StickerIds []int32 `json:"sticker_ids"` @@ -31281,6 +43838,33 @@ func (*UpdateSavedAnimations) UpdateType() string { return TypeUpdateSavedAnimations } +// The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time +type UpdateSavedNotificationSounds struct { + meta + // The new list of identifiers of saved notification sounds + NotificationSoundIds []JsonInt64 `json:"notification_sound_ids"` +} + +func (entity *UpdateSavedNotificationSounds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSavedNotificationSounds + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSavedNotificationSounds) GetClass() string { + return ClassUpdate +} + +func (*UpdateSavedNotificationSounds) GetType() string { + return TypeUpdateSavedNotificationSounds +} + +func (*UpdateSavedNotificationSounds) UpdateType() string { + return TypeUpdateSavedNotificationSounds +} + // The selected background has changed type UpdateSelectedBackground struct { meta @@ -31337,6 +43921,35 @@ func (*UpdateChatThemes) UpdateType() string { return TypeUpdateChatThemes } +// The list of supported accent colors has changed +type UpdateAccentColors struct { + meta + // Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme + Colors []*AccentColor `json:"colors"` + // The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order + AvailableAccentColorIds []int32 `json:"available_accent_color_ids"` +} + +func (entity *UpdateAccentColors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAccentColors + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAccentColors) GetClass() string { + return ClassUpdate +} + +func (*UpdateAccentColors) GetType() string { + return TypeUpdateAccentColors +} + +func (*UpdateAccentColors) UpdateType() string { + return TypeUpdateAccentColors +} + // Some language pack strings have been updated type UpdateLanguagePackStrings struct { meta @@ -31344,7 +43957,7 @@ type UpdateLanguagePackStrings struct { LocalizationTarget string `json:"localization_target"` // Identifier of the updated language pack LanguagePackId string `json:"language_pack_id"` - // List of changed language pack strings + // List of changed language pack strings; empty if all strings have changed Strings []*LanguagePackString `json:"strings"` } @@ -31467,6 +44080,157 @@ func (*UpdateUsersNearby) UpdateType() string { return TypeUpdateUsersNearby } +// The first unconfirmed session has changed +type UpdateUnconfirmedSession struct { + meta + // The unconfirmed session; may be null if none + Session *UnconfirmedSession `json:"session"` +} + +func (entity *UpdateUnconfirmedSession) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateUnconfirmedSession + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateUnconfirmedSession) GetClass() string { + return ClassUpdate +} + +func (*UpdateUnconfirmedSession) GetType() string { + return TypeUpdateUnconfirmedSession +} + +func (*UpdateUnconfirmedSession) UpdateType() string { + return TypeUpdateUnconfirmedSession +} + +// The list of bots added to attachment or side menu has changed +type UpdateAttachmentMenuBots struct { + meta + // The new list of bots. The bots must not be shown on scheduled messages screen + Bots []*AttachmentMenuBot `json:"bots"` +} + +func (entity *UpdateAttachmentMenuBots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAttachmentMenuBots + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAttachmentMenuBots) GetClass() string { + return ClassUpdate +} + +func (*UpdateAttachmentMenuBots) GetType() string { + return TypeUpdateAttachmentMenuBots +} + +func (*UpdateAttachmentMenuBots) UpdateType() string { + return TypeUpdateAttachmentMenuBots +} + +// A message was sent by an opened Web App, so the Web App needs to be closed +type UpdateWebAppMessageSent struct { + meta + // Identifier of Web App launch + WebAppLaunchId JsonInt64 `json:"web_app_launch_id"` +} + +func (entity *UpdateWebAppMessageSent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateWebAppMessageSent + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateWebAppMessageSent) GetClass() string { + return ClassUpdate +} + +func (*UpdateWebAppMessageSent) GetType() string { + return TypeUpdateWebAppMessageSent +} + +func (*UpdateWebAppMessageSent) UpdateType() string { + return TypeUpdateWebAppMessageSent +} + +// The list of active emoji reactions has changed +type UpdateActiveEmojiReactions struct { + meta + // The new list of active emoji reactions + Emojis []string `json:"emojis"` +} + +func (entity *UpdateActiveEmojiReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateActiveEmojiReactions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateActiveEmojiReactions) GetClass() string { + return ClassUpdate +} + +func (*UpdateActiveEmojiReactions) GetType() string { + return TypeUpdateActiveEmojiReactions +} + +func (*UpdateActiveEmojiReactions) UpdateType() string { + return TypeUpdateActiveEmojiReactions +} + +// The type of default reaction has changed +type UpdateDefaultReactionType struct { + meta + // The new type of the default reaction + ReactionType ReactionType `json:"reaction_type"` +} + +func (entity *UpdateDefaultReactionType) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateDefaultReactionType + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateDefaultReactionType) GetClass() string { + return ClassUpdate +} + +func (*UpdateDefaultReactionType) GetType() string { + return TypeUpdateDefaultReactionType +} + +func (*UpdateDefaultReactionType) UpdateType() string { + return TypeUpdateDefaultReactionType +} + +func (updateDefaultReactionType *UpdateDefaultReactionType) UnmarshalJSON(data []byte) error { + var tmp struct { + ReactionType json.RawMessage `json:"reaction_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType) + updateDefaultReactionType.ReactionType = fieldReactionType + + return nil +} + // The list of supported dice emojis has changed type UpdateDiceEmojis struct { meta @@ -31525,7 +44289,7 @@ func (*UpdateAnimatedEmojiMessageClicked) UpdateType() string { return TypeUpdateAnimatedEmojiMessageClicked } -// The parameters of animation search through GetOption("animation_search_bot_username") bot has changed +// The parameters of animation search through getOption("animation_search_bot_username") bot has changed type UpdateAnimationSearchParameters struct { meta // Name of the animation search provider @@ -31603,6 +44367,83 @@ func (updateSuggestedActions *UpdateSuggestedActions) UnmarshalJSON(data []byte) return nil } +// Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate +type UpdateAddChatMembersPrivacyForbidden struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifiers of users, which weren't added because of their privacy settings + UserIds []int64 `json:"user_ids"` +} + +func (entity *UpdateAddChatMembersPrivacyForbidden) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAddChatMembersPrivacyForbidden + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAddChatMembersPrivacyForbidden) GetClass() string { + return ClassUpdate +} + +func (*UpdateAddChatMembersPrivacyForbidden) GetType() string { + return TypeUpdateAddChatMembersPrivacyForbidden +} + +func (*UpdateAddChatMembersPrivacyForbidden) UpdateType() string { + return TypeUpdateAddChatMembersPrivacyForbidden +} + +// Autosave settings for some type of chats were updated +type UpdateAutosaveSettings struct { + meta + // Type of chats for which autosave settings were updated + Scope AutosaveSettingsScope `json:"scope"` + // The new autosave settings; may be null if the settings are reset to default + Settings *ScopeAutosaveSettings `json:"settings"` +} + +func (entity *UpdateAutosaveSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAutosaveSettings + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAutosaveSettings) GetClass() string { + return ClassUpdate +} + +func (*UpdateAutosaveSettings) GetType() string { + return TypeUpdateAutosaveSettings +} + +func (*UpdateAutosaveSettings) UpdateType() string { + return TypeUpdateAutosaveSettings +} + +func (updateAutosaveSettings *UpdateAutosaveSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + Scope json.RawMessage `json:"scope"` + Settings *ScopeAutosaveSettings `json:"settings"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateAutosaveSettings.Settings = tmp.Settings + + fieldScope, _ := UnmarshalAutosaveSettingsScope(tmp.Scope) + updateAutosaveSettings.Scope = fieldScope + + return nil +} + // A new incoming inline query; for bots only type UpdateNewInlineQuery struct { meta @@ -31612,7 +44453,7 @@ type UpdateNewInlineQuery struct { SenderUserId int64 `json:"sender_user_id"` // User location; may be null UserLocation *Location `json:"user_location"` - // The type of the chat, from which the query originated; may be null if unknown + // The type of the chat from which the query originated; may be null if unknown ChatType ChatType `json:"chat_type"` // Text of the query Query string `json:"query"` @@ -31711,7 +44552,7 @@ type UpdateNewCallbackQuery struct { SenderUserId int64 `json:"sender_user_id"` // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` - // Identifier of the message, from which the query originated + // Identifier of the message from which the query originated MessageId int64 `json:"message_id"` // Identifier that uniquely corresponds to the chat to which the message was sent ChatInstance JsonInt64 `json:"chat_instance"` @@ -31773,7 +44614,7 @@ type UpdateNewInlineCallbackQuery struct { Id JsonInt64 `json:"id"` // Identifier of the user who sent the query SenderUserId int64 `json:"sender_user_id"` - // Identifier of the inline message, from which the query originated + // Identifier of the inline message from which the query originated InlineMessageId string `json:"inline_message_id"` // An identifier uniquely corresponding to the chat a message was sent to ChatInstance JsonInt64 `json:"chat_instance"` @@ -31988,8 +44829,8 @@ type UpdatePollAnswer struct { meta // Unique poll identifier PollId JsonInt64 `json:"poll_id"` - // The user, who changed the answer to the poll - UserId int64 `json:"user_id"` + // Identifier of the message sender that changed the answer to the poll + VoterId MessageSender `json:"voter_id"` // 0-based identifiers of answer options, chosen by the user OptionIds []int32 `json:"option_ids"` } @@ -32014,6 +44855,27 @@ func (*UpdatePollAnswer) UpdateType() string { return TypeUpdatePollAnswer } +func (updatePollAnswer *UpdatePollAnswer) UnmarshalJSON(data []byte) error { + var tmp struct { + PollId JsonInt64 `json:"poll_id"` + VoterId json.RawMessage `json:"voter_id"` + OptionIds []int32 `json:"option_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updatePollAnswer.PollId = tmp.PollId + updatePollAnswer.OptionIds = tmp.OptionIds + + fieldVoterId, _ := UnmarshalMessageSender(tmp.VoterId) + updatePollAnswer.VoterId = fieldVoterId + + return nil +} + // User rights changed in a chat; for bots only type UpdateChatMember struct { meta @@ -32025,6 +44887,8 @@ type UpdateChatMember struct { Date int32 `json:"date"` // If user has joined the chat using an invite link, the invite link; may be null InviteLink *ChatInviteLink `json:"invite_link"` + // True, if the user has joined the chat using an invite link for a chat folder + ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link"` // Previous chat member OldChatMember *ChatMember `json:"old_chat_member"` // New chat member @@ -32058,6 +44922,8 @@ type UpdateNewChatJoinRequest struct { ChatId int64 `json:"chat_id"` // Join request Request *ChatJoinRequest `json:"request"` + // Chat identifier of the private chat with the user + UserChatId int64 `json:"user_chat_id"` // The invite link, which was used to send join request; may be null InviteLink *ChatInviteLink `json:"invite_link"` } @@ -32082,6 +44948,35 @@ func (*UpdateNewChatJoinRequest) UpdateType() string { return TypeUpdateNewChatJoinRequest } +// A chat boost has changed; for bots only +type UpdateChatBoost struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New information about the boost + Boost *ChatBoost `json:"boost"` +} + +func (entity *UpdateChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatBoost) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatBoost) GetType() string { + return TypeUpdateChatBoost +} + +func (*UpdateChatBoost) UpdateType() string { + return TypeUpdateChatBoost +} + // Contains a list of updates type Updates struct { meta @@ -32248,6 +45143,33 @@ func (*LogTags) GetType() string { return TypeLogTags } +// Contains custom information about the user +type UserSupportInfo struct { + meta + // Information message + Message *FormattedText `json:"message"` + // Information author + Author string `json:"author"` + // Information change date + Date int32 `json:"date"` +} + +func (entity *UserSupportInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserSupportInfo + + return json.Marshal((*stub)(entity)) +} + +func (*UserSupportInfo) GetClass() string { + return ClassUserSupportInfo +} + +func (*UserSupportInfo) GetType() string { + return TypeUserSupportInfo +} + // A simple object containing a number; for testing only type TestInt struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 8c5bac0..780ddcd 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -31,6 +31,15 @@ func UnmarshalAuthenticationCodeType(data json.RawMessage) (AuthenticationCodeTy case TypeAuthenticationCodeTypeMissedCall: return UnmarshalAuthenticationCodeTypeMissedCall(data) + case TypeAuthenticationCodeTypeFragment: + return UnmarshalAuthenticationCodeTypeFragment(data) + + case TypeAuthenticationCodeTypeFirebaseAndroid: + return UnmarshalAuthenticationCodeTypeFirebaseAndroid(data) + + case TypeAuthenticationCodeTypeFirebaseIos: + return UnmarshalAuthenticationCodeTypeFirebaseIos(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -50,6 +59,77 @@ func UnmarshalListOfAuthenticationCodeType(dataList []json.RawMessage) ([]Authen return list, nil } +func UnmarshalEmailAddressAuthentication(data json.RawMessage) (EmailAddressAuthentication, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeEmailAddressAuthenticationCode: + return UnmarshalEmailAddressAuthenticationCode(data) + + case TypeEmailAddressAuthenticationAppleId: + return UnmarshalEmailAddressAuthenticationAppleId(data) + + case TypeEmailAddressAuthenticationGoogleId: + return UnmarshalEmailAddressAuthenticationGoogleId(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfEmailAddressAuthentication(dataList []json.RawMessage) ([]EmailAddressAuthentication, error) { + list := []EmailAddressAuthentication{} + + for _, data := range dataList { + entity, err := UnmarshalEmailAddressAuthentication(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func 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) { var meta meta @@ -62,12 +142,15 @@ func UnmarshalAuthorizationState(data json.RawMessage) (AuthorizationState, erro case TypeAuthorizationStateWaitTdlibParameters: return UnmarshalAuthorizationStateWaitTdlibParameters(data) - case TypeAuthorizationStateWaitEncryptionKey: - return UnmarshalAuthorizationStateWaitEncryptionKey(data) - case TypeAuthorizationStateWaitPhoneNumber: return UnmarshalAuthorizationStateWaitPhoneNumber(data) + case TypeAuthorizationStateWaitEmailAddress: + return UnmarshalAuthorizationStateWaitEmailAddress(data) + + case TypeAuthorizationStateWaitEmailCode: + return UnmarshalAuthorizationStateWaitEmailCode(data) + case TypeAuthorizationStateWaitCode: return UnmarshalAuthorizationStateWaitCode(data) @@ -163,20 +246,23 @@ func UnmarshalThumbnailFormat(data json.RawMessage) (ThumbnailFormat, error) { case TypeThumbnailFormatJpeg: return UnmarshalThumbnailFormatJpeg(data) - case TypeThumbnailFormatPng: - return UnmarshalThumbnailFormatPng(data) - - case TypeThumbnailFormatWebp: - return UnmarshalThumbnailFormatWebp(data) - case TypeThumbnailFormatGif: return UnmarshalThumbnailFormatGif(data) + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) + + case TypeThumbnailFormatPng: + return UnmarshalThumbnailFormatPng(data) + case TypeThumbnailFormatTgs: return UnmarshalThumbnailFormatTgs(data) - case TypeThumbnailFormatMpeg4: - return UnmarshalThumbnailFormatMpeg4(data) + case TypeThumbnailFormatWebm: + return UnmarshalThumbnailFormatWebm(data) + + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -237,6 +323,117 @@ func UnmarshalListOfMaskPoint(dataList []json.RawMessage) ([]MaskPoint, error) { return list, nil } +func UnmarshalStickerFormat(data json.RawMessage) (StickerFormat, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStickerFormatWebp: + return UnmarshalStickerFormatWebp(data) + + case TypeStickerFormatTgs: + return UnmarshalStickerFormatTgs(data) + + case TypeStickerFormatWebm: + return UnmarshalStickerFormatWebm(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStickerFormat(dataList []json.RawMessage) ([]StickerFormat, error) { + list := []StickerFormat{} + + for _, data := range dataList { + entity, err := UnmarshalStickerFormat(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStickerType(data json.RawMessage) (StickerType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStickerTypeRegular: + return UnmarshalStickerTypeRegular(data) + + case TypeStickerTypeMask: + return UnmarshalStickerTypeMask(data) + + case TypeStickerTypeCustomEmoji: + return UnmarshalStickerTypeCustomEmoji(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStickerType(dataList []json.RawMessage) ([]StickerType, error) { + list := []StickerType{} + + for _, data := range dataList { + entity, err := UnmarshalStickerType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStickerFullType(data json.RawMessage) (StickerFullType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStickerFullTypeRegular: + return UnmarshalStickerFullTypeRegular(data) + + case TypeStickerFullTypeMask: + return UnmarshalStickerFullTypeMask(data) + + case TypeStickerFullTypeCustomEmoji: + return UnmarshalStickerFullTypeCustomEmoji(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStickerFullType(dataList []json.RawMessage) ([]StickerFullType, error) { + list := []StickerFullType{} + + for _, data := range dataList { + entity, err := UnmarshalStickerFullType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalPollType(data json.RawMessage) (PollType, error) { var meta meta @@ -311,6 +508,40 @@ func UnmarshalListOfUserType(dataList []json.RawMessage) ([]UserType, error) { return list, nil } +func UnmarshalChatPhotoStickerType(data json.RawMessage) (ChatPhotoStickerType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatPhotoStickerTypeRegularOrMask: + return UnmarshalChatPhotoStickerTypeRegularOrMask(data) + + case TypeChatPhotoStickerTypeCustomEmoji: + return UnmarshalChatPhotoStickerTypeCustomEmoji(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatPhotoStickerType(dataList []json.RawMessage) ([]ChatPhotoStickerType, error) { + list := []ChatPhotoStickerType{} + + for _, data := range dataList { + entity, err := UnmarshalChatPhotoStickerType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInputChatPhoto(data json.RawMessage) (InputChatPhoto, error) { var meta meta @@ -329,6 +560,9 @@ func UnmarshalInputChatPhoto(data json.RawMessage) (InputChatPhoto, error) { case TypeInputChatPhotoAnimation: return UnmarshalInputChatPhotoAnimation(data) + case TypeInputChatPhotoSticker: + return UnmarshalInputChatPhotoSticker(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -348,6 +582,83 @@ func UnmarshalListOfInputChatPhoto(dataList []json.RawMessage) ([]InputChatPhoto return list, nil } +func UnmarshalPremiumGiveawayParticipantStatus(data json.RawMessage) (PremiumGiveawayParticipantStatus, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumGiveawayParticipantStatusEligible: + return UnmarshalPremiumGiveawayParticipantStatusEligible(data) + + case TypePremiumGiveawayParticipantStatusParticipating: + return UnmarshalPremiumGiveawayParticipantStatusParticipating(data) + + case TypePremiumGiveawayParticipantStatusAlreadyWasMember: + return UnmarshalPremiumGiveawayParticipantStatusAlreadyWasMember(data) + + case TypePremiumGiveawayParticipantStatusAdministrator: + return UnmarshalPremiumGiveawayParticipantStatusAdministrator(data) + + case TypePremiumGiveawayParticipantStatusDisallowedCountry: + return UnmarshalPremiumGiveawayParticipantStatusDisallowedCountry(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumGiveawayParticipantStatus(dataList []json.RawMessage) ([]PremiumGiveawayParticipantStatus, error) { + list := []PremiumGiveawayParticipantStatus{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumGiveawayParticipantStatus(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPremiumGiveawayInfo(data json.RawMessage) (PremiumGiveawayInfo, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumGiveawayInfoOngoing: + return UnmarshalPremiumGiveawayInfoOngoing(data) + + case TypePremiumGiveawayInfoCompleted: + return UnmarshalPremiumGiveawayInfoCompleted(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumGiveawayInfo(dataList []json.RawMessage) ([]PremiumGiveawayInfo, error) { + list := []PremiumGiveawayInfo{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumGiveawayInfo(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalChatMemberStatus(data json.RawMessage) (ChatMemberStatus, error) { var meta meta @@ -495,6 +806,43 @@ func UnmarshalListOfSupergroupMembersFilter(dataList []json.RawMessage) ([]Super return list, nil } +func UnmarshalInviteLinkChatType(data json.RawMessage) (InviteLinkChatType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInviteLinkChatTypeBasicGroup: + return UnmarshalInviteLinkChatTypeBasicGroup(data) + + case TypeInviteLinkChatTypeSupergroup: + return UnmarshalInviteLinkChatTypeSupergroup(data) + + case TypeInviteLinkChatTypeChannel: + return UnmarshalInviteLinkChatTypeChannel(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInviteLinkChatType(dataList []json.RawMessage) ([]InviteLinkChatType, error) { + list := []InviteLinkChatType{} + + for _, data := range dataList { + entity, err := UnmarshalInviteLinkChatType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalSecretChatState(data json.RawMessage) (SecretChatState, error) { var meta meta @@ -566,7 +914,7 @@ func UnmarshalListOfMessageSender(dataList []json.RawMessage) ([]MessageSender, return list, nil } -func UnmarshalMessageForwardOrigin(data json.RawMessage) (MessageForwardOrigin, error) { +func UnmarshalMessageOrigin(data json.RawMessage) (MessageOrigin, error) { var meta meta err := json.Unmarshal(data, &meta) @@ -575,31 +923,62 @@ func UnmarshalMessageForwardOrigin(data json.RawMessage) (MessageForwardOrigin, } switch meta.Type { - case TypeMessageForwardOriginUser: - return UnmarshalMessageForwardOriginUser(data) + case TypeMessageOriginUser: + return UnmarshalMessageOriginUser(data) - case TypeMessageForwardOriginChat: - return UnmarshalMessageForwardOriginChat(data) + case TypeMessageOriginHiddenUser: + return UnmarshalMessageOriginHiddenUser(data) - case TypeMessageForwardOriginHiddenUser: - return UnmarshalMessageForwardOriginHiddenUser(data) + case TypeMessageOriginChat: + return UnmarshalMessageOriginChat(data) - case TypeMessageForwardOriginChannel: - return UnmarshalMessageForwardOriginChannel(data) - - case TypeMessageForwardOriginMessageImport: - return UnmarshalMessageForwardOriginMessageImport(data) + case TypeMessageOriginChannel: + return UnmarshalMessageOriginChannel(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } } -func UnmarshalListOfMessageForwardOrigin(dataList []json.RawMessage) ([]MessageForwardOrigin, error) { - list := []MessageForwardOrigin{} +func UnmarshalListOfMessageOrigin(dataList []json.RawMessage) ([]MessageOrigin, error) { + list := []MessageOrigin{} for _, data := range dataList { - entity, err := UnmarshalMessageForwardOrigin(data) + entity, err := UnmarshalMessageOrigin(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalReactionType(data json.RawMessage) (ReactionType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeReactionTypeEmoji: + return UnmarshalReactionTypeEmoji(data) + + case TypeReactionTypeCustomEmoji: + return UnmarshalReactionTypeCustomEmoji(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfReactionType(dataList []json.RawMessage) ([]ReactionType, error) { + list := []ReactionType{} + + for _, data := range dataList { + entity, err := UnmarshalReactionType(data) if err != nil { return nil, err } @@ -643,6 +1022,172 @@ func UnmarshalListOfMessageSendingState(dataList []json.RawMessage) ([]MessageSe return list, nil } +func UnmarshalMessageReplyTo(data json.RawMessage) (MessageReplyTo, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageReplyToMessage: + return UnmarshalMessageReplyToMessage(data) + + case TypeMessageReplyToStory: + return UnmarshalMessageReplyToStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageReplyTo(dataList []json.RawMessage) ([]MessageReplyTo, error) { + list := []MessageReplyTo{} + + for _, data := range dataList { + entity, err := UnmarshalMessageReplyTo(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputMessageReplyTo(data json.RawMessage) (InputMessageReplyTo, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputMessageReplyToMessage: + return UnmarshalInputMessageReplyToMessage(data) + + case TypeInputMessageReplyToStory: + return UnmarshalInputMessageReplyToStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputMessageReplyTo(dataList []json.RawMessage) ([]InputMessageReplyTo, error) { + list := []InputMessageReplyTo{} + + for _, data := range dataList { + entity, err := UnmarshalInputMessageReplyTo(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalMessageSource(data json.RawMessage) (MessageSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageSourceChatHistory: + return UnmarshalMessageSourceChatHistory(data) + + case TypeMessageSourceMessageThreadHistory: + return UnmarshalMessageSourceMessageThreadHistory(data) + + case TypeMessageSourceForumTopicHistory: + return UnmarshalMessageSourceForumTopicHistory(data) + + case TypeMessageSourceHistoryPreview: + return UnmarshalMessageSourceHistoryPreview(data) + + case TypeMessageSourceChatList: + return UnmarshalMessageSourceChatList(data) + + case TypeMessageSourceSearch: + return UnmarshalMessageSourceSearch(data) + + case TypeMessageSourceChatEventLog: + return UnmarshalMessageSourceChatEventLog(data) + + case TypeMessageSourceNotification: + return UnmarshalMessageSourceNotification(data) + + case TypeMessageSourceScreenshot: + return UnmarshalMessageSourceScreenshot(data) + + case TypeMessageSourceOther: + return UnmarshalMessageSourceOther(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageSource(dataList []json.RawMessage) ([]MessageSource, error) { + list := []MessageSource{} + + for _, data := range dataList { + entity, err := UnmarshalMessageSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalMessageSponsorType(data json.RawMessage) (MessageSponsorType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageSponsorTypeBot: + return UnmarshalMessageSponsorTypeBot(data) + + case TypeMessageSponsorTypePublicChannel: + return UnmarshalMessageSponsorTypePublicChannel(data) + + case TypeMessageSponsorTypePrivateChannel: + return UnmarshalMessageSponsorTypePrivateChannel(data) + + case TypeMessageSponsorTypeWebsite: + return UnmarshalMessageSponsorTypeWebsite(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageSponsorType(dataList []json.RawMessage) ([]MessageSponsorType, error) { + list := []MessageSponsorType{} + + for _, data := range dataList { + entity, err := UnmarshalMessageSponsorType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalNotificationSettingsScope(data json.RawMessage) (NotificationSettingsScope, error) { var meta meta @@ -735,8 +1280,8 @@ func UnmarshalChatList(data json.RawMessage) (ChatList, error) { case TypeChatListArchive: return UnmarshalChatListArchive(data) - case TypeChatListFilter: - return UnmarshalChatListFilter(data) + case TypeChatListFolder: + return UnmarshalChatListFolder(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -791,6 +1336,40 @@ func UnmarshalListOfChatSource(dataList []json.RawMessage) ([]ChatSource, error) return list, nil } +func UnmarshalChatAvailableReactions(data json.RawMessage) (ChatAvailableReactions, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatAvailableReactionsAll: + return UnmarshalChatAvailableReactionsAll(data) + + case TypeChatAvailableReactionsSome: + return UnmarshalChatAvailableReactionsSome(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatAvailableReactions(dataList []json.RawMessage) ([]ChatAvailableReactions, error) { + list := []ChatAvailableReactions{} + + for _, data := range dataList { + entity, err := UnmarshalChatAvailableReactions(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalPublicChatType(data json.RawMessage) (PublicChatType, error) { var meta meta @@ -895,6 +1474,15 @@ func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, erro case TypeKeyboardButtonTypeRequestPoll: return UnmarshalKeyboardButtonTypeRequestPoll(data) + case TypeKeyboardButtonTypeRequestUser: + return UnmarshalKeyboardButtonTypeRequestUser(data) + + case TypeKeyboardButtonTypeRequestChat: + return UnmarshalKeyboardButtonTypeRequestChat(data) + + case TypeKeyboardButtonTypeWebApp: + return UnmarshalKeyboardButtonTypeWebApp(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -929,6 +1517,9 @@ func UnmarshalInlineKeyboardButtonType(data json.RawMessage) (InlineKeyboardButt case TypeInlineKeyboardButtonTypeLoginUrl: return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) + case TypeInlineKeyboardButtonTypeWebApp: + return UnmarshalInlineKeyboardButtonTypeWebApp(data) + case TypeInlineKeyboardButtonTypeCallback: return UnmarshalInlineKeyboardButtonTypeCallback(data) @@ -1348,6 +1939,120 @@ func UnmarshalListOfInputCredentials(dataList []json.RawMessage) ([]InputCredent return list, nil } +func UnmarshalPaymentProvider(data json.RawMessage) (PaymentProvider, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePaymentProviderSmartGlocal: + return UnmarshalPaymentProviderSmartGlocal(data) + + case TypePaymentProviderStripe: + return UnmarshalPaymentProviderStripe(data) + + case TypePaymentProviderOther: + return UnmarshalPaymentProviderOther(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPaymentProvider(dataList []json.RawMessage) ([]PaymentProvider, error) { + list := []PaymentProvider{} + + for _, data := range dataList { + entity, err := UnmarshalPaymentProvider(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputInvoice(data json.RawMessage) (InputInvoice, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputInvoiceMessage: + return UnmarshalInputInvoiceMessage(data) + + case TypeInputInvoiceName: + return UnmarshalInputInvoiceName(data) + + case TypeInputInvoiceTelegram: + return UnmarshalInputInvoiceTelegram(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputInvoice(dataList []json.RawMessage) ([]InputInvoice, error) { + list := []InputInvoice{} + + for _, data := range dataList { + entity, err := UnmarshalInputInvoice(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalMessageExtendedMedia(data json.RawMessage) (MessageExtendedMedia, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageExtendedMediaPreview: + return UnmarshalMessageExtendedMediaPreview(data) + + case TypeMessageExtendedMediaPhoto: + return UnmarshalMessageExtendedMediaPhoto(data) + + case TypeMessageExtendedMediaVideo: + return UnmarshalMessageExtendedMediaVideo(data) + + case TypeMessageExtendedMediaUnsupported: + return UnmarshalMessageExtendedMediaUnsupported(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageExtendedMedia(dataList []json.RawMessage) ([]MessageExtendedMedia, error) { + list := []MessageExtendedMedia{} + + for _, data := range dataList { + entity, err := UnmarshalMessageExtendedMedia(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalPassportElementType(data json.RawMessage) (PassportElementType, error) { var meta meta @@ -1722,6 +2427,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePoll: return UnmarshalMessagePoll(data) + case TypeMessageStory: + return UnmarshalMessageStory(data) + case TypeMessageInvoice: return UnmarshalMessageInvoice(data) @@ -1779,11 +2487,29 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageScreenshotTaken: return UnmarshalMessageScreenshotTaken(data) + case TypeMessageChatSetBackground: + return UnmarshalMessageChatSetBackground(data) + case TypeMessageChatSetTheme: return UnmarshalMessageChatSetTheme(data) - case TypeMessageChatSetTtl: - return UnmarshalMessageChatSetTtl(data) + case TypeMessageChatSetMessageAutoDeleteTime: + return UnmarshalMessageChatSetMessageAutoDeleteTime(data) + + case TypeMessageForumTopicCreated: + return UnmarshalMessageForumTopicCreated(data) + + case TypeMessageForumTopicEdited: + return UnmarshalMessageForumTopicEdited(data) + + case TypeMessageForumTopicIsClosedToggled: + return UnmarshalMessageForumTopicIsClosedToggled(data) + + case TypeMessageForumTopicIsHiddenToggled: + return UnmarshalMessageForumTopicIsHiddenToggled(data) + + case TypeMessageSuggestProfilePhoto: + return UnmarshalMessageSuggestProfilePhoto(data) case TypeMessageCustomServiceAction: return UnmarshalMessageCustomServiceAction(data) @@ -1797,11 +2523,35 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePaymentSuccessfulBot: return UnmarshalMessagePaymentSuccessfulBot(data) + case TypeMessageGiftedPremium: + return UnmarshalMessageGiftedPremium(data) + + case TypeMessagePremiumGiftCode: + return UnmarshalMessagePremiumGiftCode(data) + + case TypeMessagePremiumGiveawayCreated: + return UnmarshalMessagePremiumGiveawayCreated(data) + + case TypeMessagePremiumGiveaway: + return UnmarshalMessagePremiumGiveaway(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) - case TypeMessageWebsiteConnected: - return UnmarshalMessageWebsiteConnected(data) + case TypeMessageUserShared: + return UnmarshalMessageUserShared(data) + + case TypeMessageChatShared: + return UnmarshalMessageChatShared(data) + + case TypeMessageBotWriteAccessAllowed: + return UnmarshalMessageBotWriteAccessAllowed(data) + + case TypeMessageWebAppDataSent: + return UnmarshalMessageWebAppDataSent(data) + + case TypeMessageWebAppDataReceived: + return UnmarshalMessageWebAppDataReceived(data) case TypeMessagePassportDataSent: return UnmarshalMessagePassportDataSent(data) @@ -1879,6 +2629,9 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypeStrikethrough: return UnmarshalTextEntityTypeStrikethrough(data) + case TypeTextEntityTypeSpoiler: + return UnmarshalTextEntityTypeSpoiler(data) + case TypeTextEntityTypeCode: return UnmarshalTextEntityTypeCode(data) @@ -1888,12 +2641,18 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypePreCode: return UnmarshalTextEntityTypePreCode(data) + case TypeTextEntityTypeBlockQuote: + return UnmarshalTextEntityTypeBlockQuote(data) + case TypeTextEntityTypeTextUrl: return UnmarshalTextEntityTypeTextUrl(data) case TypeTextEntityTypeMentionName: return UnmarshalTextEntityTypeMentionName(data) + case TypeTextEntityTypeCustomEmoji: + return UnmarshalTextEntityTypeCustomEmoji(data) + case TypeTextEntityTypeMediaTimestamp: return UnmarshalTextEntityTypeMediaTimestamp(data) @@ -1950,6 +2709,40 @@ func UnmarshalListOfMessageSchedulingState(dataList []json.RawMessage) ([]Messag return list, nil } +func UnmarshalMessageSelfDestructType(data json.RawMessage) (MessageSelfDestructType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageSelfDestructTypeTimer: + return UnmarshalMessageSelfDestructTypeTimer(data) + + case TypeMessageSelfDestructTypeImmediately: + return UnmarshalMessageSelfDestructTypeImmediately(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageSelfDestructType(dataList []json.RawMessage) ([]MessageSelfDestructType, error) { + list := []MessageSelfDestructType{} + + for _, data := range dataList { + entity, err := UnmarshalMessageSelfDestructType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, error) { var meta meta @@ -2007,6 +2800,9 @@ func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, er case TypeInputMessagePoll: return UnmarshalInputMessagePoll(data) + case TypeInputMessageStory: + return UnmarshalInputMessageStory(data) + case TypeInputMessageForwarded: return UnmarshalInputMessageForwarded(data) @@ -2080,6 +2876,9 @@ func UnmarshalSearchMessagesFilter(data json.RawMessage) (SearchMessagesFilter, case TypeSearchMessagesFilterUnreadMention: return UnmarshalSearchMessagesFilterUnreadMention(data) + case TypeSearchMessagesFilterUnreadReaction: + return UnmarshalSearchMessagesFilterUnreadReaction(data) + case TypeSearchMessagesFilterFailedToSend: return UnmarshalSearchMessagesFilterFailedToSend(data) @@ -2224,6 +3023,262 @@ func UnmarshalListOfUserStatus(dataList []json.RawMessage) ([]UserStatus, error) return list, nil } +func UnmarshalEmojiCategoryType(data json.RawMessage) (EmojiCategoryType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeEmojiCategoryTypeDefault: + return UnmarshalEmojiCategoryTypeDefault(data) + + case TypeEmojiCategoryTypeEmojiStatus: + return UnmarshalEmojiCategoryTypeEmojiStatus(data) + + case TypeEmojiCategoryTypeChatPhoto: + return UnmarshalEmojiCategoryTypeChatPhoto(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfEmojiCategoryType(dataList []json.RawMessage) ([]EmojiCategoryType, error) { + list := []EmojiCategoryType{} + + for _, data := range dataList { + entity, err := UnmarshalEmojiCategoryType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryAreaTypeLocation: + return UnmarshalStoryAreaTypeLocation(data) + + case TypeStoryAreaTypeVenue: + return UnmarshalStoryAreaTypeVenue(data) + + case TypeStoryAreaTypeSuggestedReaction: + return UnmarshalStoryAreaTypeSuggestedReaction(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryAreaType(dataList []json.RawMessage) ([]StoryAreaType, error) { + list := []StoryAreaType{} + + for _, data := range dataList { + entity, err := UnmarshalStoryAreaType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputStoryAreaTypeLocation: + return UnmarshalInputStoryAreaTypeLocation(data) + + case TypeInputStoryAreaTypeFoundVenue: + return UnmarshalInputStoryAreaTypeFoundVenue(data) + + case TypeInputStoryAreaTypePreviousVenue: + return UnmarshalInputStoryAreaTypePreviousVenue(data) + + case TypeInputStoryAreaTypeSuggestedReaction: + return UnmarshalInputStoryAreaTypeSuggestedReaction(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputStoryAreaType(dataList []json.RawMessage) ([]InputStoryAreaType, error) { + list := []InputStoryAreaType{} + + for _, data := range dataList { + entity, err := UnmarshalInputStoryAreaType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryContentPhoto: + return UnmarshalStoryContentPhoto(data) + + case TypeStoryContentVideo: + return UnmarshalStoryContentVideo(data) + + case TypeStoryContentUnsupported: + return UnmarshalStoryContentUnsupported(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryContent(dataList []json.RawMessage) ([]StoryContent, error) { + list := []StoryContent{} + + for _, data := range dataList { + entity, err := UnmarshalStoryContent(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputStoryContent(data json.RawMessage) (InputStoryContent, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputStoryContentPhoto: + return UnmarshalInputStoryContentPhoto(data) + + case TypeInputStoryContentVideo: + return UnmarshalInputStoryContentVideo(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputStoryContent(dataList []json.RawMessage) ([]InputStoryContent, error) { + list := []InputStoryContent{} + + for _, data := range dataList { + entity, err := UnmarshalInputStoryContent(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStoryList(data json.RawMessage) (StoryList, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryListMain: + return UnmarshalStoryListMain(data) + + case TypeStoryListArchive: + return UnmarshalStoryListArchive(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryList(dataList []json.RawMessage) ([]StoryList, error) { + list := []StoryList{} + + for _, data := range dataList { + entity, err := UnmarshalStoryList(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalChatBoostSource(data json.RawMessage) (ChatBoostSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatBoostSourceGiftCode: + return UnmarshalChatBoostSourceGiftCode(data) + + case TypeChatBoostSourceGiveaway: + return UnmarshalChatBoostSourceGiveaway(data) + + case TypeChatBoostSourcePremium: + return UnmarshalChatBoostSourcePremium(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatBoostSource(dataList []json.RawMessage) ([]ChatBoostSource, error) { + list := []ChatBoostSource{} + + for _, data := range dataList { + entity, err := UnmarshalChatBoostSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCallDiscardReason(data json.RawMessage) (CallDiscardReason, error) { var meta meta @@ -2439,6 +3494,40 @@ func UnmarshalListOfCallProblem(dataList []json.RawMessage) ([]CallProblem, erro return list, nil } +func UnmarshalFirebaseAuthenticationSettings(data json.RawMessage) (FirebaseAuthenticationSettings, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeFirebaseAuthenticationSettingsAndroid: + return UnmarshalFirebaseAuthenticationSettingsAndroid(data) + + case TypeFirebaseAuthenticationSettingsIos: + return UnmarshalFirebaseAuthenticationSettingsIos(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfFirebaseAuthenticationSettings(dataList []json.RawMessage) ([]FirebaseAuthenticationSettings, error) { + list := []FirebaseAuthenticationSettings{} + + for _, data := range dataList { + entity, err := UnmarshalFirebaseAuthenticationSettings(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalDiceStickers(data json.RawMessage) (DiceStickers, error) { var meta meta @@ -2473,6 +3562,83 @@ func UnmarshalListOfDiceStickers(dataList []json.RawMessage) ([]DiceStickers, er return list, nil } +func UnmarshalSpeechRecognitionResult(data json.RawMessage) (SpeechRecognitionResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeSpeechRecognitionResultPending: + return UnmarshalSpeechRecognitionResultPending(data) + + case TypeSpeechRecognitionResultText: + return UnmarshalSpeechRecognitionResultText(data) + + case TypeSpeechRecognitionResultError: + return UnmarshalSpeechRecognitionResultError(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfSpeechRecognitionResult(dataList []json.RawMessage) ([]SpeechRecognitionResult, error) { + list := []SpeechRecognitionResult{} + + for _, data := range dataList { + entity, err := UnmarshalSpeechRecognitionResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalBotWriteAccessAllowReason(data json.RawMessage) (BotWriteAccessAllowReason, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBotWriteAccessAllowReasonConnectedWebsite: + return UnmarshalBotWriteAccessAllowReasonConnectedWebsite(data) + + case TypeBotWriteAccessAllowReasonAddedToAttachmentMenu: + return UnmarshalBotWriteAccessAllowReasonAddedToAttachmentMenu(data) + + case TypeBotWriteAccessAllowReasonLaunchedWebApp: + return UnmarshalBotWriteAccessAllowReasonLaunchedWebApp(data) + + case TypeBotWriteAccessAllowReasonAcceptedRequest: + return UnmarshalBotWriteAccessAllowReasonAcceptedRequest(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBotWriteAccessAllowReason(dataList []json.RawMessage) ([]BotWriteAccessAllowReason, error) { + list := []BotWriteAccessAllowReason{} + + for _, data := range dataList { + entity, err := UnmarshalBotWriteAccessAllowReason(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInputInlineQueryResult(data json.RawMessage) (InputInlineQueryResult, error) { var meta meta @@ -2601,6 +3767,40 @@ func UnmarshalListOfInlineQueryResult(dataList []json.RawMessage) ([]InlineQuery return list, nil } +func UnmarshalInlineQueryResultsButtonType(data json.RawMessage) (InlineQueryResultsButtonType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInlineQueryResultsButtonTypeStartBot: + return UnmarshalInlineQueryResultsButtonTypeStartBot(data) + + case TypeInlineQueryResultsButtonTypeWebApp: + return UnmarshalInlineQueryResultsButtonTypeWebApp(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInlineQueryResultsButtonType(dataList []json.RawMessage) ([]InlineQueryResultsButtonType, error) { + list := []InlineQueryResultsButtonType{} + + for _, data := range dataList { + entity, err := UnmarshalInlineQueryResultsButtonType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCallbackQueryPayload(data json.RawMessage) (CallbackQueryPayload, error) { var meta meta @@ -2653,15 +3853,15 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventMessageDeleted: return UnmarshalChatEventMessageDeleted(data) - case TypeChatEventPollStopped: - return UnmarshalChatEventPollStopped(data) - case TypeChatEventMessagePinned: return UnmarshalChatEventMessagePinned(data) case TypeChatEventMessageUnpinned: return UnmarshalChatEventMessageUnpinned(data) + case TypeChatEventPollStopped: + return UnmarshalChatEventPollStopped(data) + case TypeChatEventMemberJoined: return UnmarshalChatEventMemberJoined(data) @@ -2671,60 +3871,75 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventMemberJoinedByRequest: return UnmarshalChatEventMemberJoinedByRequest(data) - case TypeChatEventMemberLeft: - return UnmarshalChatEventMemberLeft(data) - case TypeChatEventMemberInvited: return UnmarshalChatEventMemberInvited(data) + case TypeChatEventMemberLeft: + return UnmarshalChatEventMemberLeft(data) + case TypeChatEventMemberPromoted: return UnmarshalChatEventMemberPromoted(data) case TypeChatEventMemberRestricted: return UnmarshalChatEventMemberRestricted(data) - case TypeChatEventTitleChanged: - return UnmarshalChatEventTitleChanged(data) - - case TypeChatEventPermissionsChanged: - return UnmarshalChatEventPermissionsChanged(data) + case TypeChatEventAvailableReactionsChanged: + return UnmarshalChatEventAvailableReactionsChanged(data) case TypeChatEventDescriptionChanged: return UnmarshalChatEventDescriptionChanged(data) - case TypeChatEventUsernameChanged: - return UnmarshalChatEventUsernameChanged(data) - - case TypeChatEventPhotoChanged: - return UnmarshalChatEventPhotoChanged(data) - - case TypeChatEventInvitesToggled: - return UnmarshalChatEventInvitesToggled(data) - case TypeChatEventLinkedChatChanged: return UnmarshalChatEventLinkedChatChanged(data) - case TypeChatEventSlowModeDelayChanged: - return UnmarshalChatEventSlowModeDelayChanged(data) - - case TypeChatEventMessageTtlChanged: - return UnmarshalChatEventMessageTtlChanged(data) - - case TypeChatEventSignMessagesToggled: - return UnmarshalChatEventSignMessagesToggled(data) - - case TypeChatEventHasProtectedContentToggled: - return UnmarshalChatEventHasProtectedContentToggled(data) - - case TypeChatEventStickerSetChanged: - return UnmarshalChatEventStickerSetChanged(data) - case TypeChatEventLocationChanged: return UnmarshalChatEventLocationChanged(data) + case TypeChatEventMessageAutoDeleteTimeChanged: + return UnmarshalChatEventMessageAutoDeleteTimeChanged(data) + + case TypeChatEventPermissionsChanged: + return UnmarshalChatEventPermissionsChanged(data) + + case TypeChatEventPhotoChanged: + return UnmarshalChatEventPhotoChanged(data) + + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) + + case TypeChatEventStickerSetChanged: + return UnmarshalChatEventStickerSetChanged(data) + + case TypeChatEventTitleChanged: + return UnmarshalChatEventTitleChanged(data) + + case TypeChatEventUsernameChanged: + return UnmarshalChatEventUsernameChanged(data) + + case TypeChatEventActiveUsernamesChanged: + return UnmarshalChatEventActiveUsernamesChanged(data) + + case TypeChatEventAccentColorChanged: + return UnmarshalChatEventAccentColorChanged(data) + + case TypeChatEventBackgroundCustomEmojiChanged: + return UnmarshalChatEventBackgroundCustomEmojiChanged(data) + + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) + + case TypeChatEventInvitesToggled: + return UnmarshalChatEventInvitesToggled(data) + case TypeChatEventIsAllHistoryAvailableToggled: return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventHasAggressiveAntiSpamEnabledToggled: + return UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data) + + case TypeChatEventSignMessagesToggled: + return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventInviteLinkEdited: return UnmarshalChatEventInviteLinkEdited(data) @@ -2740,14 +3955,35 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventVideoChatEnded: return UnmarshalChatEventVideoChatEnded(data) + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEventVideoChatParticipantIsMutedToggled: return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) case TypeChatEventVideoChatParticipantVolumeLevelChanged: return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) - case TypeChatEventVideoChatMuteNewParticipantsToggled: - return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEventIsForumToggled: + return UnmarshalChatEventIsForumToggled(data) + + case TypeChatEventForumTopicCreated: + return UnmarshalChatEventForumTopicCreated(data) + + case TypeChatEventForumTopicEdited: + return UnmarshalChatEventForumTopicEdited(data) + + case TypeChatEventForumTopicToggleIsClosed: + return UnmarshalChatEventForumTopicToggleIsClosed(data) + + case TypeChatEventForumTopicToggleIsHidden: + return UnmarshalChatEventForumTopicToggleIsHidden(data) + + case TypeChatEventForumTopicDeleted: + return UnmarshalChatEventForumTopicDeleted(data) + + case TypeChatEventForumTopicPinned: + return UnmarshalChatEventForumTopicPinned(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -2805,6 +4041,330 @@ func UnmarshalListOfLanguagePackStringValue(dataList []json.RawMessage) ([]Langu return list, nil } +func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumLimitTypeSupergroupCount: + return UnmarshalPremiumLimitTypeSupergroupCount(data) + + case TypePremiumLimitTypePinnedChatCount: + return UnmarshalPremiumLimitTypePinnedChatCount(data) + + case TypePremiumLimitTypeCreatedPublicChatCount: + return UnmarshalPremiumLimitTypeCreatedPublicChatCount(data) + + case TypePremiumLimitTypeSavedAnimationCount: + return UnmarshalPremiumLimitTypeSavedAnimationCount(data) + + case TypePremiumLimitTypeFavoriteStickerCount: + return UnmarshalPremiumLimitTypeFavoriteStickerCount(data) + + case TypePremiumLimitTypeChatFolderCount: + return UnmarshalPremiumLimitTypeChatFolderCount(data) + + case TypePremiumLimitTypeChatFolderChosenChatCount: + return UnmarshalPremiumLimitTypeChatFolderChosenChatCount(data) + + case TypePremiumLimitTypePinnedArchivedChatCount: + return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data) + + case TypePremiumLimitTypeCaptionLength: + return UnmarshalPremiumLimitTypeCaptionLength(data) + + case TypePremiumLimitTypeBioLength: + return UnmarshalPremiumLimitTypeBioLength(data) + + case TypePremiumLimitTypeChatFolderInviteLinkCount: + return UnmarshalPremiumLimitTypeChatFolderInviteLinkCount(data) + + case TypePremiumLimitTypeShareableChatFolderCount: + return UnmarshalPremiumLimitTypeShareableChatFolderCount(data) + + case TypePremiumLimitTypeActiveStoryCount: + return UnmarshalPremiumLimitTypeActiveStoryCount(data) + + case TypePremiumLimitTypeWeeklySentStoryCount: + return UnmarshalPremiumLimitTypeWeeklySentStoryCount(data) + + case TypePremiumLimitTypeMonthlySentStoryCount: + return UnmarshalPremiumLimitTypeMonthlySentStoryCount(data) + + case TypePremiumLimitTypeStoryCaptionLength: + return UnmarshalPremiumLimitTypeStoryCaptionLength(data) + + case TypePremiumLimitTypeStorySuggestedReactionAreaCount: + return UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumLimitType(dataList []json.RawMessage) ([]PremiumLimitType, error) { + list := []PremiumLimitType{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumLimitType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumFeatureIncreasedLimits: + return UnmarshalPremiumFeatureIncreasedLimits(data) + + case TypePremiumFeatureIncreasedUploadFileSize: + return UnmarshalPremiumFeatureIncreasedUploadFileSize(data) + + case TypePremiumFeatureImprovedDownloadSpeed: + return UnmarshalPremiumFeatureImprovedDownloadSpeed(data) + + case TypePremiumFeatureVoiceRecognition: + return UnmarshalPremiumFeatureVoiceRecognition(data) + + case TypePremiumFeatureDisabledAds: + return UnmarshalPremiumFeatureDisabledAds(data) + + case TypePremiumFeatureUniqueReactions: + return UnmarshalPremiumFeatureUniqueReactions(data) + + case TypePremiumFeatureUniqueStickers: + return UnmarshalPremiumFeatureUniqueStickers(data) + + case TypePremiumFeatureCustomEmoji: + return UnmarshalPremiumFeatureCustomEmoji(data) + + case TypePremiumFeatureAdvancedChatManagement: + return UnmarshalPremiumFeatureAdvancedChatManagement(data) + + case TypePremiumFeatureProfileBadge: + return UnmarshalPremiumFeatureProfileBadge(data) + + case TypePremiumFeatureEmojiStatus: + return UnmarshalPremiumFeatureEmojiStatus(data) + + case TypePremiumFeatureAnimatedProfilePhoto: + return UnmarshalPremiumFeatureAnimatedProfilePhoto(data) + + case TypePremiumFeatureForumTopicIcon: + return UnmarshalPremiumFeatureForumTopicIcon(data) + + case TypePremiumFeatureAppIcons: + return UnmarshalPremiumFeatureAppIcons(data) + + case TypePremiumFeatureRealTimeChatTranslation: + return UnmarshalPremiumFeatureRealTimeChatTranslation(data) + + case TypePremiumFeatureUpgradedStories: + return UnmarshalPremiumFeatureUpgradedStories(data) + + case TypePremiumFeatureChatBoost: + return UnmarshalPremiumFeatureChatBoost(data) + + case TypePremiumFeatureAccentColor: + return UnmarshalPremiumFeatureAccentColor(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumFeature(dataList []json.RawMessage) ([]PremiumFeature, error) { + list := []PremiumFeature{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumFeature(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPremiumStoryFeature(data json.RawMessage) (PremiumStoryFeature, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumStoryFeaturePriorityOrder: + return UnmarshalPremiumStoryFeaturePriorityOrder(data) + + case TypePremiumStoryFeatureStealthMode: + return UnmarshalPremiumStoryFeatureStealthMode(data) + + case TypePremiumStoryFeaturePermanentViewsHistory: + return UnmarshalPremiumStoryFeaturePermanentViewsHistory(data) + + case TypePremiumStoryFeatureCustomExpirationDuration: + return UnmarshalPremiumStoryFeatureCustomExpirationDuration(data) + + case TypePremiumStoryFeatureSaveStories: + return UnmarshalPremiumStoryFeatureSaveStories(data) + + case TypePremiumStoryFeatureLinksAndFormatting: + return UnmarshalPremiumStoryFeatureLinksAndFormatting(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumStoryFeature(dataList []json.RawMessage) ([]PremiumStoryFeature, error) { + list := []PremiumStoryFeature{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumStoryFeature(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPremiumSource(data json.RawMessage) (PremiumSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumSourceLimitExceeded: + return UnmarshalPremiumSourceLimitExceeded(data) + + case TypePremiumSourceFeature: + return UnmarshalPremiumSourceFeature(data) + + case TypePremiumSourceStoryFeature: + return UnmarshalPremiumSourceStoryFeature(data) + + case TypePremiumSourceLink: + return UnmarshalPremiumSourceLink(data) + + case TypePremiumSourceSettings: + return UnmarshalPremiumSourceSettings(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumSource(dataList []json.RawMessage) ([]PremiumSource, error) { + list := []PremiumSource{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStorePaymentPurpose(data json.RawMessage) (StorePaymentPurpose, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStorePaymentPurposePremiumSubscription: + return UnmarshalStorePaymentPurposePremiumSubscription(data) + + case TypeStorePaymentPurposeGiftedPremium: + return UnmarshalStorePaymentPurposeGiftedPremium(data) + + case TypeStorePaymentPurposePremiumGiftCodes: + return UnmarshalStorePaymentPurposePremiumGiftCodes(data) + + case TypeStorePaymentPurposePremiumGiveaway: + return UnmarshalStorePaymentPurposePremiumGiveaway(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStorePaymentPurpose(dataList []json.RawMessage) ([]StorePaymentPurpose, error) { + list := []StorePaymentPurpose{} + + for _, data := range dataList { + entity, err := UnmarshalStorePaymentPurpose(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalTelegramPaymentPurpose(data json.RawMessage) (TelegramPaymentPurpose, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTelegramPaymentPurposePremiumGiftCodes: + return UnmarshalTelegramPaymentPurposePremiumGiftCodes(data) + + case TypeTelegramPaymentPurposePremiumGiveaway: + return UnmarshalTelegramPaymentPurposePremiumGiveaway(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTelegramPaymentPurpose(dataList []json.RawMessage) ([]TelegramPaymentPurpose, error) { + list := []TelegramPaymentPurpose{} + + for _, data := range dataList { + entity, err := UnmarshalTelegramPaymentPurpose(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalDeviceToken(data json.RawMessage) (DeviceToken, error) { var meta meta @@ -2847,6 +4407,9 @@ func UnmarshalDeviceToken(data json.RawMessage) (DeviceToken, error) { case TypeDeviceTokenTizenPush: return UnmarshalDeviceTokenTizenPush(data) + case TypeDeviceTokenHuaweiPush: + return UnmarshalDeviceTokenHuaweiPush(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2955,6 +4518,9 @@ func UnmarshalInputBackground(data json.RawMessage) (InputBackground, error) { case TypeInputBackgroundRemote: return UnmarshalInputBackgroundRemote(data) + case TypeInputBackgroundPrevious: + return UnmarshalInputBackgroundPrevious(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2974,6 +4540,52 @@ func UnmarshalListOfInputBackground(dataList []json.RawMessage) ([]InputBackgrou return list, nil } +func UnmarshalCanSendStoryResult(data json.RawMessage) (CanSendStoryResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(data) + + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(data) + + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(data) + + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data) + + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(data) + + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCanSendStoryResult(dataList []json.RawMessage) ([]CanSendStoryResult, error) { + list := []CanSendStoryResult{} + + for _, data := range dataList { + entity, err := UnmarshalCanSendStoryResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCanTransferOwnershipResult(data json.RawMessage) (CanTransferOwnershipResult, error) { var meta meta @@ -3032,8 +4644,11 @@ func UnmarshalCheckChatUsernameResult(data json.RawMessage) (CheckChatUsernameRe case TypeCheckChatUsernameResultUsernameOccupied: return UnmarshalCheckChatUsernameResultUsernameOccupied(data) - case TypeCheckChatUsernameResultPublicChatsTooMuch: - return UnmarshalCheckChatUsernameResultPublicChatsTooMuch(data) + case TypeCheckChatUsernameResultUsernamePurchasable: + return UnmarshalCheckChatUsernameResultUsernamePurchasable(data) + + case TypeCheckChatUsernameResultPublicChatsTooMany: + return UnmarshalCheckChatUsernameResultPublicChatsTooMany(data) case TypeCheckChatUsernameResultPublicGroupsUnavailable: return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data) @@ -3213,12 +4828,21 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentPoll: return UnmarshalPushMessageContentPoll(data) + case TypePushMessageContentPremiumGiftCode: + return UnmarshalPushMessageContentPremiumGiftCode(data) + + case TypePushMessageContentPremiumGiveaway: + return UnmarshalPushMessageContentPremiumGiveaway(data) + case TypePushMessageContentScreenshotTaken: return UnmarshalPushMessageContentScreenshotTaken(data) case TypePushMessageContentSticker: return UnmarshalPushMessageContentSticker(data) + case TypePushMessageContentStory: + return UnmarshalPushMessageContentStory(data) + case TypePushMessageContentText: return UnmarshalPushMessageContentText(data) @@ -3243,6 +4867,9 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentChatChangeTitle: return UnmarshalPushMessageContentChatChangeTitle(data) + case TypePushMessageContentChatSetBackground: + return UnmarshalPushMessageContentChatSetBackground(data) + case TypePushMessageContentChatSetTheme: return UnmarshalPushMessageContentChatSetTheme(data) @@ -3255,6 +4882,12 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentChatJoinByRequest: return UnmarshalPushMessageContentChatJoinByRequest(data) + case TypePushMessageContentRecurringPayment: + return UnmarshalPushMessageContentRecurringPayment(data) + + case TypePushMessageContentSuggestProfilePhoto: + return UnmarshalPushMessageContentSuggestProfilePhoto(data) + case TypePushMessageContentMessageForwards: return UnmarshalPushMessageContentMessageForwards(data) @@ -3446,6 +5079,46 @@ func UnmarshalListOfJsonValue(dataList []json.RawMessage) ([]JsonValue, error) { return list, nil } +func UnmarshalStoryPrivacySettings(data json.RawMessage) (StoryPrivacySettings, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryPrivacySettingsEveryone: + return UnmarshalStoryPrivacySettingsEveryone(data) + + case TypeStoryPrivacySettingsContacts: + return UnmarshalStoryPrivacySettingsContacts(data) + + case TypeStoryPrivacySettingsCloseFriends: + return UnmarshalStoryPrivacySettingsCloseFriends(data) + + case TypeStoryPrivacySettingsSelectedUsers: + return UnmarshalStoryPrivacySettingsSelectedUsers(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryPrivacySettings(dataList []json.RawMessage) ([]StoryPrivacySettings, error) { + list := []StoryPrivacySettings{} + + for _, data := range dataList { + entity, err := UnmarshalStoryPrivacySettings(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalUserPrivacySettingRule(data json.RawMessage) (UserPrivacySettingRule, error) { var meta meta @@ -3519,6 +5192,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro case TypeUserPrivacySettingShowPhoneNumber: return UnmarshalUserPrivacySettingShowPhoneNumber(data) + case TypeUserPrivacySettingShowBio: + return UnmarshalUserPrivacySettingShowBio(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -3531,6 +5207,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro case TypeUserPrivacySettingAllowFindingByPhoneNumber: return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) + case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages: + return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3550,7 +5229,7 @@ func UnmarshalListOfUserPrivacySetting(dataList []json.RawMessage) ([]UserPrivac return list, nil } -func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { +func UnmarshalSessionType(data json.RawMessage) (SessionType, error) { var meta meta err := json.Unmarshal(data, &meta) @@ -3559,40 +5238,162 @@ func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { } switch meta.Type { - case TypeChatReportReasonSpam: - return UnmarshalChatReportReasonSpam(data) + case TypeSessionTypeAndroid: + return UnmarshalSessionTypeAndroid(data) - case TypeChatReportReasonViolence: - return UnmarshalChatReportReasonViolence(data) + case TypeSessionTypeApple: + return UnmarshalSessionTypeApple(data) - case TypeChatReportReasonPornography: - return UnmarshalChatReportReasonPornography(data) + case TypeSessionTypeBrave: + return UnmarshalSessionTypeBrave(data) - case TypeChatReportReasonChildAbuse: - return UnmarshalChatReportReasonChildAbuse(data) + case TypeSessionTypeChrome: + return UnmarshalSessionTypeChrome(data) - case TypeChatReportReasonCopyright: - return UnmarshalChatReportReasonCopyright(data) + case TypeSessionTypeEdge: + return UnmarshalSessionTypeEdge(data) - case TypeChatReportReasonUnrelatedLocation: - return UnmarshalChatReportReasonUnrelatedLocation(data) + case TypeSessionTypeFirefox: + return UnmarshalSessionTypeFirefox(data) - case TypeChatReportReasonFake: - return UnmarshalChatReportReasonFake(data) + case TypeSessionTypeIpad: + return UnmarshalSessionTypeIpad(data) - case TypeChatReportReasonCustom: - return UnmarshalChatReportReasonCustom(data) + case TypeSessionTypeIphone: + return UnmarshalSessionTypeIphone(data) + + case TypeSessionTypeLinux: + return UnmarshalSessionTypeLinux(data) + + case TypeSessionTypeMac: + return UnmarshalSessionTypeMac(data) + + case TypeSessionTypeOpera: + return UnmarshalSessionTypeOpera(data) + + case TypeSessionTypeSafari: + return UnmarshalSessionTypeSafari(data) + + case TypeSessionTypeUbuntu: + return UnmarshalSessionTypeUbuntu(data) + + case TypeSessionTypeUnknown: + return UnmarshalSessionTypeUnknown(data) + + case TypeSessionTypeVivaldi: + return UnmarshalSessionTypeVivaldi(data) + + case TypeSessionTypeWindows: + return UnmarshalSessionTypeWindows(data) + + case TypeSessionTypeXbox: + return UnmarshalSessionTypeXbox(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } } -func UnmarshalListOfChatReportReason(dataList []json.RawMessage) ([]ChatReportReason, error) { - list := []ChatReportReason{} +func UnmarshalListOfSessionType(dataList []json.RawMessage) ([]SessionType, error) { + list := []SessionType{} for _, data := range dataList { - entity, err := UnmarshalChatReportReason(data) + entity, err := UnmarshalSessionType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalReportReason(data json.RawMessage) (ReportReason, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeReportReasonSpam: + return UnmarshalReportReasonSpam(data) + + case TypeReportReasonViolence: + return UnmarshalReportReasonViolence(data) + + case TypeReportReasonPornography: + return UnmarshalReportReasonPornography(data) + + case TypeReportReasonChildAbuse: + return UnmarshalReportReasonChildAbuse(data) + + case TypeReportReasonCopyright: + return UnmarshalReportReasonCopyright(data) + + case TypeReportReasonUnrelatedLocation: + return UnmarshalReportReasonUnrelatedLocation(data) + + case TypeReportReasonFake: + return UnmarshalReportReasonFake(data) + + case TypeReportReasonIllegalDrugs: + return UnmarshalReportReasonIllegalDrugs(data) + + case TypeReportReasonPersonalDetails: + return UnmarshalReportReasonPersonalDetails(data) + + case TypeReportReasonCustom: + return UnmarshalReportReasonCustom(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfReportReason(dataList []json.RawMessage) ([]ReportReason, error) { + list := []ReportReason{} + + for _, data := range dataList { + entity, err := UnmarshalReportReason(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalTargetChat(data json.RawMessage) (TargetChat, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTargetChatCurrent: + return UnmarshalTargetChatCurrent(data) + + case TypeTargetChatChosen: + return UnmarshalTargetChatChosen(data) + + case TypeTargetChatInternalLink: + return UnmarshalTargetChatInternalLink(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTargetChat(dataList []json.RawMessage) ([]TargetChat, error) { + list := []TargetChat{} + + for _, data := range dataList { + entity, err := UnmarshalTargetChat(data) if err != nil { return nil, err } @@ -3614,12 +5415,18 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(data) + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(data) + case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(data) case TypeInternalLinkTypeBackground: return UnmarshalInternalLinkTypeBackground(data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(data) + case TypeInternalLinkTypeBotStart: return UnmarshalInternalLinkTypeBotStart(data) @@ -3629,18 +5436,39 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeChatBoost: + return UnmarshalInternalLinkTypeChatBoost(data) + + case TypeInternalLinkTypeChatFolderInvite: + return UnmarshalInternalLinkTypeChatFolderInvite(data) + + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(data) + case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) - case TypeInternalLinkTypeFilterSettings: - return UnmarshalInternalLinkTypeFilterSettings(data) + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeInstantView: + return UnmarshalInternalLinkTypeInstantView(data) + + case TypeInternalLinkTypeInvoice: + return UnmarshalInternalLinkTypeInvoice(data) + case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(data) @@ -3653,6 +5481,15 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(data) + + case TypeInternalLinkTypePremiumGiftCode: + return UnmarshalInternalLinkTypePremiumGiftCode(data) + + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -3662,12 +5499,21 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeQrCodeAuthentication: return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + case TypeInternalLinkTypeRestorePurchases: + return UnmarshalInternalLinkTypeRestorePurchases(data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) + case TypeInternalLinkTypeSideMenuBot: + return UnmarshalInternalLinkTypeSideMenuBot(data) + case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) + case TypeInternalLinkTypeStory: + return UnmarshalInternalLinkTypeStory(data) + case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) @@ -3680,9 +5526,18 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(data) + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(data) + + case TypeInternalLinkTypeUserToken: + return UnmarshalInternalLinkTypeUserToken(data) + case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(data) + case TypeInternalLinkTypeWebApp: + return UnmarshalInternalLinkTypeWebApp(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3702,6 +5557,40 @@ func UnmarshalListOfInternalLinkType(dataList []json.RawMessage) ([]InternalLink return list, nil } +func UnmarshalBlockList(data json.RawMessage) (BlockList, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBlockListMain: + return UnmarshalBlockListMain(data) + + case TypeBlockListStories: + return UnmarshalBlockListStories(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBlockList(dataList []json.RawMessage) ([]BlockList, error) { + list := []BlockList{} + + for _, data := range dataList { + entity, err := UnmarshalBlockList(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalFileType(data json.RawMessage) (FileType, error) { var meta meta @@ -3723,9 +5612,15 @@ func UnmarshalFileType(data json.RawMessage) (FileType, error) { case TypeFileTypeDocument: return UnmarshalFileTypeDocument(data) + case TypeFileTypeNotificationSound: + return UnmarshalFileTypeNotificationSound(data) + case TypeFileTypePhoto: return UnmarshalFileTypePhoto(data) + case TypeFileTypePhotoStory: + return UnmarshalFileTypePhotoStory(data) + case TypeFileTypeProfilePhoto: return UnmarshalFileTypeProfilePhoto(data) @@ -3753,6 +5648,9 @@ func UnmarshalFileType(data json.RawMessage) (FileType, error) { case TypeFileTypeVideoNote: return UnmarshalFileTypeVideoNote(data) + case TypeFileTypeVideoStory: + return UnmarshalFileTypeVideoStory(data) + case TypeFileTypeVoiceNote: return UnmarshalFileTypeVoiceNote(data) @@ -3855,6 +5753,46 @@ func UnmarshalListOfNetworkStatisticsEntry(dataList []json.RawMessage) ([]Networ return list, nil } +func UnmarshalAutosaveSettingsScope(data json.RawMessage) (AutosaveSettingsScope, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeAutosaveSettingsScopePrivateChats: + return UnmarshalAutosaveSettingsScopePrivateChats(data) + + case TypeAutosaveSettingsScopeGroupChats: + return UnmarshalAutosaveSettingsScopeGroupChats(data) + + case TypeAutosaveSettingsScopeChannelChats: + return UnmarshalAutosaveSettingsScopeChannelChats(data) + + case TypeAutosaveSettingsScopeChat: + return UnmarshalAutosaveSettingsScopeChat(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfAutosaveSettingsScope(dataList []json.RawMessage) ([]AutosaveSettingsScope, error) { + list := []AutosaveSettingsScope{} + + for _, data := range dataList { + entity, err := UnmarshalAutosaveSettingsScope(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalConnectionState(data json.RawMessage) (ConnectionState, error) { var meta meta @@ -4014,6 +5952,15 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { case TypeSuggestedActionSetPassword: return UnmarshalSuggestedActionSetPassword(data) + case TypeSuggestedActionUpgradePremium: + return UnmarshalSuggestedActionUpgradePremium(data) + + case TypeSuggestedActionRestorePremium: + return UnmarshalSuggestedActionRestorePremium(data) + + case TypeSuggestedActionSubscribeToAnnualPremium: + return UnmarshalSuggestedActionSubscribeToAnnualPremium(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -4104,40 +6051,6 @@ func UnmarshalListOfProxyType(dataList []json.RawMessage) ([]ProxyType, error) { return list, nil } -func UnmarshalInputSticker(data json.RawMessage) (InputSticker, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeInputStickerStatic: - return UnmarshalInputStickerStatic(data) - - case TypeInputStickerAnimated: - return UnmarshalInputStickerAnimated(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfInputSticker(dataList []json.RawMessage) ([]InputSticker, error) { - list := []InputSticker{} - - for _, data := range dataList { - entity, err := UnmarshalInputSticker(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalStatisticalGraph(data json.RawMessage) (StatisticalGraph, error) { var meta meta @@ -4334,6 +6247,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(data) + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(data) + case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(data) @@ -4346,6 +6262,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatPhoto: return UnmarshalUpdateChatPhoto(data) + case TypeUpdateChatAccentColor: + return UnmarshalUpdateChatAccentColor(data) + + case TypeUpdateChatBackgroundCustomEmoji: + return UnmarshalUpdateChatBackgroundCustomEmoji(data) + case TypeUpdateChatPermissions: return UnmarshalUpdateChatPermissions(data) @@ -4364,14 +6286,17 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(data) + case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(data) case TypeUpdateChatMessageSender: return UnmarshalUpdateChatMessageSender(data) - case TypeUpdateChatMessageTtl: - return UnmarshalUpdateChatMessageTtl(data) + case TypeUpdateChatMessageAutoDeleteTime: + return UnmarshalUpdateChatMessageAutoDeleteTime(data) case TypeUpdateChatNotificationSettings: return UnmarshalUpdateChatNotificationSettings(data) @@ -4382,12 +6307,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(data) + case TypeUpdateChatBackground: + return UnmarshalUpdateChatBackground(data) + case TypeUpdateChatTheme: return UnmarshalUpdateChatTheme(data) case TypeUpdateChatUnreadMentionCount: return UnmarshalUpdateChatUnreadMentionCount(data) + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(data) + case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(data) @@ -4397,21 +6328,27 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatHasProtectedContent: return UnmarshalUpdateChatHasProtectedContent(data) - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(data) - - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(data) + case TypeUpdateChatIsTranslatable: + return UnmarshalUpdateChatIsTranslatable(data) case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(data) - case TypeUpdateChatFilters: - return UnmarshalUpdateChatFilters(data) + case TypeUpdateChatBlockList: + return UnmarshalUpdateChatBlockList(data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(data) + + case TypeUpdateChatFolders: + return UnmarshalUpdateChatFolders(data) case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) + case TypeUpdateForumTopicInfo: + return UnmarshalUpdateForumTopicInfo(data) + case TypeUpdateScopeNotificationSettings: return UnmarshalUpdateScopeNotificationSettings(data) @@ -4469,6 +6406,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(data) + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(data) + + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(data) + + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(data) + + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(data) + case TypeUpdateCall: return UnmarshalUpdateCall(data) @@ -4490,6 +6439,27 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateUnreadChatCount: return UnmarshalUpdateUnreadChatCount(data) + case TypeUpdateStory: + return UnmarshalUpdateStory(data) + + case TypeUpdateStoryDeleted: + return UnmarshalUpdateStoryDeleted(data) + + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(data) + + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(data) + + case TypeUpdateChatActiveStories: + return UnmarshalUpdateChatActiveStories(data) + + case TypeUpdateStoryListChatCount: + return UnmarshalUpdateStoryListChatCount(data) + + case TypeUpdateStoryStealthMode: + return UnmarshalUpdateStoryStealthMode(data) + case TypeUpdateOption: return UnmarshalUpdateOption(data) @@ -4511,12 +6481,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(data) + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(data) + case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(data) case TypeUpdateChatThemes: return UnmarshalUpdateChatThemes(data) + case TypeUpdateAccentColors: + return UnmarshalUpdateAccentColors(data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(data) @@ -4529,6 +6505,21 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(data) + case TypeUpdateUnconfirmedSession: + return UnmarshalUpdateUnconfirmedSession(data) + + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(data) + + case TypeUpdateActiveEmojiReactions: + return UnmarshalUpdateActiveEmojiReactions(data) + + case TypeUpdateDefaultReactionType: + return UnmarshalUpdateDefaultReactionType(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) @@ -4541,6 +6532,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(data) + case TypeUpdateAddChatMembersPrivacyForbidden: + return UnmarshalUpdateAddChatMembersPrivacyForbidden(data) + + case TypeUpdateAutosaveSettings: + return UnmarshalUpdateAutosaveSettings(data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(data) @@ -4577,6 +6574,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateNewChatJoinRequest: return UnmarshalUpdateNewChatJoinRequest(data) + case TypeUpdateChatBoost: + return UnmarshalUpdateChatBoost(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -4649,14 +6649,6 @@ func UnmarshalOk(data json.RawMessage) (*Ok, error) { return &resp, err } -func UnmarshalTdlibParameters(data json.RawMessage) (*TdlibParameters, error) { - var resp TdlibParameters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalAuthenticationCodeTypeTelegramMessage(data json.RawMessage) (*AuthenticationCodeTypeTelegramMessage, error) { var resp AuthenticationCodeTypeTelegramMessage @@ -4697,6 +6689,30 @@ func UnmarshalAuthenticationCodeTypeMissedCall(data json.RawMessage) (*Authentic return &resp, err } +func UnmarshalAuthenticationCodeTypeFragment(data json.RawMessage) (*AuthenticationCodeTypeFragment, error) { + var resp AuthenticationCodeTypeFragment + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuthenticationCodeTypeFirebaseAndroid(data json.RawMessage) (*AuthenticationCodeTypeFirebaseAndroid, error) { + var resp AuthenticationCodeTypeFirebaseAndroid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuthenticationCodeTypeFirebaseIos(data json.RawMessage) (*AuthenticationCodeTypeFirebaseIos, error) { + var resp AuthenticationCodeTypeFirebaseIos + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAuthenticationCodeInfo(data json.RawMessage) (*AuthenticationCodeInfo, error) { var resp AuthenticationCodeInfo @@ -4713,6 +6729,46 @@ func UnmarshalEmailAddressAuthenticationCodeInfo(data json.RawMessage) (*EmailAd return &resp, err } +func UnmarshalEmailAddressAuthenticationCode(data json.RawMessage) (*EmailAddressAuthenticationCode, error) { + var resp EmailAddressAuthenticationCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmailAddressAuthenticationAppleId(data json.RawMessage) (*EmailAddressAuthenticationAppleId, error) { + var resp EmailAddressAuthenticationAppleId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmailAddressAuthenticationGoogleId(data json.RawMessage) (*EmailAddressAuthenticationGoogleId, error) { + var resp EmailAddressAuthenticationGoogleId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func 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) { var resp TextEntity @@ -4753,16 +6809,24 @@ func UnmarshalAuthorizationStateWaitTdlibParameters(data json.RawMessage) (*Auth return &resp, err } -func UnmarshalAuthorizationStateWaitEncryptionKey(data json.RawMessage) (*AuthorizationStateWaitEncryptionKey, error) { - var resp AuthorizationStateWaitEncryptionKey +func UnmarshalAuthorizationStateWaitPhoneNumber(data json.RawMessage) (*AuthorizationStateWaitPhoneNumber, error) { + var resp AuthorizationStateWaitPhoneNumber err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalAuthorizationStateWaitPhoneNumber(data json.RawMessage) (*AuthorizationStateWaitPhoneNumber, error) { - var resp AuthorizationStateWaitPhoneNumber +func UnmarshalAuthorizationStateWaitEmailAddress(data json.RawMessage) (*AuthorizationStateWaitEmailAddress, error) { + var resp AuthorizationStateWaitEmailAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuthorizationStateWaitEmailCode(data json.RawMessage) (*AuthorizationStateWaitEmailCode, error) { + var resp AuthorizationStateWaitEmailCode err := json.Unmarshal(data, &resp) @@ -4937,22 +7001,6 @@ func UnmarshalThumbnailFormatJpeg(data json.RawMessage) (*ThumbnailFormatJpeg, e return &resp, err } -func UnmarshalThumbnailFormatPng(data json.RawMessage) (*ThumbnailFormatPng, error) { - var resp ThumbnailFormatPng - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalThumbnailFormatWebp(data json.RawMessage) (*ThumbnailFormatWebp, error) { - var resp ThumbnailFormatWebp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalThumbnailFormatGif(data json.RawMessage) (*ThumbnailFormatGif, error) { var resp ThumbnailFormatGif @@ -4961,6 +7009,22 @@ func UnmarshalThumbnailFormatGif(data json.RawMessage) (*ThumbnailFormatGif, err return &resp, err } +func UnmarshalThumbnailFormatMpeg4(data json.RawMessage) (*ThumbnailFormatMpeg4, error) { + var resp ThumbnailFormatMpeg4 + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalThumbnailFormatPng(data json.RawMessage) (*ThumbnailFormatPng, error) { + var resp ThumbnailFormatPng + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalThumbnailFormatTgs(data json.RawMessage) (*ThumbnailFormatTgs, error) { var resp ThumbnailFormatTgs @@ -4969,8 +7033,16 @@ func UnmarshalThumbnailFormatTgs(data json.RawMessage) (*ThumbnailFormatTgs, err return &resp, err } -func UnmarshalThumbnailFormatMpeg4(data json.RawMessage) (*ThumbnailFormatMpeg4, error) { - var resp ThumbnailFormatMpeg4 +func UnmarshalThumbnailFormatWebm(data json.RawMessage) (*ThumbnailFormatWebm, error) { + var resp ThumbnailFormatWebm + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalThumbnailFormatWebp(data json.RawMessage) (*ThumbnailFormatWebp, error) { + var resp ThumbnailFormatWebp err := json.Unmarshal(data, &resp) @@ -5025,6 +7097,78 @@ func UnmarshalMaskPosition(data json.RawMessage) (*MaskPosition, error) { return &resp, err } +func UnmarshalStickerFormatWebp(data json.RawMessage) (*StickerFormatWebp, error) { + var resp StickerFormatWebp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerFormatTgs(data json.RawMessage) (*StickerFormatTgs, error) { + var resp StickerFormatTgs + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerFormatWebm(data json.RawMessage) (*StickerFormatWebm, error) { + var resp StickerFormatWebm + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerTypeRegular(data json.RawMessage) (*StickerTypeRegular, error) { + var resp StickerTypeRegular + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerTypeMask(data json.RawMessage) (*StickerTypeMask, error) { + var resp StickerTypeMask + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerTypeCustomEmoji(data json.RawMessage) (*StickerTypeCustomEmoji, error) { + var resp StickerTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerFullTypeRegular(data json.RawMessage) (*StickerFullTypeRegular, error) { + var resp StickerFullTypeRegular + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerFullTypeMask(data json.RawMessage) (*StickerFullTypeMask, error) { + var resp StickerFullTypeMask + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerFullTypeCustomEmoji(data json.RawMessage) (*StickerFullTypeCustomEmoji, error) { + var resp StickerFullTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalClosedVectorPath(data json.RawMessage) (*ClosedVectorPath, error) { var resp ClosedVectorPath @@ -5161,6 +7305,14 @@ func UnmarshalGame(data json.RawMessage) (*Game, error) { return &resp, err } +func UnmarshalWebApp(data json.RawMessage) (*WebApp, error) { + var resp WebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPoll(data json.RawMessage) (*Poll, error) { var resp Poll @@ -5169,6 +7321,30 @@ func UnmarshalPoll(data json.RawMessage) (*Poll, error) { return &resp, err } +func UnmarshalBackground(data json.RawMessage) (*Background, error) { + var resp Background + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBackgrounds(data json.RawMessage) (*Backgrounds, error) { + var resp Backgrounds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBackground(data json.RawMessage) (*ChatBackground, error) { + var resp ChatBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalProfilePhoto(data json.RawMessage) (*ProfilePhoto, error) { var resp ProfilePhoto @@ -5233,6 +7409,14 @@ func UnmarshalBotCommands(data json.RawMessage) (*BotCommands, error) { return &resp, err } +func UnmarshalBotMenuButton(data json.RawMessage) (*BotMenuButton, error) { + var resp BotMenuButton + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { var resp ChatLocation @@ -5241,6 +7425,30 @@ func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { return &resp, err } +func UnmarshalChatPhotoStickerTypeRegularOrMask(data json.RawMessage) (*ChatPhotoStickerTypeRegularOrMask, error) { + var resp ChatPhotoStickerTypeRegularOrMask + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPhotoStickerTypeCustomEmoji(data json.RawMessage) (*ChatPhotoStickerTypeCustomEmoji, error) { + var resp ChatPhotoStickerTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPhotoSticker(data json.RawMessage) (*ChatPhotoSticker, error) { + var resp ChatPhotoSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAnimatedChatPhoto(data json.RawMessage) (*AnimatedChatPhoto, error) { var resp AnimatedChatPhoto @@ -5289,6 +7497,158 @@ func UnmarshalInputChatPhotoAnimation(data json.RawMessage) (*InputChatPhotoAnim return &resp, err } +func UnmarshalInputChatPhotoSticker(data json.RawMessage) (*InputChatPhotoSticker, error) { + var resp InputChatPhotoSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { + var resp ChatPermissions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorRights, error) { + var resp ChatAdministratorRights + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumPaymentOption(data json.RawMessage) (*PremiumPaymentOption, error) { + var resp PremiumPaymentOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStatePaymentOption(data json.RawMessage) (*PremiumStatePaymentOption, error) { + var resp PremiumStatePaymentOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiftCodePaymentOption(data json.RawMessage) (*PremiumGiftCodePaymentOption, error) { + var resp PremiumGiftCodePaymentOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiftCodePaymentOptions(data json.RawMessage) (*PremiumGiftCodePaymentOptions, error) { + var resp PremiumGiftCodePaymentOptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiftCodeInfo(data json.RawMessage) (*PremiumGiftCodeInfo, error) { + var resp PremiumGiftCodeInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusEligible(data json.RawMessage) (*PremiumGiveawayParticipantStatusEligible, error) { + var resp PremiumGiveawayParticipantStatusEligible + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusParticipating(data json.RawMessage) (*PremiumGiveawayParticipantStatusParticipating, error) { + var resp PremiumGiveawayParticipantStatusParticipating + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusAlreadyWasMember(data json.RawMessage) (*PremiumGiveawayParticipantStatusAlreadyWasMember, error) { + var resp PremiumGiveawayParticipantStatusAlreadyWasMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusAdministrator(data json.RawMessage) (*PremiumGiveawayParticipantStatusAdministrator, error) { + var resp PremiumGiveawayParticipantStatusAdministrator + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusDisallowedCountry(data json.RawMessage) (*PremiumGiveawayParticipantStatusDisallowedCountry, error) { + var resp PremiumGiveawayParticipantStatusDisallowedCountry + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayInfoOngoing(data json.RawMessage) (*PremiumGiveawayInfoOngoing, error) { + var resp PremiumGiveawayInfoOngoing + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayInfoCompleted(data json.RawMessage) (*PremiumGiveawayInfoCompleted, error) { + var resp PremiumGiveawayInfoCompleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAccentColor(data json.RawMessage) (*AccentColor, error) { + var resp AccentColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiStatus(data json.RawMessage) (*EmojiStatus, error) { + var resp EmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiStatuses(data json.RawMessage) (*EmojiStatuses, error) { + var resp EmojiStatuses + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUsernames(data json.RawMessage) (*Usernames, error) { + var resp Usernames + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUser(data json.RawMessage) (*User, error) { var resp User @@ -5297,6 +7657,14 @@ func UnmarshalUser(data json.RawMessage) (*User, error) { return &resp, err } +func UnmarshalBotInfo(data json.RawMessage) (*BotInfo, error) { + var resp BotInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserFullInfo(data json.RawMessage) (*UserFullInfo, error) { var resp UserFullInfo @@ -5329,14 +7697,6 @@ func UnmarshalChatAdministrators(data json.RawMessage) (*ChatAdministrators, err return &resp, err } -func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { - var resp ChatPermissions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatMemberStatusCreator(data json.RawMessage) (*ChatMemberStatusCreator, error) { var resp ChatMemberStatusCreator @@ -5569,6 +7929,30 @@ func UnmarshalChatInviteLinkMembers(data json.RawMessage) (*ChatInviteLinkMember return &resp, err } +func UnmarshalInviteLinkChatTypeBasicGroup(data json.RawMessage) (*InviteLinkChatTypeBasicGroup, error) { + var resp InviteLinkChatTypeBasicGroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInviteLinkChatTypeSupergroup(data json.RawMessage) (*InviteLinkChatTypeSupergroup, error) { + var resp InviteLinkChatTypeSupergroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInviteLinkChatTypeChannel(data json.RawMessage) (*InviteLinkChatTypeChannel, error) { + var resp InviteLinkChatTypeChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatInviteLinkInfo(data json.RawMessage) (*ChatInviteLinkInfo, error) { var resp ChatInviteLinkInfo @@ -5689,40 +8073,80 @@ func UnmarshalMessageSenders(data json.RawMessage) (*MessageSenders, error) { return &resp, err } -func UnmarshalMessageForwardOriginUser(data json.RawMessage) (*MessageForwardOriginUser, error) { - var resp MessageForwardOriginUser +func UnmarshalChatMessageSender(data json.RawMessage) (*ChatMessageSender, error) { + var resp ChatMessageSender err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalMessageForwardOriginChat(data json.RawMessage) (*MessageForwardOriginChat, error) { - var resp MessageForwardOriginChat +func UnmarshalChatMessageSenders(data json.RawMessage) (*ChatMessageSenders, error) { + var resp ChatMessageSenders err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalMessageForwardOriginHiddenUser(data json.RawMessage) (*MessageForwardOriginHiddenUser, error) { - var resp MessageForwardOriginHiddenUser +func UnmarshalMessageViewer(data json.RawMessage) (*MessageViewer, error) { + var resp MessageViewer err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalMessageForwardOriginChannel(data json.RawMessage) (*MessageForwardOriginChannel, error) { - var resp MessageForwardOriginChannel +func UnmarshalMessageViewers(data json.RawMessage) (*MessageViewers, error) { + var resp MessageViewers err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalMessageForwardOriginMessageImport(data json.RawMessage) (*MessageForwardOriginMessageImport, error) { - var resp MessageForwardOriginMessageImport +func UnmarshalMessageOriginUser(data json.RawMessage) (*MessageOriginUser, error) { + var resp MessageOriginUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageOriginHiddenUser(data json.RawMessage) (*MessageOriginHiddenUser, error) { + var resp MessageOriginHiddenUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageOriginChat(data json.RawMessage) (*MessageOriginChat, error) { + var resp MessageOriginChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageOriginChannel(data json.RawMessage) (*MessageOriginChannel, error) { + var resp MessageOriginChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionTypeEmoji(data json.RawMessage) (*ReactionTypeEmoji, error) { + var resp ReactionTypeEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionTypeCustomEmoji(data json.RawMessage) (*ReactionTypeCustomEmoji, error) { + var resp ReactionTypeCustomEmoji err := json.Unmarshal(data, &resp) @@ -5737,6 +8161,14 @@ func UnmarshalMessageForwardInfo(data json.RawMessage) (*MessageForwardInfo, err return &resp, err } +func UnmarshalMessageImportInfo(data json.RawMessage) (*MessageImportInfo, error) { + var resp MessageImportInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageReplyInfo(data json.RawMessage) (*MessageReplyInfo, error) { var resp MessageReplyInfo @@ -5745,6 +8177,14 @@ func UnmarshalMessageReplyInfo(data json.RawMessage) (*MessageReplyInfo, error) return &resp, err } +func UnmarshalMessageReaction(data json.RawMessage) (*MessageReaction, error) { + var resp MessageReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionInfo, error) { var resp MessageInteractionInfo @@ -5753,6 +8193,14 @@ func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionI return &resp, err } +func UnmarshalUnreadReaction(data json.RawMessage) (*UnreadReaction, error) { + var resp UnreadReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageSendingStatePending(data json.RawMessage) (*MessageSendingStatePending, error) { var resp MessageSendingStatePending @@ -5769,6 +8217,38 @@ func UnmarshalMessageSendingStateFailed(data json.RawMessage) (*MessageSendingSt return &resp, err } +func UnmarshalMessageReplyToMessage(data json.RawMessage) (*MessageReplyToMessage, error) { + var resp MessageReplyToMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReplyToStory(data json.RawMessage) (*MessageReplyToStory, error) { + var resp MessageReplyToStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageReplyToMessage(data json.RawMessage) (*InputMessageReplyToMessage, error) { + var resp InputMessageReplyToMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageReplyToStory(data json.RawMessage) (*InputMessageReplyToStory, error) { + var resp InputMessageReplyToStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessage(data json.RawMessage) (*Message, error) { var resp Message @@ -5793,6 +8273,14 @@ func UnmarshalFoundMessages(data json.RawMessage) (*FoundMessages, error) { return &resp, err } +func UnmarshalFoundChatMessages(data json.RawMessage) (*FoundChatMessages, error) { + var resp FoundChatMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessagePosition(data json.RawMessage) (*MessagePosition, error) { var resp MessagePosition @@ -5825,6 +8313,126 @@ func UnmarshalMessageCalendar(data json.RawMessage) (*MessageCalendar, error) { return &resp, err } +func UnmarshalMessageSourceChatHistory(data json.RawMessage) (*MessageSourceChatHistory, error) { + var resp MessageSourceChatHistory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceMessageThreadHistory(data json.RawMessage) (*MessageSourceMessageThreadHistory, error) { + var resp MessageSourceMessageThreadHistory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceForumTopicHistory(data json.RawMessage) (*MessageSourceForumTopicHistory, error) { + var resp MessageSourceForumTopicHistory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceHistoryPreview(data json.RawMessage) (*MessageSourceHistoryPreview, error) { + var resp MessageSourceHistoryPreview + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceChatList(data json.RawMessage) (*MessageSourceChatList, error) { + var resp MessageSourceChatList + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceSearch(data json.RawMessage) (*MessageSourceSearch, error) { + var resp MessageSourceSearch + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceChatEventLog(data json.RawMessage) (*MessageSourceChatEventLog, error) { + var resp MessageSourceChatEventLog + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceNotification(data json.RawMessage) (*MessageSourceNotification, error) { + var resp MessageSourceNotification + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceScreenshot(data json.RawMessage) (*MessageSourceScreenshot, error) { + var resp MessageSourceScreenshot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceOther(data json.RawMessage) (*MessageSourceOther, error) { + var resp MessageSourceOther + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypeBot(data json.RawMessage) (*MessageSponsorTypeBot, error) { + var resp MessageSponsorTypeBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypePublicChannel(data json.RawMessage) (*MessageSponsorTypePublicChannel, error) { + var resp MessageSponsorTypePublicChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypePrivateChannel(data json.RawMessage) (*MessageSponsorTypePrivateChannel, error) { + var resp MessageSponsorTypePrivateChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypeWebsite(data json.RawMessage) (*MessageSponsorTypeWebsite, error) { + var resp MessageSponsorTypeWebsite + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsor(data json.RawMessage) (*MessageSponsor, error) { + var resp MessageSponsor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error) { var resp SponsoredMessage @@ -5833,6 +8441,38 @@ func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error) return &resp, err } +func UnmarshalSponsoredMessages(data json.RawMessage) (*SponsoredMessages, error) { + var resp SponsoredMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFileDownload(data json.RawMessage) (*FileDownload, error) { + var resp FileDownload + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDownloadedFileCounts(data json.RawMessage) (*DownloadedFileCounts, error) { + var resp DownloadedFileCounts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundFileDownloads(data json.RawMessage) (*FoundFileDownloads, error) { + var resp FoundFileDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalNotificationSettingsScopePrivateChats(data json.RawMessage) (*NotificationSettingsScopePrivateChats, error) { var resp NotificationSettingsScopePrivateChats @@ -5913,32 +8553,72 @@ func UnmarshalChatTypeSecret(data json.RawMessage) (*ChatTypeSecret, error) { return &resp, err } -func UnmarshalChatFilter(data json.RawMessage) (*ChatFilter, error) { - var resp ChatFilter +func UnmarshalChatFolderIcon(data json.RawMessage) (*ChatFolderIcon, error) { + var resp ChatFolderIcon err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatFilterInfo(data json.RawMessage) (*ChatFilterInfo, error) { - var resp ChatFilterInfo +func UnmarshalChatFolder(data json.RawMessage) (*ChatFolder, error) { + var resp ChatFolder err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalRecommendedChatFilter(data json.RawMessage) (*RecommendedChatFilter, error) { - var resp RecommendedChatFilter +func UnmarshalChatFolderInfo(data json.RawMessage) (*ChatFolderInfo, error) { + var resp ChatFolderInfo err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalRecommendedChatFilters(data json.RawMessage) (*RecommendedChatFilters, error) { - var resp RecommendedChatFilters +func UnmarshalChatFolderInviteLink(data json.RawMessage) (*ChatFolderInviteLink, error) { + var resp ChatFolderInviteLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFolderInviteLinks(data json.RawMessage) (*ChatFolderInviteLinks, error) { + var resp ChatFolderInviteLinks + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFolderInviteLinkInfo(data json.RawMessage) (*ChatFolderInviteLinkInfo, error) { + var resp ChatFolderInviteLinkInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRecommendedChatFolder(data json.RawMessage) (*RecommendedChatFolder, error) { + var resp RecommendedChatFolder + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRecommendedChatFolders(data json.RawMessage) (*RecommendedChatFolders, error) { + var resp RecommendedChatFolders + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalArchiveChatListSettings(data json.RawMessage) (*ArchiveChatListSettings, error) { + var resp ArchiveChatListSettings err := json.Unmarshal(data, &resp) @@ -5961,8 +8641,8 @@ func UnmarshalChatListArchive(data json.RawMessage) (*ChatListArchive, error) { return &resp, err } -func UnmarshalChatListFilter(data json.RawMessage) (*ChatListFilter, error) { - var resp ChatListFilter +func UnmarshalChatListFolder(data json.RawMessage) (*ChatListFolder, error) { + var resp ChatListFolder err := json.Unmarshal(data, &resp) @@ -6001,6 +8681,22 @@ func UnmarshalChatPosition(data json.RawMessage) (*ChatPosition, error) { return &resp, err } +func UnmarshalChatAvailableReactionsAll(data json.RawMessage) (*ChatAvailableReactionsAll, error) { + var resp ChatAvailableReactionsAll + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAvailableReactionsSome(data json.RawMessage) (*ChatAvailableReactionsSome, error) { + var resp ChatAvailableReactionsSome + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalVideoChat(data json.RawMessage) (*VideoChat, error) { var resp VideoChat @@ -6145,6 +8841,30 @@ func UnmarshalKeyboardButtonTypeRequestPoll(data json.RawMessage) (*KeyboardButt return &resp, err } +func UnmarshalKeyboardButtonTypeRequestUser(data json.RawMessage) (*KeyboardButtonTypeRequestUser, error) { + var resp KeyboardButtonTypeRequestUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButtonTypeRequestChat(data json.RawMessage) (*KeyboardButtonTypeRequestChat, error) { + var resp KeyboardButtonTypeRequestChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButtonTypeWebApp(data json.RawMessage) (*KeyboardButtonTypeWebApp, error) { + var resp KeyboardButtonTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButton(data json.RawMessage) (*KeyboardButton, error) { var resp KeyboardButton @@ -6169,6 +8889,14 @@ func UnmarshalInlineKeyboardButtonTypeLoginUrl(data json.RawMessage) (*InlineKey return &resp, err } +func UnmarshalInlineKeyboardButtonTypeWebApp(data json.RawMessage) (*InlineKeyboardButtonTypeWebApp, error) { + var resp InlineKeyboardButtonTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInlineKeyboardButtonTypeCallback(data json.RawMessage) (*InlineKeyboardButtonTypeCallback, error) { var resp InlineKeyboardButtonTypeCallback @@ -6273,6 +9001,22 @@ func UnmarshalLoginUrlInfoRequestConfirmation(data json.RawMessage) (*LoginUrlIn return &resp, err } +func UnmarshalFoundWebApp(data json.RawMessage) (*FoundWebApp, error) { + var resp FoundWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebAppInfo(data json.RawMessage) (*WebAppInfo, error) { + var resp WebAppInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error) { var resp MessageThreadInfo @@ -6281,6 +9025,46 @@ func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error return &resp, err } +func UnmarshalForumTopicIcon(data json.RawMessage) (*ForumTopicIcon, error) { + var resp ForumTopicIcon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForumTopicInfo(data json.RawMessage) (*ForumTopicInfo, error) { + var resp ForumTopicInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForumTopic(data json.RawMessage) (*ForumTopic, error) { + var resp ForumTopic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForumTopics(data json.RawMessage) (*ForumTopics, error) { + var resp ForumTopics + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewOptions(data json.RawMessage) (*LinkPreviewOptions, error) { + var resp LinkPreviewOptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { var resp RichTextPlain @@ -6793,6 +9577,14 @@ func UnmarshalAddress(data json.RawMessage) (*Address, error) { return &resp, err } +func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) { + var resp ThemeParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalLabeledPricePart(data json.RawMessage) (*LabeledPricePart, error) { var resp LabeledPricePart @@ -6865,16 +9657,32 @@ func UnmarshalInputCredentialsGooglePay(data json.RawMessage) (*InputCredentials return &resp, err } -func UnmarshalPaymentsProviderStripe(data json.RawMessage) (*PaymentsProviderStripe, error) { - var resp PaymentsProviderStripe +func UnmarshalPaymentProviderSmartGlocal(data json.RawMessage) (*PaymentProviderSmartGlocal, error) { + var resp PaymentProviderSmartGlocal err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalPaymentFormTheme(data json.RawMessage) (*PaymentFormTheme, error) { - var resp PaymentFormTheme +func UnmarshalPaymentProviderStripe(data json.RawMessage) (*PaymentProviderStripe, error) { + var resp PaymentProviderStripe + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentProviderOther(data json.RawMessage) (*PaymentProviderOther, error) { + var resp PaymentProviderOther + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentOption(data json.RawMessage) (*PaymentOption, error) { + var resp PaymentOption err := json.Unmarshal(data, &resp) @@ -6913,6 +9721,70 @@ func UnmarshalPaymentReceipt(data json.RawMessage) (*PaymentReceipt, error) { return &resp, err } +func UnmarshalInputInvoiceMessage(data json.RawMessage) (*InputInvoiceMessage, error) { + var resp InputInvoiceMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInvoiceName(data json.RawMessage) (*InputInvoiceName, error) { + var resp InputInvoiceName + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInvoiceTelegram(data json.RawMessage) (*InputInvoiceTelegram, error) { + var resp InputInvoiceTelegram + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaPreview(data json.RawMessage) (*MessageExtendedMediaPreview, error) { + var resp MessageExtendedMediaPreview + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaPhoto(data json.RawMessage) (*MessageExtendedMediaPhoto, error) { + var resp MessageExtendedMediaPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaVideo(data json.RawMessage) (*MessageExtendedMediaVideo, error) { + var resp MessageExtendedMediaVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaUnsupported(data json.RawMessage) (*MessageExtendedMediaUnsupported, error) { + var resp MessageExtendedMediaUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParameters(data json.RawMessage) (*PremiumGiveawayParameters, error) { + var resp PremiumGiveawayParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDatedFile(data json.RawMessage) (*DatedFile, error) { var resp DatedFile @@ -7641,6 +10513,14 @@ func UnmarshalMessagePoll(data json.RawMessage) (*MessagePoll, error) { return &resp, err } +func UnmarshalMessageStory(data json.RawMessage) (*MessageStory, error) { + var resp MessageStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageInvoice(data json.RawMessage) (*MessageInvoice, error) { var resp MessageInvoice @@ -7793,6 +10673,14 @@ func UnmarshalMessageScreenshotTaken(data json.RawMessage) (*MessageScreenshotTa return &resp, err } +func UnmarshalMessageChatSetBackground(data json.RawMessage) (*MessageChatSetBackground, error) { + var resp MessageChatSetBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageChatSetTheme(data json.RawMessage) (*MessageChatSetTheme, error) { var resp MessageChatSetTheme @@ -7801,8 +10689,48 @@ func UnmarshalMessageChatSetTheme(data json.RawMessage) (*MessageChatSetTheme, e return &resp, err } -func UnmarshalMessageChatSetTtl(data json.RawMessage) (*MessageChatSetTtl, error) { - var resp MessageChatSetTtl +func UnmarshalMessageChatSetMessageAutoDeleteTime(data json.RawMessage) (*MessageChatSetMessageAutoDeleteTime, error) { + var resp MessageChatSetMessageAutoDeleteTime + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicCreated(data json.RawMessage) (*MessageForumTopicCreated, error) { + var resp MessageForumTopicCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicEdited(data json.RawMessage) (*MessageForumTopicEdited, error) { + var resp MessageForumTopicEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicIsClosedToggled(data json.RawMessage) (*MessageForumTopicIsClosedToggled, error) { + var resp MessageForumTopicIsClosedToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicIsHiddenToggled(data json.RawMessage) (*MessageForumTopicIsHiddenToggled, error) { + var resp MessageForumTopicIsHiddenToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSuggestProfilePhoto(data json.RawMessage) (*MessageSuggestProfilePhoto, error) { + var resp MessageSuggestProfilePhoto err := json.Unmarshal(data, &resp) @@ -7841,6 +10769,38 @@ func UnmarshalMessagePaymentSuccessfulBot(data json.RawMessage) (*MessagePayment return &resp, err } +func UnmarshalMessageGiftedPremium(data json.RawMessage) (*MessageGiftedPremium, error) { + var resp MessageGiftedPremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePremiumGiftCode(data json.RawMessage) (*MessagePremiumGiftCode, error) { + var resp MessagePremiumGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePremiumGiveawayCreated(data json.RawMessage) (*MessagePremiumGiveawayCreated, error) { + var resp MessagePremiumGiveawayCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePremiumGiveaway(data json.RawMessage) (*MessagePremiumGiveaway, error) { + var resp MessagePremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { var resp MessageContactRegistered @@ -7849,8 +10809,40 @@ func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactReg return &resp, err } -func UnmarshalMessageWebsiteConnected(data json.RawMessage) (*MessageWebsiteConnected, error) { - var resp MessageWebsiteConnected +func UnmarshalMessageUserShared(data json.RawMessage) (*MessageUserShared, error) { + var resp MessageUserShared + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatShared(data json.RawMessage) (*MessageChatShared, error) { + var resp MessageChatShared + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageBotWriteAccessAllowed(data json.RawMessage) (*MessageBotWriteAccessAllowed, error) { + var resp MessageBotWriteAccessAllowed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageWebAppDataSent(data json.RawMessage) (*MessageWebAppDataSent, error) { + var resp MessageWebAppDataSent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageWebAppDataReceived(data json.RawMessage) (*MessageWebAppDataReceived, error) { + var resp MessageWebAppDataReceived err := json.Unmarshal(data, &resp) @@ -7985,6 +10977,14 @@ func UnmarshalTextEntityTypeStrikethrough(data json.RawMessage) (*TextEntityType return &resp, err } +func UnmarshalTextEntityTypeSpoiler(data json.RawMessage) (*TextEntityTypeSpoiler, error) { + var resp TextEntityTypeSpoiler + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeCode(data json.RawMessage) (*TextEntityTypeCode, error) { var resp TextEntityTypeCode @@ -8009,6 +11009,14 @@ func UnmarshalTextEntityTypePreCode(data json.RawMessage) (*TextEntityTypePreCod return &resp, err } +func UnmarshalTextEntityTypeBlockQuote(data json.RawMessage) (*TextEntityTypeBlockQuote, error) { + var resp TextEntityTypeBlockQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeTextUrl(data json.RawMessage) (*TextEntityTypeTextUrl, error) { var resp TextEntityTypeTextUrl @@ -8025,6 +11033,14 @@ func UnmarshalTextEntityTypeMentionName(data json.RawMessage) (*TextEntityTypeMe return &resp, err } +func UnmarshalTextEntityTypeCustomEmoji(data json.RawMessage) (*TextEntityTypeCustomEmoji, error) { + var resp TextEntityTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeMediaTimestamp(data json.RawMessage) (*TextEntityTypeMediaTimestamp, error) { var resp TextEntityTypeMediaTimestamp @@ -8057,6 +11073,22 @@ func UnmarshalMessageSchedulingStateSendWhenOnline(data json.RawMessage) (*Messa return &resp, err } +func UnmarshalMessageSelfDestructTypeTimer(data json.RawMessage) (*MessageSelfDestructTypeTimer, error) { + var resp MessageSelfDestructTypeTimer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSelfDestructTypeImmediately(data json.RawMessage) (*MessageSelfDestructTypeImmediately, error) { + var resp MessageSelfDestructTypeImmediately + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageSendOptions(data json.RawMessage) (*MessageSendOptions, error) { var resp MessageSendOptions @@ -8201,6 +11233,14 @@ func UnmarshalInputMessagePoll(data json.RawMessage) (*InputMessagePoll, error) return &resp, err } +func UnmarshalInputMessageStory(data json.RawMessage) (*InputMessageStory, error) { + var resp InputMessageStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageForwarded(data json.RawMessage) (*InputMessageForwarded, error) { var resp InputMessageForwarded @@ -8321,6 +11361,14 @@ func UnmarshalSearchMessagesFilterUnreadMention(data json.RawMessage) (*SearchMe return &resp, err } +func UnmarshalSearchMessagesFilterUnreadReaction(data json.RawMessage) (*SearchMessagesFilterUnreadReaction, error) { + var resp SearchMessagesFilterUnreadReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSearchMessagesFilterFailedToSend(data json.RawMessage) (*SearchMessagesFilterFailedToSend, error) { var resp SearchMessagesFilterFailedToSend @@ -8545,6 +11593,334 @@ func UnmarshalStickerSets(data json.RawMessage) (*StickerSets, error) { return &resp, err } +func UnmarshalTrendingStickerSets(data json.RawMessage) (*TrendingStickerSets, error) { + var resp TrendingStickerSets + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiCategory(data json.RawMessage) (*EmojiCategory, error) { + var resp EmojiCategory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiCategories(data json.RawMessage) (*EmojiCategories, error) { + var resp EmojiCategories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiCategoryTypeDefault(data json.RawMessage) (*EmojiCategoryTypeDefault, error) { + var resp EmojiCategoryTypeDefault + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiCategoryTypeEmojiStatus(data json.RawMessage) (*EmojiCategoryTypeEmojiStatus, error) { + var resp EmojiCategoryTypeEmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiCategoryTypeChatPhoto(data json.RawMessage) (*EmojiCategoryTypeChatPhoto, error) { + var resp EmojiCategoryTypeChatPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryViewer(data json.RawMessage) (*StoryViewer, error) { + var resp StoryViewer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryViewers(data json.RawMessage) (*StoryViewers, error) { + var resp StoryViewers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaPosition(data json.RawMessage) (*StoryAreaPosition, error) { + var resp StoryAreaPosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaTypeLocation(data json.RawMessage) (*StoryAreaTypeLocation, error) { + var resp StoryAreaTypeLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaTypeVenue(data json.RawMessage) (*StoryAreaTypeVenue, error) { + var resp StoryAreaTypeVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaTypeSuggestedReaction(data json.RawMessage) (*StoryAreaTypeSuggestedReaction, error) { + var resp StoryAreaTypeSuggestedReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) { + var resp StoryArea + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypeLocation(data json.RawMessage) (*InputStoryAreaTypeLocation, error) { + var resp InputStoryAreaTypeLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypeFoundVenue(data json.RawMessage) (*InputStoryAreaTypeFoundVenue, error) { + var resp InputStoryAreaTypeFoundVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypePreviousVenue(data json.RawMessage) (*InputStoryAreaTypePreviousVenue, error) { + var resp InputStoryAreaTypePreviousVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypeSuggestedReaction(data json.RawMessage) (*InputStoryAreaTypeSuggestedReaction, error) { + var resp InputStoryAreaTypeSuggestedReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) { + var resp InputStoryArea + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreas(data json.RawMessage) (*InputStoryAreas, error) { + var resp InputStoryAreas + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryVideo(data json.RawMessage) (*StoryVideo, error) { + var resp StoryVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentPhoto(data json.RawMessage) (*StoryContentPhoto, error) { + var resp StoryContentPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentVideo(data json.RawMessage) (*StoryContentVideo, error) { + var resp StoryContentVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentUnsupported(data json.RawMessage) (*StoryContentUnsupported, error) { + var resp StoryContentUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryContentPhoto(data json.RawMessage) (*InputStoryContentPhoto, error) { + var resp InputStoryContentPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryContentVideo(data json.RawMessage) (*InputStoryContentVideo, error) { + var resp InputStoryContentVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryListMain(data json.RawMessage) (*StoryListMain, error) { + var resp StoryListMain + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryListArchive(data json.RawMessage) (*StoryListArchive, error) { + var resp StoryListArchive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteractionInfo(data json.RawMessage) (*StoryInteractionInfo, error) { + var resp StoryInteractionInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStory(data json.RawMessage) (*Story, error) { + var resp Story + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStories(data json.RawMessage) (*Stories, error) { + var resp Stories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInfo(data json.RawMessage) (*StoryInfo, error) { + var resp StoryInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActiveStories(data json.RawMessage) (*ChatActiveStories, error) { + var resp ChatActiveStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSourceGiftCode(data json.RawMessage) (*ChatBoostSourceGiftCode, error) { + var resp ChatBoostSourceGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSourceGiveaway(data json.RawMessage) (*ChatBoostSourceGiveaway, error) { + var resp ChatBoostSourceGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSourcePremium(data json.RawMessage) (*ChatBoostSourcePremium, error) { + var resp ChatBoostSourcePremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPrepaidPremiumGiveaway(data json.RawMessage) (*PrepaidPremiumGiveaway, error) { + var resp PrepaidPremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostStatus(data json.RawMessage) (*ChatBoostStatus, error) { + var resp ChatBoostStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoost(data json.RawMessage) (*ChatBoost, error) { + var resp ChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundChatBoosts(data json.RawMessage) (*FoundChatBoosts, error) { + var resp FoundChatBoosts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSlot(data json.RawMessage) (*ChatBoostSlot, error) { + var resp ChatBoostSlot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSlots(data json.RawMessage) (*ChatBoostSlots, error) { + var resp ChatBoostSlots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCallDiscardReasonEmpty(data json.RawMessage) (*CallDiscardReasonEmpty, error) { var resp CallDiscardReasonEmpty @@ -8705,6 +12081,30 @@ func UnmarshalGroupCallVideoQualityFull(data json.RawMessage) (*GroupCallVideoQu return &resp, err } +func UnmarshalGroupCallStream(data json.RawMessage) (*GroupCallStream, error) { + var resp GroupCallStream + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallStreams(data json.RawMessage) (*GroupCallStreams, error) { + var resp GroupCallStreams + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRtmpUrl(data json.RawMessage) (*RtmpUrl, error) { + var resp RtmpUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGroupCallRecentSpeaker(data json.RawMessage) (*GroupCallRecentSpeaker, error) { var resp GroupCallRecentSpeaker @@ -8825,6 +12225,22 @@ func UnmarshalCall(data json.RawMessage) (*Call, error) { return &resp, err } +func UnmarshalFirebaseAuthenticationSettingsAndroid(data json.RawMessage) (*FirebaseAuthenticationSettingsAndroid, error) { + var resp FirebaseAuthenticationSettingsAndroid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFirebaseAuthenticationSettingsIos(data json.RawMessage) (*FirebaseAuthenticationSettingsIos, error) { + var resp FirebaseAuthenticationSettingsIos + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPhoneNumberAuthenticationSettings(data json.RawMessage) (*PhoneNumberAuthenticationSettings, error) { var resp PhoneNumberAuthenticationSettings @@ -8833,6 +12249,46 @@ func UnmarshalPhoneNumberAuthenticationSettings(data json.RawMessage) (*PhoneNum return &resp, err } +func UnmarshalAddedReaction(data json.RawMessage) (*AddedReaction, error) { + var resp AddedReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAddedReactions(data json.RawMessage) (*AddedReactions, error) { + var resp AddedReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAvailableReaction(data json.RawMessage) (*AvailableReaction, error) { + var resp AvailableReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAvailableReactions(data json.RawMessage) (*AvailableReactions, error) { + var resp AvailableReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiReaction(data json.RawMessage) (*EmojiReaction, error) { + var resp EmojiReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAnimations(data json.RawMessage) (*Animations, error) { var resp Animations @@ -8865,6 +12321,86 @@ func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error) return &resp, err } +func UnmarshalSpeechRecognitionResultPending(data json.RawMessage) (*SpeechRecognitionResultPending, error) { + var resp SpeechRecognitionResultPending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSpeechRecognitionResultText(data json.RawMessage) (*SpeechRecognitionResultText, error) { + var resp SpeechRecognitionResultText + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSpeechRecognitionResultError(data json.RawMessage) (*SpeechRecognitionResultError, error) { + var resp SpeechRecognitionResultError + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAttachmentMenuBotColor(data json.RawMessage) (*AttachmentMenuBotColor, error) { + var resp AttachmentMenuBotColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAttachmentMenuBot(data json.RawMessage) (*AttachmentMenuBot, error) { + var resp AttachmentMenuBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSentWebAppMessage(data json.RawMessage) (*SentWebAppMessage, error) { + var resp SentWebAppMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonConnectedWebsite(data json.RawMessage) (*BotWriteAccessAllowReasonConnectedWebsite, error) { + var resp BotWriteAccessAllowReasonConnectedWebsite + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonAddedToAttachmentMenu(data json.RawMessage) (*BotWriteAccessAllowReasonAddedToAttachmentMenu, error) { + var resp BotWriteAccessAllowReasonAddedToAttachmentMenu + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonLaunchedWebApp(data json.RawMessage) (*BotWriteAccessAllowReasonLaunchedWebApp, error) { + var resp BotWriteAccessAllowReasonLaunchedWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonAcceptedRequest(data json.RawMessage) (*BotWriteAccessAllowReasonAcceptedRequest, error) { + var resp BotWriteAccessAllowReasonAcceptedRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) { var resp HttpUrl @@ -8873,6 +12409,14 @@ func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) { return &resp, err } +func UnmarshalUserLink(data json.RawMessage) (*UserLink, error) { + var resp UserLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputInlineQueryResultAnimation(data json.RawMessage) (*InputInlineQueryResultAnimation, error) { var resp InputInlineQueryResultAnimation @@ -9065,6 +12609,30 @@ func UnmarshalInlineQueryResultVoiceNote(data json.RawMessage) (*InlineQueryResu return &resp, err } +func UnmarshalInlineQueryResultsButtonTypeStartBot(data json.RawMessage) (*InlineQueryResultsButtonTypeStartBot, error) { + var resp InlineQueryResultsButtonTypeStartBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultsButtonTypeWebApp(data json.RawMessage) (*InlineQueryResultsButtonTypeWebApp, error) { + var resp InlineQueryResultsButtonTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultsButton(data json.RawMessage) (*InlineQueryResultsButton, error) { + var resp InlineQueryResultsButton + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInlineQueryResults(data json.RawMessage) (*InlineQueryResults, error) { var resp InlineQueryResults @@ -9145,14 +12713,6 @@ func UnmarshalChatEventMessageDeleted(data json.RawMessage) (*ChatEventMessageDe return &resp, err } -func UnmarshalChatEventPollStopped(data json.RawMessage) (*ChatEventPollStopped, error) { - var resp ChatEventPollStopped - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventMessagePinned(data json.RawMessage) (*ChatEventMessagePinned, error) { var resp ChatEventMessagePinned @@ -9169,6 +12729,14 @@ func UnmarshalChatEventMessageUnpinned(data json.RawMessage) (*ChatEventMessageU return &resp, err } +func UnmarshalChatEventPollStopped(data json.RawMessage) (*ChatEventPollStopped, error) { + var resp ChatEventPollStopped + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventMemberJoined(data json.RawMessage) (*ChatEventMemberJoined, error) { var resp ChatEventMemberJoined @@ -9193,16 +12761,16 @@ func UnmarshalChatEventMemberJoinedByRequest(data json.RawMessage) (*ChatEventMe return &resp, err } -func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { - var resp ChatEventMemberLeft +func UnmarshalChatEventMemberInvited(data json.RawMessage) (*ChatEventMemberInvited, error) { + var resp ChatEventMemberInvited err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatEventMemberInvited(data json.RawMessage) (*ChatEventMemberInvited, error) { - var resp ChatEventMemberInvited +func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { + var resp ChatEventMemberLeft err := json.Unmarshal(data, &resp) @@ -9225,16 +12793,8 @@ func UnmarshalChatEventMemberRestricted(data json.RawMessage) (*ChatEventMemberR return &resp, err } -func UnmarshalChatEventTitleChanged(data json.RawMessage) (*ChatEventTitleChanged, error) { - var resp ChatEventTitleChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventPermissionsChanged(data json.RawMessage) (*ChatEventPermissionsChanged, error) { - var resp ChatEventPermissionsChanged +func UnmarshalChatEventAvailableReactionsChanged(data json.RawMessage) (*ChatEventAvailableReactionsChanged, error) { + var resp ChatEventAvailableReactionsChanged err := json.Unmarshal(data, &resp) @@ -9249,30 +12809,6 @@ func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescr return &resp, err } -func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsernameChanged, error) { - var resp ChatEventUsernameChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventPhotoChanged(data json.RawMessage) (*ChatEventPhotoChanged, error) { - var resp ChatEventPhotoChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventInvitesToggled(data json.RawMessage) (*ChatEventInvitesToggled, error) { - var resp ChatEventInvitesToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinkedChatChanged, error) { var resp ChatEventLinkedChatChanged @@ -9281,46 +12817,6 @@ func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinked return &resp, err } -func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { - var resp ChatEventSlowModeDelayChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMessageTtlChanged(data json.RawMessage) (*ChatEventMessageTtlChanged, error) { - var resp ChatEventMessageTtlChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) { - var resp ChatEventSignMessagesToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { - var resp ChatEventHasProtectedContentToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { - var resp ChatEventStickerSetChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocationChanged, error) { var resp ChatEventLocationChanged @@ -9329,6 +12825,102 @@ func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocation return &resp, err } +func UnmarshalChatEventMessageAutoDeleteTimeChanged(data json.RawMessage) (*ChatEventMessageAutoDeleteTimeChanged, error) { + var resp ChatEventMessageAutoDeleteTimeChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventPermissionsChanged(data json.RawMessage) (*ChatEventPermissionsChanged, error) { + var resp ChatEventPermissionsChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventPhotoChanged(data json.RawMessage) (*ChatEventPhotoChanged, error) { + var resp ChatEventPhotoChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { + var resp ChatEventSlowModeDelayChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { + var resp ChatEventStickerSetChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventTitleChanged(data json.RawMessage) (*ChatEventTitleChanged, error) { + var resp ChatEventTitleChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsernameChanged, error) { + var resp ChatEventUsernameChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventActiveUsernamesChanged(data json.RawMessage) (*ChatEventActiveUsernamesChanged, error) { + var resp ChatEventActiveUsernamesChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventAccentColorChanged(data json.RawMessage) (*ChatEventAccentColorChanged, error) { + var resp ChatEventAccentColorChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventBackgroundCustomEmojiChanged(data json.RawMessage) (*ChatEventBackgroundCustomEmojiChanged, error) { + var resp ChatEventBackgroundCustomEmojiChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { + var resp ChatEventHasProtectedContentToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventInvitesToggled(data json.RawMessage) (*ChatEventInvitesToggled, error) { + var resp ChatEventInvitesToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*ChatEventIsAllHistoryAvailableToggled, error) { var resp ChatEventIsAllHistoryAvailableToggled @@ -9337,6 +12929,22 @@ func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*Chat return &resp, err } +func UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data json.RawMessage) (*ChatEventHasAggressiveAntiSpamEnabledToggled, error) { + var resp ChatEventHasAggressiveAntiSpamEnabledToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) { + var resp ChatEventSignMessagesToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventInviteLinkEdited(data json.RawMessage) (*ChatEventInviteLinkEdited, error) { var resp ChatEventInviteLinkEdited @@ -9377,6 +12985,14 @@ func UnmarshalChatEventVideoChatEnded(data json.RawMessage) (*ChatEventVideoChat return &resp, err } +func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { + var resp ChatEventVideoChatMuteNewParticipantsToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventVideoChatParticipantIsMutedToggled(data json.RawMessage) (*ChatEventVideoChatParticipantIsMutedToggled, error) { var resp ChatEventVideoChatParticipantIsMutedToggled @@ -9393,8 +13009,56 @@ func UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data json.RawMessa return &resp, err } -func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { - var resp ChatEventVideoChatMuteNewParticipantsToggled +func UnmarshalChatEventIsForumToggled(data json.RawMessage) (*ChatEventIsForumToggled, error) { + var resp ChatEventIsForumToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicCreated(data json.RawMessage) (*ChatEventForumTopicCreated, error) { + var resp ChatEventForumTopicCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicEdited(data json.RawMessage) (*ChatEventForumTopicEdited, error) { + var resp ChatEventForumTopicEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicToggleIsClosed(data json.RawMessage) (*ChatEventForumTopicToggleIsClosed, error) { + var resp ChatEventForumTopicToggleIsClosed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicToggleIsHidden(data json.RawMessage) (*ChatEventForumTopicToggleIsHidden, error) { + var resp ChatEventForumTopicToggleIsHidden + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicDeleted(data json.RawMessage) (*ChatEventForumTopicDeleted, error) { + var resp ChatEventForumTopicDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicPinned(data json.RawMessage) (*ChatEventForumTopicPinned, error) { + var resp ChatEventForumTopicPinned err := json.Unmarshal(data, &resp) @@ -9481,6 +13145,454 @@ func UnmarshalLocalizationTargetInfo(data json.RawMessage) (*LocalizationTargetI return &resp, err } +func UnmarshalPremiumLimitTypeSupergroupCount(data json.RawMessage) (*PremiumLimitTypeSupergroupCount, error) { + var resp PremiumLimitTypeSupergroupCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypePinnedChatCount(data json.RawMessage) (*PremiumLimitTypePinnedChatCount, error) { + var resp PremiumLimitTypePinnedChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeCreatedPublicChatCount(data json.RawMessage) (*PremiumLimitTypeCreatedPublicChatCount, error) { + var resp PremiumLimitTypeCreatedPublicChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeSavedAnimationCount(data json.RawMessage) (*PremiumLimitTypeSavedAnimationCount, error) { + var resp PremiumLimitTypeSavedAnimationCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeFavoriteStickerCount(data json.RawMessage) (*PremiumLimitTypeFavoriteStickerCount, error) { + var resp PremiumLimitTypeFavoriteStickerCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeChatFolderCount(data json.RawMessage) (*PremiumLimitTypeChatFolderCount, error) { + var resp PremiumLimitTypeChatFolderCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeChatFolderChosenChatCount(data json.RawMessage) (*PremiumLimitTypeChatFolderChosenChatCount, error) { + var resp PremiumLimitTypeChatFolderChosenChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypePinnedArchivedChatCount(data json.RawMessage) (*PremiumLimitTypePinnedArchivedChatCount, error) { + var resp PremiumLimitTypePinnedArchivedChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeCaptionLength(data json.RawMessage) (*PremiumLimitTypeCaptionLength, error) { + var resp PremiumLimitTypeCaptionLength + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeBioLength(data json.RawMessage) (*PremiumLimitTypeBioLength, error) { + var resp PremiumLimitTypeBioLength + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeChatFolderInviteLinkCount(data json.RawMessage) (*PremiumLimitTypeChatFolderInviteLinkCount, error) { + var resp PremiumLimitTypeChatFolderInviteLinkCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeShareableChatFolderCount(data json.RawMessage) (*PremiumLimitTypeShareableChatFolderCount, error) { + var resp PremiumLimitTypeShareableChatFolderCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeActiveStoryCount(data json.RawMessage) (*PremiumLimitTypeActiveStoryCount, error) { + var resp PremiumLimitTypeActiveStoryCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeWeeklySentStoryCount(data json.RawMessage) (*PremiumLimitTypeWeeklySentStoryCount, error) { + var resp PremiumLimitTypeWeeklySentStoryCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeMonthlySentStoryCount(data json.RawMessage) (*PremiumLimitTypeMonthlySentStoryCount, error) { + var resp PremiumLimitTypeMonthlySentStoryCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeStoryCaptionLength(data json.RawMessage) (*PremiumLimitTypeStoryCaptionLength, error) { + var resp PremiumLimitTypeStoryCaptionLength + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data json.RawMessage) (*PremiumLimitTypeStorySuggestedReactionAreaCount, error) { + var resp PremiumLimitTypeStorySuggestedReactionAreaCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureIncreasedLimits(data json.RawMessage) (*PremiumFeatureIncreasedLimits, error) { + var resp PremiumFeatureIncreasedLimits + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureIncreasedUploadFileSize(data json.RawMessage) (*PremiumFeatureIncreasedUploadFileSize, error) { + var resp PremiumFeatureIncreasedUploadFileSize + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureImprovedDownloadSpeed(data json.RawMessage) (*PremiumFeatureImprovedDownloadSpeed, error) { + var resp PremiumFeatureImprovedDownloadSpeed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureVoiceRecognition(data json.RawMessage) (*PremiumFeatureVoiceRecognition, error) { + var resp PremiumFeatureVoiceRecognition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureDisabledAds(data json.RawMessage) (*PremiumFeatureDisabledAds, error) { + var resp PremiumFeatureDisabledAds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureUniqueReactions(data json.RawMessage) (*PremiumFeatureUniqueReactions, error) { + var resp PremiumFeatureUniqueReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureUniqueStickers(data json.RawMessage) (*PremiumFeatureUniqueStickers, error) { + var resp PremiumFeatureUniqueStickers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureCustomEmoji(data json.RawMessage) (*PremiumFeatureCustomEmoji, error) { + var resp PremiumFeatureCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAdvancedChatManagement(data json.RawMessage) (*PremiumFeatureAdvancedChatManagement, error) { + var resp PremiumFeatureAdvancedChatManagement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureProfileBadge(data json.RawMessage) (*PremiumFeatureProfileBadge, error) { + var resp PremiumFeatureProfileBadge + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureEmojiStatus(data json.RawMessage) (*PremiumFeatureEmojiStatus, error) { + var resp PremiumFeatureEmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAnimatedProfilePhoto(data json.RawMessage) (*PremiumFeatureAnimatedProfilePhoto, error) { + var resp PremiumFeatureAnimatedProfilePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureForumTopicIcon(data json.RawMessage) (*PremiumFeatureForumTopicIcon, error) { + var resp PremiumFeatureForumTopicIcon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAppIcons(data json.RawMessage) (*PremiumFeatureAppIcons, error) { + var resp PremiumFeatureAppIcons + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureRealTimeChatTranslation(data json.RawMessage) (*PremiumFeatureRealTimeChatTranslation, error) { + var resp PremiumFeatureRealTimeChatTranslation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureUpgradedStories(data json.RawMessage) (*PremiumFeatureUpgradedStories, error) { + var resp PremiumFeatureUpgradedStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureChatBoost(data json.RawMessage) (*PremiumFeatureChatBoost, error) { + var resp PremiumFeatureChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAccentColor(data json.RawMessage) (*PremiumFeatureAccentColor, error) { + var resp PremiumFeatureAccentColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeaturePriorityOrder(data json.RawMessage) (*PremiumStoryFeaturePriorityOrder, error) { + var resp PremiumStoryFeaturePriorityOrder + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureStealthMode(data json.RawMessage) (*PremiumStoryFeatureStealthMode, error) { + var resp PremiumStoryFeatureStealthMode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeaturePermanentViewsHistory(data json.RawMessage) (*PremiumStoryFeaturePermanentViewsHistory, error) { + var resp PremiumStoryFeaturePermanentViewsHistory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureCustomExpirationDuration(data json.RawMessage) (*PremiumStoryFeatureCustomExpirationDuration, error) { + var resp PremiumStoryFeatureCustomExpirationDuration + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureSaveStories(data json.RawMessage) (*PremiumStoryFeatureSaveStories, error) { + var resp PremiumStoryFeatureSaveStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureLinksAndFormatting(data json.RawMessage) (*PremiumStoryFeatureLinksAndFormatting, error) { + var resp PremiumStoryFeatureLinksAndFormatting + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimit(data json.RawMessage) (*PremiumLimit, error) { + var resp PremiumLimit + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatures(data json.RawMessage) (*PremiumFeatures, error) { + var resp PremiumFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceLimitExceeded(data json.RawMessage) (*PremiumSourceLimitExceeded, error) { + var resp PremiumSourceLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceFeature(data json.RawMessage) (*PremiumSourceFeature, error) { + var resp PremiumSourceFeature + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceStoryFeature(data json.RawMessage) (*PremiumSourceStoryFeature, error) { + var resp PremiumSourceStoryFeature + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceLink(data json.RawMessage) (*PremiumSourceLink, error) { + var resp PremiumSourceLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceSettings(data json.RawMessage) (*PremiumSourceSettings, error) { + var resp PremiumSourceSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeaturePromotionAnimation(data json.RawMessage) (*PremiumFeaturePromotionAnimation, error) { + var resp PremiumFeaturePromotionAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumState(data json.RawMessage) (*PremiumState, error) { + var resp PremiumState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposePremiumSubscription(data json.RawMessage) (*StorePaymentPurposePremiumSubscription, error) { + var resp StorePaymentPurposePremiumSubscription + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposeGiftedPremium(data json.RawMessage) (*StorePaymentPurposeGiftedPremium, error) { + var resp StorePaymentPurposeGiftedPremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposePremiumGiftCodes(data json.RawMessage) (*StorePaymentPurposePremiumGiftCodes, error) { + var resp StorePaymentPurposePremiumGiftCodes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposePremiumGiveaway(data json.RawMessage) (*StorePaymentPurposePremiumGiveaway, error) { + var resp StorePaymentPurposePremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTelegramPaymentPurposePremiumGiftCodes(data json.RawMessage) (*TelegramPaymentPurposePremiumGiftCodes, error) { + var resp TelegramPaymentPurposePremiumGiftCodes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTelegramPaymentPurposePremiumGiveaway(data json.RawMessage) (*TelegramPaymentPurposePremiumGiveaway, error) { + var resp TelegramPaymentPurposePremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDeviceTokenFirebaseCloudMessaging(data json.RawMessage) (*DeviceTokenFirebaseCloudMessaging, error) { var resp DeviceTokenFirebaseCloudMessaging @@ -9569,6 +13681,14 @@ func UnmarshalDeviceTokenTizenPush(data json.RawMessage) (*DeviceTokenTizenPush, return &resp, err } +func UnmarshalDeviceTokenHuaweiPush(data json.RawMessage) (*DeviceTokenHuaweiPush, error) { + var resp DeviceTokenHuaweiPush + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushReceiverId(data json.RawMessage) (*PushReceiverId, error) { var resp PushReceiverId @@ -9625,22 +13745,6 @@ func UnmarshalBackgroundTypeFill(data json.RawMessage) (*BackgroundTypeFill, err return &resp, err } -func UnmarshalBackground(data json.RawMessage) (*Background, error) { - var resp Background - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBackgrounds(data json.RawMessage) (*Backgrounds, error) { - var resp Backgrounds - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInputBackgroundLocal(data json.RawMessage) (*InputBackgroundLocal, error) { var resp InputBackgroundLocal @@ -9657,6 +13761,14 @@ func UnmarshalInputBackgroundRemote(data json.RawMessage) (*InputBackgroundRemot return &resp, err } +func UnmarshalInputBackgroundPrevious(data json.RawMessage) (*InputBackgroundPrevious, error) { + var resp InputBackgroundPrevious + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalThemeSettings(data json.RawMessage) (*ThemeSettings, error) { var resp ThemeSettings @@ -9681,6 +13793,54 @@ func UnmarshalHashtags(data json.RawMessage) (*Hashtags, error) { return &resp, err } +func UnmarshalCanSendStoryResultOk(data json.RawMessage) (*CanSendStoryResultOk, error) { + var resp CanSendStoryResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultPremiumNeeded(data json.RawMessage) (*CanSendStoryResultPremiumNeeded, error) { + var resp CanSendStoryResultPremiumNeeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultBoostNeeded(data json.RawMessage) (*CanSendStoryResultBoostNeeded, error) { + var resp CanSendStoryResultBoostNeeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data json.RawMessage) (*CanSendStoryResultActiveStoryLimitExceeded, error) { + var resp CanSendStoryResultActiveStoryLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultWeeklyLimitExceeded(data json.RawMessage) (*CanSendStoryResultWeeklyLimitExceeded, error) { + var resp CanSendStoryResultWeeklyLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultMonthlyLimitExceeded(data json.RawMessage) (*CanSendStoryResultMonthlyLimitExceeded, error) { + var resp CanSendStoryResultMonthlyLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCanTransferOwnershipResultOk(data json.RawMessage) (*CanTransferOwnershipResultOk, error) { var resp CanTransferOwnershipResultOk @@ -9737,8 +13897,16 @@ func UnmarshalCheckChatUsernameResultUsernameOccupied(data json.RawMessage) (*Ch return &resp, err } -func UnmarshalCheckChatUsernameResultPublicChatsTooMuch(data json.RawMessage) (*CheckChatUsernameResultPublicChatsTooMuch, error) { - var resp CheckChatUsernameResultPublicChatsTooMuch +func UnmarshalCheckChatUsernameResultUsernamePurchasable(data json.RawMessage) (*CheckChatUsernameResultUsernamePurchasable, error) { + var resp CheckChatUsernameResultUsernamePurchasable + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCheckChatUsernameResultPublicChatsTooMany(data json.RawMessage) (*CheckChatUsernameResultPublicChatsTooMany, error) { + var resp CheckChatUsernameResultPublicChatsTooMany err := json.Unmarshal(data, &resp) @@ -9921,6 +14089,22 @@ func UnmarshalPushMessageContentPoll(data json.RawMessage) (*PushMessageContentP return &resp, err } +func UnmarshalPushMessageContentPremiumGiftCode(data json.RawMessage) (*PushMessageContentPremiumGiftCode, error) { + var resp PushMessageContentPremiumGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPushMessageContentPremiumGiveaway(data json.RawMessage) (*PushMessageContentPremiumGiveaway, error) { + var resp PushMessageContentPremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentScreenshotTaken(data json.RawMessage) (*PushMessageContentScreenshotTaken, error) { var resp PushMessageContentScreenshotTaken @@ -9937,6 +14121,14 @@ func UnmarshalPushMessageContentSticker(data json.RawMessage) (*PushMessageConte return &resp, err } +func UnmarshalPushMessageContentStory(data json.RawMessage) (*PushMessageContentStory, error) { + var resp PushMessageContentStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentText(data json.RawMessage) (*PushMessageContentText, error) { var resp PushMessageContentText @@ -10001,6 +14193,14 @@ func UnmarshalPushMessageContentChatChangeTitle(data json.RawMessage) (*PushMess return &resp, err } +func UnmarshalPushMessageContentChatSetBackground(data json.RawMessage) (*PushMessageContentChatSetBackground, error) { + var resp PushMessageContentChatSetBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentChatSetTheme(data json.RawMessage) (*PushMessageContentChatSetTheme, error) { var resp PushMessageContentChatSetTheme @@ -10033,6 +14233,22 @@ func UnmarshalPushMessageContentChatJoinByRequest(data json.RawMessage) (*PushMe return &resp, err } +func UnmarshalPushMessageContentRecurringPayment(data json.RawMessage) (*PushMessageContentRecurringPayment, error) { + var resp PushMessageContentRecurringPayment + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPushMessageContentSuggestProfilePhoto(data json.RawMessage) (*PushMessageContentSuggestProfilePhoto, error) { + var resp PushMessageContentSuggestProfilePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentMessageForwards(data json.RawMessage) (*PushMessageContentMessageForwards, error) { var resp PushMessageContentMessageForwards @@ -10113,6 +14329,22 @@ func UnmarshalNotificationGroupTypeCalls(data json.RawMessage) (*NotificationGro return &resp, err } +func UnmarshalNotificationSound(data json.RawMessage) (*NotificationSound, error) { + var resp NotificationSound + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalNotificationSounds(data json.RawMessage) (*NotificationSounds, error) { + var resp NotificationSounds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalNotification(data json.RawMessage) (*Notification, error) { var resp Notification @@ -10217,6 +14449,38 @@ func UnmarshalJsonValueObject(data json.RawMessage) (*JsonValueObject, error) { return &resp, err } +func UnmarshalStoryPrivacySettingsEveryone(data json.RawMessage) (*StoryPrivacySettingsEveryone, error) { + var resp StoryPrivacySettingsEveryone + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPrivacySettingsContacts(data json.RawMessage) (*StoryPrivacySettingsContacts, error) { + var resp StoryPrivacySettingsContacts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPrivacySettingsCloseFriends(data json.RawMessage) (*StoryPrivacySettingsCloseFriends, error) { + var resp StoryPrivacySettingsCloseFriends + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPrivacySettingsSelectedUsers(data json.RawMessage) (*StoryPrivacySettingsSelectedUsers, error) { + var resp StoryPrivacySettingsSelectedUsers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingRuleAllowAll(data json.RawMessage) (*UserPrivacySettingRuleAllowAll, error) { var resp UserPrivacySettingRuleAllowAll @@ -10321,6 +14585,14 @@ func UnmarshalUserPrivacySettingShowPhoneNumber(data json.RawMessage) (*UserPriv return &resp, err } +func UnmarshalUserPrivacySettingShowBio(data json.RawMessage) (*UserPrivacySettingShowBio, error) { + var resp UserPrivacySettingShowBio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingAllowChatInvites(data json.RawMessage) (*UserPrivacySettingAllowChatInvites, error) { var resp UserPrivacySettingAllowChatInvites @@ -10353,6 +14625,14 @@ func UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data json.RawMessage) return &resp, err } +func UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data json.RawMessage) (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages, error) { + var resp UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAccountTtl(data json.RawMessage) (*AccountTtl, error) { var resp AccountTtl @@ -10361,6 +14641,150 @@ func UnmarshalAccountTtl(data json.RawMessage) (*AccountTtl, error) { return &resp, err } +func UnmarshalMessageAutoDeleteTime(data json.RawMessage) (*MessageAutoDeleteTime, error) { + var resp MessageAutoDeleteTime + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeAndroid(data json.RawMessage) (*SessionTypeAndroid, error) { + var resp SessionTypeAndroid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeApple(data json.RawMessage) (*SessionTypeApple, error) { + var resp SessionTypeApple + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeBrave(data json.RawMessage) (*SessionTypeBrave, error) { + var resp SessionTypeBrave + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeChrome(data json.RawMessage) (*SessionTypeChrome, error) { + var resp SessionTypeChrome + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeEdge(data json.RawMessage) (*SessionTypeEdge, error) { + var resp SessionTypeEdge + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeFirefox(data json.RawMessage) (*SessionTypeFirefox, error) { + var resp SessionTypeFirefox + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeIpad(data json.RawMessage) (*SessionTypeIpad, error) { + var resp SessionTypeIpad + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeIphone(data json.RawMessage) (*SessionTypeIphone, error) { + var resp SessionTypeIphone + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeLinux(data json.RawMessage) (*SessionTypeLinux, error) { + var resp SessionTypeLinux + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeMac(data json.RawMessage) (*SessionTypeMac, error) { + var resp SessionTypeMac + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeOpera(data json.RawMessage) (*SessionTypeOpera, error) { + var resp SessionTypeOpera + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeSafari(data json.RawMessage) (*SessionTypeSafari, error) { + var resp SessionTypeSafari + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeUbuntu(data json.RawMessage) (*SessionTypeUbuntu, error) { + var resp SessionTypeUbuntu + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeUnknown(data json.RawMessage) (*SessionTypeUnknown, error) { + var resp SessionTypeUnknown + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeVivaldi(data json.RawMessage) (*SessionTypeVivaldi, error) { + var resp SessionTypeVivaldi + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeWindows(data json.RawMessage) (*SessionTypeWindows, error) { + var resp SessionTypeWindows + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSessionTypeXbox(data json.RawMessage) (*SessionTypeXbox, error) { + var resp SessionTypeXbox + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSession(data json.RawMessage) (*Session, error) { var resp Session @@ -10377,6 +14801,14 @@ func UnmarshalSessions(data json.RawMessage) (*Sessions, error) { return &resp, err } +func UnmarshalUnconfirmedSession(data json.RawMessage) (*UnconfirmedSession, error) { + var resp UnconfirmedSession + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalConnectedWebsite(data json.RawMessage) (*ConnectedWebsite, error) { var resp ConnectedWebsite @@ -10393,64 +14825,104 @@ func UnmarshalConnectedWebsites(data json.RawMessage) (*ConnectedWebsites, error return &resp, err } -func UnmarshalChatReportReasonSpam(data json.RawMessage) (*ChatReportReasonSpam, error) { - var resp ChatReportReasonSpam +func UnmarshalReportReasonSpam(data json.RawMessage) (*ReportReasonSpam, error) { + var resp ReportReasonSpam err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonViolence(data json.RawMessage) (*ChatReportReasonViolence, error) { - var resp ChatReportReasonViolence +func UnmarshalReportReasonViolence(data json.RawMessage) (*ReportReasonViolence, error) { + var resp ReportReasonViolence err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonPornography(data json.RawMessage) (*ChatReportReasonPornography, error) { - var resp ChatReportReasonPornography +func UnmarshalReportReasonPornography(data json.RawMessage) (*ReportReasonPornography, error) { + var resp ReportReasonPornography err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonChildAbuse(data json.RawMessage) (*ChatReportReasonChildAbuse, error) { - var resp ChatReportReasonChildAbuse +func UnmarshalReportReasonChildAbuse(data json.RawMessage) (*ReportReasonChildAbuse, error) { + var resp ReportReasonChildAbuse err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonCopyright(data json.RawMessage) (*ChatReportReasonCopyright, error) { - var resp ChatReportReasonCopyright +func UnmarshalReportReasonCopyright(data json.RawMessage) (*ReportReasonCopyright, error) { + var resp ReportReasonCopyright err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonUnrelatedLocation(data json.RawMessage) (*ChatReportReasonUnrelatedLocation, error) { - var resp ChatReportReasonUnrelatedLocation +func UnmarshalReportReasonUnrelatedLocation(data json.RawMessage) (*ReportReasonUnrelatedLocation, error) { + var resp ReportReasonUnrelatedLocation err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonFake(data json.RawMessage) (*ChatReportReasonFake, error) { - var resp ChatReportReasonFake +func UnmarshalReportReasonFake(data json.RawMessage) (*ReportReasonFake, error) { + var resp ReportReasonFake err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCustom, error) { - var resp ChatReportReasonCustom +func UnmarshalReportReasonIllegalDrugs(data json.RawMessage) (*ReportReasonIllegalDrugs, error) { + var resp ReportReasonIllegalDrugs + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportReasonPersonalDetails(data json.RawMessage) (*ReportReasonPersonalDetails, error) { + var resp ReportReasonPersonalDetails + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportReasonCustom(data json.RawMessage) (*ReportReasonCustom, error) { + var resp ReportReasonCustom + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTargetChatCurrent(data json.RawMessage) (*TargetChatCurrent, error) { + var resp TargetChatCurrent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTargetChatChosen(data json.RawMessage) (*TargetChatChosen, error) { + var resp TargetChatChosen + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTargetChatInternalLink(data json.RawMessage) (*TargetChatInternalLink, error) { + var resp TargetChatInternalLink err := json.Unmarshal(data, &resp) @@ -10465,6 +14937,14 @@ func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLin return &resp, err } +func UnmarshalInternalLinkTypeAttachmentMenuBot(data json.RawMessage) (*InternalLinkTypeAttachmentMenuBot, error) { + var resp InternalLinkTypeAttachmentMenuBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeAuthenticationCode(data json.RawMessage) (*InternalLinkTypeAuthenticationCode, error) { var resp InternalLinkTypeAuthenticationCode @@ -10481,6 +14961,14 @@ func UnmarshalInternalLinkTypeBackground(data json.RawMessage) (*InternalLinkTyp return &resp, err } +func UnmarshalInternalLinkTypeBotAddToChannel(data json.RawMessage) (*InternalLinkTypeBotAddToChannel, error) { + var resp InternalLinkTypeBotAddToChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeBotStart(data json.RawMessage) (*InternalLinkTypeBotStart, error) { var resp InternalLinkTypeBotStart @@ -10505,6 +14993,30 @@ func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*Internal return &resp, err } +func UnmarshalInternalLinkTypeChatBoost(data json.RawMessage) (*InternalLinkTypeChatBoost, error) { + var resp InternalLinkTypeChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeChatFolderInvite(data json.RawMessage) (*InternalLinkTypeChatFolderInvite, error) { + var resp InternalLinkTypeChatFolderInvite + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeChatFolderSettings(data json.RawMessage) (*InternalLinkTypeChatFolderSettings, error) { + var resp InternalLinkTypeChatFolderSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTypeChatInvite, error) { var resp InternalLinkTypeChatInvite @@ -10513,8 +15025,16 @@ func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTyp return &resp, err } -func UnmarshalInternalLinkTypeFilterSettings(data json.RawMessage) (*InternalLinkTypeFilterSettings, error) { - var resp InternalLinkTypeFilterSettings +func UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data json.RawMessage) (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, error) { + var resp InternalLinkTypeDefaultMessageAutoDeleteTimerSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeEditProfileSettings(data json.RawMessage) (*InternalLinkTypeEditProfileSettings, error) { + var resp InternalLinkTypeEditProfileSettings err := json.Unmarshal(data, &resp) @@ -10529,6 +15049,22 @@ func UnmarshalInternalLinkTypeGame(data json.RawMessage) (*InternalLinkTypeGame, return &resp, err } +func UnmarshalInternalLinkTypeInstantView(data json.RawMessage) (*InternalLinkTypeInstantView, error) { + var resp InternalLinkTypeInstantView + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeInvoice(data json.RawMessage) (*InternalLinkTypeInvoice, error) { + var resp InternalLinkTypeInvoice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkTypeLanguagePack, error) { var resp InternalLinkTypeLanguagePack @@ -10537,6 +15073,14 @@ func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkT return &resp, err } +func UnmarshalInternalLinkTypeLanguageSettings(data json.RawMessage) (*InternalLinkTypeLanguageSettings, error) { + var resp InternalLinkTypeLanguageSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeMessage(data json.RawMessage) (*InternalLinkTypeMessage, error) { var resp InternalLinkTypeMessage @@ -10569,6 +15113,30 @@ func UnmarshalInternalLinkTypePhoneNumberConfirmation(data json.RawMessage) (*In return &resp, err } +func UnmarshalInternalLinkTypePremiumFeatures(data json.RawMessage) (*InternalLinkTypePremiumFeatures, error) { + var resp InternalLinkTypePremiumFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypePremiumGiftCode(data json.RawMessage) (*InternalLinkTypePremiumGiftCode, error) { + var resp InternalLinkTypePremiumGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data json.RawMessage) (*InternalLinkTypePrivacyAndSecuritySettings, error) { + var resp InternalLinkTypePrivacyAndSecuritySettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeProxy(data json.RawMessage) (*InternalLinkTypeProxy, error) { var resp InternalLinkTypeProxy @@ -10593,6 +15161,14 @@ func UnmarshalInternalLinkTypeQrCodeAuthentication(data json.RawMessage) (*Inter return &resp, err } +func UnmarshalInternalLinkTypeRestorePurchases(data json.RawMessage) (*InternalLinkTypeRestorePurchases, error) { + var resp InternalLinkTypeRestorePurchases + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeSettings, error) { var resp InternalLinkTypeSettings @@ -10601,6 +15177,14 @@ func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeS return &resp, err } +func UnmarshalInternalLinkTypeSideMenuBot(data json.RawMessage) (*InternalLinkTypeSideMenuBot, error) { + var resp InternalLinkTypeSideMenuBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeStickerSet(data json.RawMessage) (*InternalLinkTypeStickerSet, error) { var resp InternalLinkTypeStickerSet @@ -10609,6 +15193,14 @@ func UnmarshalInternalLinkTypeStickerSet(data json.RawMessage) (*InternalLinkTyp return &resp, err } +func UnmarshalInternalLinkTypeStory(data json.RawMessage) (*InternalLinkTypeStory, error) { + var resp InternalLinkTypeStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeTheme(data json.RawMessage) (*InternalLinkTypeTheme, error) { var resp InternalLinkTypeTheme @@ -10641,6 +15233,22 @@ func UnmarshalInternalLinkTypeUnsupportedProxy(data json.RawMessage) (*InternalL return &resp, err } +func UnmarshalInternalLinkTypeUserPhoneNumber(data json.RawMessage) (*InternalLinkTypeUserPhoneNumber, error) { + var resp InternalLinkTypeUserPhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeUserToken(data json.RawMessage) (*InternalLinkTypeUserToken, error) { + var resp InternalLinkTypeUserToken + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeVideoChat(data json.RawMessage) (*InternalLinkTypeVideoChat, error) { var resp InternalLinkTypeVideoChat @@ -10649,6 +15257,14 @@ func UnmarshalInternalLinkTypeVideoChat(data json.RawMessage) (*InternalLinkType return &resp, err } +func UnmarshalInternalLinkTypeWebApp(data json.RawMessage) (*InternalLinkTypeWebApp, error) { + var resp InternalLinkTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageLink(data json.RawMessage) (*MessageLink, error) { var resp MessageLink @@ -10665,6 +15281,38 @@ func UnmarshalMessageLinkInfo(data json.RawMessage) (*MessageLinkInfo, error) { return &resp, err } +func UnmarshalChatBoostLink(data json.RawMessage) (*ChatBoostLink, error) { + var resp ChatBoostLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostLinkInfo(data json.RawMessage) (*ChatBoostLinkInfo, error) { + var resp ChatBoostLinkInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBlockListMain(data json.RawMessage) (*BlockListMain, error) { + var resp BlockListMain + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBlockListStories(data json.RawMessage) (*BlockListStories, error) { + var resp BlockListStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFilePart(data json.RawMessage) (*FilePart, error) { var resp FilePart @@ -10705,6 +15353,14 @@ func UnmarshalFileTypeDocument(data json.RawMessage) (*FileTypeDocument, error) return &resp, err } +func UnmarshalFileTypeNotificationSound(data json.RawMessage) (*FileTypeNotificationSound, error) { + var resp FileTypeNotificationSound + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileTypePhoto(data json.RawMessage) (*FileTypePhoto, error) { var resp FileTypePhoto @@ -10713,6 +15369,14 @@ func UnmarshalFileTypePhoto(data json.RawMessage) (*FileTypePhoto, error) { return &resp, err } +func UnmarshalFileTypePhotoStory(data json.RawMessage) (*FileTypePhotoStory, error) { + var resp FileTypePhotoStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileTypeProfilePhoto(data json.RawMessage) (*FileTypeProfilePhoto, error) { var resp FileTypeProfilePhoto @@ -10785,6 +15449,14 @@ func UnmarshalFileTypeVideoNote(data json.RawMessage) (*FileTypeVideoNote, error return &resp, err } +func UnmarshalFileTypeVideoStory(data json.RawMessage) (*FileTypeVideoStory, error) { + var resp FileTypeVideoStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileTypeVoiceNote(data json.RawMessage) (*FileTypeVoiceNote, error) { var resp FileTypeVoiceNote @@ -10921,6 +15593,62 @@ func UnmarshalAutoDownloadSettingsPresets(data json.RawMessage) (*AutoDownloadSe return &resp, err } +func UnmarshalAutosaveSettingsScopePrivateChats(data json.RawMessage) (*AutosaveSettingsScopePrivateChats, error) { + var resp AutosaveSettingsScopePrivateChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAutosaveSettingsScopeGroupChats(data json.RawMessage) (*AutosaveSettingsScopeGroupChats, error) { + var resp AutosaveSettingsScopeGroupChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAutosaveSettingsScopeChannelChats(data json.RawMessage) (*AutosaveSettingsScopeChannelChats, error) { + var resp AutosaveSettingsScopeChannelChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAutosaveSettingsScopeChat(data json.RawMessage) (*AutosaveSettingsScopeChat, error) { + var resp AutosaveSettingsScopeChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalScopeAutosaveSettings(data json.RawMessage) (*ScopeAutosaveSettings, error) { + var resp ScopeAutosaveSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAutosaveSettingsException(data json.RawMessage) (*AutosaveSettingsException, error) { + var resp AutosaveSettingsException + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAutosaveSettings(data json.RawMessage) (*AutosaveSettings, error) { + var resp AutosaveSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalConnectionStateWaitingForNetwork(data json.RawMessage) (*ConnectionStateWaitingForNetwork, error) { var resp ConnectionStateWaitingForNetwork @@ -11017,6 +15745,22 @@ func UnmarshalTopChatCategoryForwardChats(data json.RawMessage) (*TopChatCategor return &resp, err } +func UnmarshalFoundPosition(data json.RawMessage) (*FoundPosition, error) { + var resp FoundPosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundPositions(data json.RawMessage) (*FoundPositions, error) { + var resp FoundPositions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTMeUrlTypeUser(data json.RawMessage) (*TMeUrlTypeUser, error) { var resp TMeUrlTypeUser @@ -11113,6 +15857,30 @@ func UnmarshalSuggestedActionSetPassword(data json.RawMessage) (*SuggestedAction return &resp, err } +func UnmarshalSuggestedActionUpgradePremium(data json.RawMessage) (*SuggestedActionUpgradePremium, error) { + var resp SuggestedActionUpgradePremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionRestorePremium(data json.RawMessage) (*SuggestedActionRestorePremium, error) { + var resp SuggestedActionRestorePremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionSubscribeToAnnualPremium(data json.RawMessage) (*SuggestedActionSubscribeToAnnualPremium, error) { + var resp SuggestedActionSubscribeToAnnualPremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCount(data json.RawMessage) (*Count, error) { var resp Count @@ -11137,6 +15905,14 @@ func UnmarshalSeconds(data json.RawMessage) (*Seconds, error) { return &resp, err } +func UnmarshalFileDownloadedPrefixSize(data json.RawMessage) (*FileDownloadedPrefixSize, error) { + var resp FileDownloadedPrefixSize + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDeepLinkInfo(data json.RawMessage) (*DeepLinkInfo, error) { var resp DeepLinkInfo @@ -11201,16 +15977,8 @@ func UnmarshalProxies(data json.RawMessage) (*Proxies, error) { return &resp, err } -func UnmarshalInputStickerStatic(data json.RawMessage) (*InputStickerStatic, error) { - var resp InputStickerStatic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputStickerAnimated(data json.RawMessage) (*InputStickerAnimated, error) { - var resp InputStickerAnimated +func UnmarshalInputSticker(data json.RawMessage) (*InputSticker, error) { + var resp InputSticker err := json.Unmarshal(data, &resp) @@ -11481,6 +16249,14 @@ func UnmarshalUpdateMessageMentionRead(data json.RawMessage) (*UpdateMessageMent return &resp, err } +func UnmarshalUpdateMessageUnreadReactions(data json.RawMessage) (*UpdateMessageUnreadReactions, error) { + var resp UpdateMessageUnreadReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateMessageLiveLocationViewed(data json.RawMessage) (*UpdateMessageLiveLocationViewed, error) { var resp UpdateMessageLiveLocationViewed @@ -11513,6 +16289,22 @@ func UnmarshalUpdateChatPhoto(data json.RawMessage) (*UpdateChatPhoto, error) { return &resp, err } +func UnmarshalUpdateChatAccentColor(data json.RawMessage) (*UpdateChatAccentColor, error) { + var resp UpdateChatAccentColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatBackgroundCustomEmoji(data json.RawMessage) (*UpdateChatBackgroundCustomEmoji, error) { + var resp UpdateChatBackgroundCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatPermissions(data json.RawMessage) (*UpdateChatPermissions, error) { var resp UpdateChatPermissions @@ -11561,6 +16353,14 @@ func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, e return &resp, err } +func UnmarshalUpdateChatAvailableReactions(data json.RawMessage) (*UpdateChatAvailableReactions, error) { + var resp UpdateChatAvailableReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMessage, error) { var resp UpdateChatDraftMessage @@ -11577,8 +16377,8 @@ func UnmarshalUpdateChatMessageSender(data json.RawMessage) (*UpdateChatMessageS return &resp, err } -func UnmarshalUpdateChatMessageTtl(data json.RawMessage) (*UpdateChatMessageTtl, error) { - var resp UpdateChatMessageTtl +func UnmarshalUpdateChatMessageAutoDeleteTime(data json.RawMessage) (*UpdateChatMessageAutoDeleteTime, error) { + var resp UpdateChatMessageAutoDeleteTime err := json.Unmarshal(data, &resp) @@ -11609,6 +16409,14 @@ func UnmarshalUpdateChatReplyMarkup(data json.RawMessage) (*UpdateChatReplyMarku return &resp, err } +func UnmarshalUpdateChatBackground(data json.RawMessage) (*UpdateChatBackground, error) { + var resp UpdateChatBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatTheme(data json.RawMessage) (*UpdateChatTheme, error) { var resp UpdateChatTheme @@ -11625,6 +16433,14 @@ func UnmarshalUpdateChatUnreadMentionCount(data json.RawMessage) (*UpdateChatUnr return &resp, err } +func UnmarshalUpdateChatUnreadReactionCount(data json.RawMessage) (*UpdateChatUnreadReactionCount, error) { + var resp UpdateChatUnreadReactionCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatVideoChat(data json.RawMessage) (*UpdateChatVideoChat, error) { var resp UpdateChatVideoChat @@ -11649,16 +16465,8 @@ func UnmarshalUpdateChatHasProtectedContent(data json.RawMessage) (*UpdateChatHa return &resp, err } -func UnmarshalUpdateChatHasScheduledMessages(data json.RawMessage) (*UpdateChatHasScheduledMessages, error) { - var resp UpdateChatHasScheduledMessages - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateChatIsBlocked(data json.RawMessage) (*UpdateChatIsBlocked, error) { - var resp UpdateChatIsBlocked +func UnmarshalUpdateChatIsTranslatable(data json.RawMessage) (*UpdateChatIsTranslatable, error) { + var resp UpdateChatIsTranslatable err := json.Unmarshal(data, &resp) @@ -11673,8 +16481,24 @@ func UnmarshalUpdateChatIsMarkedAsUnread(data json.RawMessage) (*UpdateChatIsMar return &resp, err } -func UnmarshalUpdateChatFilters(data json.RawMessage) (*UpdateChatFilters, error) { - var resp UpdateChatFilters +func UnmarshalUpdateChatBlockList(data json.RawMessage) (*UpdateChatBlockList, error) { + var resp UpdateChatBlockList + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatHasScheduledMessages(data json.RawMessage) (*UpdateChatHasScheduledMessages, error) { + var resp UpdateChatHasScheduledMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatFolders(data json.RawMessage) (*UpdateChatFolders, error) { + var resp UpdateChatFolders err := json.Unmarshal(data, &resp) @@ -11689,6 +16513,14 @@ func UnmarshalUpdateChatOnlineMemberCount(data json.RawMessage) (*UpdateChatOnli return &resp, err } +func UnmarshalUpdateForumTopicInfo(data json.RawMessage) (*UpdateForumTopicInfo, error) { + var resp UpdateForumTopicInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) { var resp UpdateScopeNotificationSettings @@ -11841,6 +16673,38 @@ func UnmarshalUpdateFileGenerationStop(data json.RawMessage) (*UpdateFileGenerat return &resp, err } +func UnmarshalUpdateFileDownloads(data json.RawMessage) (*UpdateFileDownloads, error) { + var resp UpdateFileDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateFileAddedToDownloads(data json.RawMessage) (*UpdateFileAddedToDownloads, error) { + var resp UpdateFileAddedToDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateFileDownload(data json.RawMessage) (*UpdateFileDownload, error) { + var resp UpdateFileDownload + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateFileRemovedFromDownloads(data json.RawMessage) (*UpdateFileRemovedFromDownloads, error) { + var resp UpdateFileRemovedFromDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateCall(data json.RawMessage) (*UpdateCall, error) { var resp UpdateCall @@ -11897,6 +16761,62 @@ func UnmarshalUpdateUnreadChatCount(data json.RawMessage) (*UpdateUnreadChatCoun return &resp, err } +func UnmarshalUpdateStory(data json.RawMessage) (*UpdateStory, error) { + var resp UpdateStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStoryDeleted(data json.RawMessage) (*UpdateStoryDeleted, error) { + var resp UpdateStoryDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStorySendSucceeded(data json.RawMessage) (*UpdateStorySendSucceeded, error) { + var resp UpdateStorySendSucceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStorySendFailed(data json.RawMessage) (*UpdateStorySendFailed, error) { + var resp UpdateStorySendFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatActiveStories(data json.RawMessage) (*UpdateChatActiveStories, error) { + var resp UpdateChatActiveStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStoryListChatCount(data json.RawMessage) (*UpdateStoryListChatCount, error) { + var resp UpdateStoryListChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStoryStealthMode(data json.RawMessage) (*UpdateStoryStealthMode, error) { + var resp UpdateStoryStealthMode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateOption(data json.RawMessage) (*UpdateOption, error) { var resp UpdateOption @@ -11953,6 +16873,14 @@ func UnmarshalUpdateSavedAnimations(data json.RawMessage) (*UpdateSavedAnimation return &resp, err } +func UnmarshalUpdateSavedNotificationSounds(data json.RawMessage) (*UpdateSavedNotificationSounds, error) { + var resp UpdateSavedNotificationSounds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateSelectedBackground(data json.RawMessage) (*UpdateSelectedBackground, error) { var resp UpdateSelectedBackground @@ -11969,6 +16897,14 @@ func UnmarshalUpdateChatThemes(data json.RawMessage) (*UpdateChatThemes, error) return &resp, err } +func UnmarshalUpdateAccentColors(data json.RawMessage) (*UpdateAccentColors, error) { + var resp UpdateAccentColors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateLanguagePackStrings(data json.RawMessage) (*UpdateLanguagePackStrings, error) { var resp UpdateLanguagePackStrings @@ -12001,6 +16937,46 @@ func UnmarshalUpdateUsersNearby(data json.RawMessage) (*UpdateUsersNearby, error return &resp, err } +func UnmarshalUpdateUnconfirmedSession(data json.RawMessage) (*UpdateUnconfirmedSession, error) { + var resp UpdateUnconfirmedSession + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateAttachmentMenuBots(data json.RawMessage) (*UpdateAttachmentMenuBots, error) { + var resp UpdateAttachmentMenuBots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateWebAppMessageSent(data json.RawMessage) (*UpdateWebAppMessageSent, error) { + var resp UpdateWebAppMessageSent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateActiveEmojiReactions(data json.RawMessage) (*UpdateActiveEmojiReactions, error) { + var resp UpdateActiveEmojiReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateDefaultReactionType(data json.RawMessage) (*UpdateDefaultReactionType, error) { + var resp UpdateDefaultReactionType + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) { var resp UpdateDiceEmojis @@ -12033,6 +17009,22 @@ func UnmarshalUpdateSuggestedActions(data json.RawMessage) (*UpdateSuggestedActi return &resp, err } +func UnmarshalUpdateAddChatMembersPrivacyForbidden(data json.RawMessage) (*UpdateAddChatMembersPrivacyForbidden, error) { + var resp UpdateAddChatMembersPrivacyForbidden + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateAutosaveSettings(data json.RawMessage) (*UpdateAutosaveSettings, error) { + var resp UpdateAutosaveSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNewInlineQuery(data json.RawMessage) (*UpdateNewInlineQuery, error) { var resp UpdateNewInlineQuery @@ -12129,6 +17121,14 @@ func UnmarshalUpdateNewChatJoinRequest(data json.RawMessage) (*UpdateNewChatJoin return &resp, err } +func UnmarshalUpdateChatBoost(data json.RawMessage) (*UpdateChatBoost, error) { + var resp UpdateChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdates(data json.RawMessage) (*Updates, error) { var resp Updates @@ -12177,6 +17177,14 @@ func UnmarshalLogTags(data json.RawMessage) (*LogTags, error) { return &resp, err } +func UnmarshalUserSupportInfo(data json.RawMessage) (*UserSupportInfo, error) { + var resp UserSupportInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTestInt(data json.RawMessage) (*TestInt, error) { var resp TestInt @@ -12248,9 +17256,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeOk: return UnmarshalOk(data) - case TypeTdlibParameters: - return UnmarshalTdlibParameters(data) - case TypeAuthenticationCodeTypeTelegramMessage: return UnmarshalAuthenticationCodeTypeTelegramMessage(data) @@ -12266,12 +17271,36 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAuthenticationCodeTypeMissedCall: return UnmarshalAuthenticationCodeTypeMissedCall(data) + case TypeAuthenticationCodeTypeFragment: + return UnmarshalAuthenticationCodeTypeFragment(data) + + case TypeAuthenticationCodeTypeFirebaseAndroid: + return UnmarshalAuthenticationCodeTypeFirebaseAndroid(data) + + case TypeAuthenticationCodeTypeFirebaseIos: + return UnmarshalAuthenticationCodeTypeFirebaseIos(data) + case TypeAuthenticationCodeInfo: return UnmarshalAuthenticationCodeInfo(data) case TypeEmailAddressAuthenticationCodeInfo: return UnmarshalEmailAddressAuthenticationCodeInfo(data) + case TypeEmailAddressAuthenticationCode: + return UnmarshalEmailAddressAuthenticationCode(data) + + case TypeEmailAddressAuthenticationAppleId: + return UnmarshalEmailAddressAuthenticationAppleId(data) + + case TypeEmailAddressAuthenticationGoogleId: + return UnmarshalEmailAddressAuthenticationGoogleId(data) + + case TypeEmailAddressResetStateAvailable: + return UnmarshalEmailAddressResetStateAvailable(data) + + case TypeEmailAddressResetStatePending: + return UnmarshalEmailAddressResetStatePending(data) + case TypeTextEntity: return UnmarshalTextEntity(data) @@ -12287,12 +17316,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAuthorizationStateWaitTdlibParameters: return UnmarshalAuthorizationStateWaitTdlibParameters(data) - case TypeAuthorizationStateWaitEncryptionKey: - return UnmarshalAuthorizationStateWaitEncryptionKey(data) - case TypeAuthorizationStateWaitPhoneNumber: return UnmarshalAuthorizationStateWaitPhoneNumber(data) + case TypeAuthorizationStateWaitEmailAddress: + return UnmarshalAuthorizationStateWaitEmailAddress(data) + + case TypeAuthorizationStateWaitEmailCode: + return UnmarshalAuthorizationStateWaitEmailCode(data) + case TypeAuthorizationStateWaitCode: return UnmarshalAuthorizationStateWaitCode(data) @@ -12356,20 +17388,23 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeThumbnailFormatJpeg: return UnmarshalThumbnailFormatJpeg(data) - case TypeThumbnailFormatPng: - return UnmarshalThumbnailFormatPng(data) - - case TypeThumbnailFormatWebp: - return UnmarshalThumbnailFormatWebp(data) - case TypeThumbnailFormatGif: return UnmarshalThumbnailFormatGif(data) + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) + + case TypeThumbnailFormatPng: + return UnmarshalThumbnailFormatPng(data) + case TypeThumbnailFormatTgs: return UnmarshalThumbnailFormatTgs(data) - case TypeThumbnailFormatMpeg4: - return UnmarshalThumbnailFormatMpeg4(data) + case TypeThumbnailFormatWebm: + return UnmarshalThumbnailFormatWebm(data) + + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) case TypeThumbnail: return UnmarshalThumbnail(data) @@ -12389,6 +17424,33 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMaskPosition: return UnmarshalMaskPosition(data) + case TypeStickerFormatWebp: + return UnmarshalStickerFormatWebp(data) + + case TypeStickerFormatTgs: + return UnmarshalStickerFormatTgs(data) + + case TypeStickerFormatWebm: + return UnmarshalStickerFormatWebm(data) + + case TypeStickerTypeRegular: + return UnmarshalStickerTypeRegular(data) + + case TypeStickerTypeMask: + return UnmarshalStickerTypeMask(data) + + case TypeStickerTypeCustomEmoji: + return UnmarshalStickerTypeCustomEmoji(data) + + case TypeStickerFullTypeRegular: + return UnmarshalStickerFullTypeRegular(data) + + case TypeStickerFullTypeMask: + return UnmarshalStickerFullTypeMask(data) + + case TypeStickerFullTypeCustomEmoji: + return UnmarshalStickerFullTypeCustomEmoji(data) + case TypeClosedVectorPath: return UnmarshalClosedVectorPath(data) @@ -12440,9 +17502,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGame: return UnmarshalGame(data) + case TypeWebApp: + return UnmarshalWebApp(data) + case TypePoll: return UnmarshalPoll(data) + case TypeBackground: + return UnmarshalBackground(data) + + case TypeBackgrounds: + return UnmarshalBackgrounds(data) + + case TypeChatBackground: + return UnmarshalChatBackground(data) + case TypeProfilePhoto: return UnmarshalProfilePhoto(data) @@ -12467,9 +17541,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBotCommands: return UnmarshalBotCommands(data) + case TypeBotMenuButton: + return UnmarshalBotMenuButton(data) + case TypeChatLocation: return UnmarshalChatLocation(data) + case TypeChatPhotoStickerTypeRegularOrMask: + return UnmarshalChatPhotoStickerTypeRegularOrMask(data) + + case TypeChatPhotoStickerTypeCustomEmoji: + return UnmarshalChatPhotoStickerTypeCustomEmoji(data) + + case TypeChatPhotoSticker: + return UnmarshalChatPhotoSticker(data) + case TypeAnimatedChatPhoto: return UnmarshalAnimatedChatPhoto(data) @@ -12488,9 +17574,69 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputChatPhotoAnimation: return UnmarshalInputChatPhotoAnimation(data) + case TypeInputChatPhotoSticker: + return UnmarshalInputChatPhotoSticker(data) + + case TypeChatPermissions: + return UnmarshalChatPermissions(data) + + case TypeChatAdministratorRights: + return UnmarshalChatAdministratorRights(data) + + case TypePremiumPaymentOption: + return UnmarshalPremiumPaymentOption(data) + + case TypePremiumStatePaymentOption: + return UnmarshalPremiumStatePaymentOption(data) + + case TypePremiumGiftCodePaymentOption: + return UnmarshalPremiumGiftCodePaymentOption(data) + + case TypePremiumGiftCodePaymentOptions: + return UnmarshalPremiumGiftCodePaymentOptions(data) + + case TypePremiumGiftCodeInfo: + return UnmarshalPremiumGiftCodeInfo(data) + + case TypePremiumGiveawayParticipantStatusEligible: + return UnmarshalPremiumGiveawayParticipantStatusEligible(data) + + case TypePremiumGiveawayParticipantStatusParticipating: + return UnmarshalPremiumGiveawayParticipantStatusParticipating(data) + + case TypePremiumGiveawayParticipantStatusAlreadyWasMember: + return UnmarshalPremiumGiveawayParticipantStatusAlreadyWasMember(data) + + case TypePremiumGiveawayParticipantStatusAdministrator: + return UnmarshalPremiumGiveawayParticipantStatusAdministrator(data) + + case TypePremiumGiveawayParticipantStatusDisallowedCountry: + return UnmarshalPremiumGiveawayParticipantStatusDisallowedCountry(data) + + case TypePremiumGiveawayInfoOngoing: + return UnmarshalPremiumGiveawayInfoOngoing(data) + + case TypePremiumGiveawayInfoCompleted: + return UnmarshalPremiumGiveawayInfoCompleted(data) + + case TypeAccentColor: + return UnmarshalAccentColor(data) + + case TypeEmojiStatus: + return UnmarshalEmojiStatus(data) + + case TypeEmojiStatuses: + return UnmarshalEmojiStatuses(data) + + case TypeUsernames: + return UnmarshalUsernames(data) + case TypeUser: return UnmarshalUser(data) + case TypeBotInfo: + return UnmarshalBotInfo(data) + case TypeUserFullInfo: return UnmarshalUserFullInfo(data) @@ -12503,9 +17649,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatAdministrators: return UnmarshalChatAdministrators(data) - case TypeChatPermissions: - return UnmarshalChatPermissions(data) - case TypeChatMemberStatusCreator: return UnmarshalChatMemberStatusCreator(data) @@ -12593,6 +17736,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatInviteLinkMembers: return UnmarshalChatInviteLinkMembers(data) + case TypeInviteLinkChatTypeBasicGroup: + return UnmarshalInviteLinkChatTypeBasicGroup(data) + + case TypeInviteLinkChatTypeSupergroup: + return UnmarshalInviteLinkChatTypeSupergroup(data) + + case TypeInviteLinkChatTypeChannel: + return UnmarshalInviteLinkChatTypeChannel(data) + case TypeChatInviteLinkInfo: return UnmarshalChatInviteLinkInfo(data) @@ -12638,36 +17790,72 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSenders: return UnmarshalMessageSenders(data) - case TypeMessageForwardOriginUser: - return UnmarshalMessageForwardOriginUser(data) + case TypeChatMessageSender: + return UnmarshalChatMessageSender(data) - case TypeMessageForwardOriginChat: - return UnmarshalMessageForwardOriginChat(data) + case TypeChatMessageSenders: + return UnmarshalChatMessageSenders(data) - case TypeMessageForwardOriginHiddenUser: - return UnmarshalMessageForwardOriginHiddenUser(data) + case TypeMessageViewer: + return UnmarshalMessageViewer(data) - case TypeMessageForwardOriginChannel: - return UnmarshalMessageForwardOriginChannel(data) + case TypeMessageViewers: + return UnmarshalMessageViewers(data) - case TypeMessageForwardOriginMessageImport: - return UnmarshalMessageForwardOriginMessageImport(data) + case TypeMessageOriginUser: + return UnmarshalMessageOriginUser(data) + + case TypeMessageOriginHiddenUser: + return UnmarshalMessageOriginHiddenUser(data) + + case TypeMessageOriginChat: + return UnmarshalMessageOriginChat(data) + + case TypeMessageOriginChannel: + return UnmarshalMessageOriginChannel(data) + + case TypeReactionTypeEmoji: + return UnmarshalReactionTypeEmoji(data) + + case TypeReactionTypeCustomEmoji: + return UnmarshalReactionTypeCustomEmoji(data) case TypeMessageForwardInfo: return UnmarshalMessageForwardInfo(data) + case TypeMessageImportInfo: + return UnmarshalMessageImportInfo(data) + case TypeMessageReplyInfo: return UnmarshalMessageReplyInfo(data) + case TypeMessageReaction: + return UnmarshalMessageReaction(data) + case TypeMessageInteractionInfo: return UnmarshalMessageInteractionInfo(data) + case TypeUnreadReaction: + return UnmarshalUnreadReaction(data) + case TypeMessageSendingStatePending: return UnmarshalMessageSendingStatePending(data) case TypeMessageSendingStateFailed: return UnmarshalMessageSendingStateFailed(data) + case TypeMessageReplyToMessage: + return UnmarshalMessageReplyToMessage(data) + + case TypeMessageReplyToStory: + return UnmarshalMessageReplyToStory(data) + + case TypeInputMessageReplyToMessage: + return UnmarshalInputMessageReplyToMessage(data) + + case TypeInputMessageReplyToStory: + return UnmarshalInputMessageReplyToStory(data) + case TypeMessage: return UnmarshalMessage(data) @@ -12677,6 +17865,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFoundMessages: return UnmarshalFoundMessages(data) + case TypeFoundChatMessages: + return UnmarshalFoundChatMessages(data) + case TypeMessagePosition: return UnmarshalMessagePosition(data) @@ -12689,9 +17880,66 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageCalendar: return UnmarshalMessageCalendar(data) + case TypeMessageSourceChatHistory: + return UnmarshalMessageSourceChatHistory(data) + + case TypeMessageSourceMessageThreadHistory: + return UnmarshalMessageSourceMessageThreadHistory(data) + + case TypeMessageSourceForumTopicHistory: + return UnmarshalMessageSourceForumTopicHistory(data) + + case TypeMessageSourceHistoryPreview: + return UnmarshalMessageSourceHistoryPreview(data) + + case TypeMessageSourceChatList: + return UnmarshalMessageSourceChatList(data) + + case TypeMessageSourceSearch: + return UnmarshalMessageSourceSearch(data) + + case TypeMessageSourceChatEventLog: + return UnmarshalMessageSourceChatEventLog(data) + + case TypeMessageSourceNotification: + return UnmarshalMessageSourceNotification(data) + + case TypeMessageSourceScreenshot: + return UnmarshalMessageSourceScreenshot(data) + + case TypeMessageSourceOther: + return UnmarshalMessageSourceOther(data) + + case TypeMessageSponsorTypeBot: + return UnmarshalMessageSponsorTypeBot(data) + + case TypeMessageSponsorTypePublicChannel: + return UnmarshalMessageSponsorTypePublicChannel(data) + + case TypeMessageSponsorTypePrivateChannel: + return UnmarshalMessageSponsorTypePrivateChannel(data) + + case TypeMessageSponsorTypeWebsite: + return UnmarshalMessageSponsorTypeWebsite(data) + + case TypeMessageSponsor: + return UnmarshalMessageSponsor(data) + case TypeSponsoredMessage: return UnmarshalSponsoredMessage(data) + case TypeSponsoredMessages: + return UnmarshalSponsoredMessages(data) + + case TypeFileDownload: + return UnmarshalFileDownload(data) + + case TypeDownloadedFileCounts: + return UnmarshalDownloadedFileCounts(data) + + case TypeFoundFileDownloads: + return UnmarshalFoundFileDownloads(data) + case TypeNotificationSettingsScopePrivateChats: return UnmarshalNotificationSettingsScopePrivateChats(data) @@ -12722,17 +17970,32 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatTypeSecret: return UnmarshalChatTypeSecret(data) - case TypeChatFilter: - return UnmarshalChatFilter(data) + case TypeChatFolderIcon: + return UnmarshalChatFolderIcon(data) - case TypeChatFilterInfo: - return UnmarshalChatFilterInfo(data) + case TypeChatFolder: + return UnmarshalChatFolder(data) - case TypeRecommendedChatFilter: - return UnmarshalRecommendedChatFilter(data) + case TypeChatFolderInfo: + return UnmarshalChatFolderInfo(data) - case TypeRecommendedChatFilters: - return UnmarshalRecommendedChatFilters(data) + case TypeChatFolderInviteLink: + return UnmarshalChatFolderInviteLink(data) + + case TypeChatFolderInviteLinks: + return UnmarshalChatFolderInviteLinks(data) + + case TypeChatFolderInviteLinkInfo: + return UnmarshalChatFolderInviteLinkInfo(data) + + case TypeRecommendedChatFolder: + return UnmarshalRecommendedChatFolder(data) + + case TypeRecommendedChatFolders: + return UnmarshalRecommendedChatFolders(data) + + case TypeArchiveChatListSettings: + return UnmarshalArchiveChatListSettings(data) case TypeChatListMain: return UnmarshalChatListMain(data) @@ -12740,8 +18003,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatListArchive: return UnmarshalChatListArchive(data) - case TypeChatListFilter: - return UnmarshalChatListFilter(data) + case TypeChatListFolder: + return UnmarshalChatListFolder(data) case TypeChatLists: return UnmarshalChatLists(data) @@ -12755,6 +18018,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatPosition: return UnmarshalChatPosition(data) + case TypeChatAvailableReactionsAll: + return UnmarshalChatAvailableReactionsAll(data) + + case TypeChatAvailableReactionsSome: + return UnmarshalChatAvailableReactionsSome(data) + case TypeVideoChat: return UnmarshalVideoChat(data) @@ -12809,6 +18078,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeKeyboardButtonTypeRequestPoll: return UnmarshalKeyboardButtonTypeRequestPoll(data) + case TypeKeyboardButtonTypeRequestUser: + return UnmarshalKeyboardButtonTypeRequestUser(data) + + case TypeKeyboardButtonTypeRequestChat: + return UnmarshalKeyboardButtonTypeRequestChat(data) + + case TypeKeyboardButtonTypeWebApp: + return UnmarshalKeyboardButtonTypeWebApp(data) + case TypeKeyboardButton: return UnmarshalKeyboardButton(data) @@ -12818,6 +18096,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInlineKeyboardButtonTypeLoginUrl: return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) + case TypeInlineKeyboardButtonTypeWebApp: + return UnmarshalInlineKeyboardButtonTypeWebApp(data) + case TypeInlineKeyboardButtonTypeCallback: return UnmarshalInlineKeyboardButtonTypeCallback(data) @@ -12857,9 +18138,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLoginUrlInfoRequestConfirmation: return UnmarshalLoginUrlInfoRequestConfirmation(data) + case TypeFoundWebApp: + return UnmarshalFoundWebApp(data) + + case TypeWebAppInfo: + return UnmarshalWebAppInfo(data) + case TypeMessageThreadInfo: return UnmarshalMessageThreadInfo(data) + case TypeForumTopicIcon: + return UnmarshalForumTopicIcon(data) + + case TypeForumTopicInfo: + return UnmarshalForumTopicInfo(data) + + case TypeForumTopic: + return UnmarshalForumTopic(data) + + case TypeForumTopics: + return UnmarshalForumTopics(data) + + case TypeLinkPreviewOptions: + return UnmarshalLinkPreviewOptions(data) + case TypeRichTextPlain: return UnmarshalRichTextPlain(data) @@ -13052,6 +18354,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAddress: return UnmarshalAddress(data) + case TypeThemeParameters: + return UnmarshalThemeParameters(data) + case TypeLabeledPricePart: return UnmarshalLabeledPricePart(data) @@ -13079,11 +18384,17 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputCredentialsGooglePay: return UnmarshalInputCredentialsGooglePay(data) - case TypePaymentsProviderStripe: - return UnmarshalPaymentsProviderStripe(data) + case TypePaymentProviderSmartGlocal: + return UnmarshalPaymentProviderSmartGlocal(data) - case TypePaymentFormTheme: - return UnmarshalPaymentFormTheme(data) + case TypePaymentProviderStripe: + return UnmarshalPaymentProviderStripe(data) + + case TypePaymentProviderOther: + return UnmarshalPaymentProviderOther(data) + + case TypePaymentOption: + return UnmarshalPaymentOption(data) case TypePaymentForm: return UnmarshalPaymentForm(data) @@ -13097,6 +18408,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePaymentReceipt: return UnmarshalPaymentReceipt(data) + case TypeInputInvoiceMessage: + return UnmarshalInputInvoiceMessage(data) + + case TypeInputInvoiceName: + return UnmarshalInputInvoiceName(data) + + case TypeInputInvoiceTelegram: + return UnmarshalInputInvoiceTelegram(data) + + case TypeMessageExtendedMediaPreview: + return UnmarshalMessageExtendedMediaPreview(data) + + case TypeMessageExtendedMediaPhoto: + return UnmarshalMessageExtendedMediaPhoto(data) + + case TypeMessageExtendedMediaVideo: + return UnmarshalMessageExtendedMediaVideo(data) + + case TypeMessageExtendedMediaUnsupported: + return UnmarshalMessageExtendedMediaUnsupported(data) + + case TypePremiumGiveawayParameters: + return UnmarshalPremiumGiveawayParameters(data) + case TypeDatedFile: return UnmarshalDatedFile(data) @@ -13370,6 +18705,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePoll: return UnmarshalMessagePoll(data) + case TypeMessageStory: + return UnmarshalMessageStory(data) + case TypeMessageInvoice: return UnmarshalMessageInvoice(data) @@ -13427,11 +18765,29 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageScreenshotTaken: return UnmarshalMessageScreenshotTaken(data) + case TypeMessageChatSetBackground: + return UnmarshalMessageChatSetBackground(data) + case TypeMessageChatSetTheme: return UnmarshalMessageChatSetTheme(data) - case TypeMessageChatSetTtl: - return UnmarshalMessageChatSetTtl(data) + case TypeMessageChatSetMessageAutoDeleteTime: + return UnmarshalMessageChatSetMessageAutoDeleteTime(data) + + case TypeMessageForumTopicCreated: + return UnmarshalMessageForumTopicCreated(data) + + case TypeMessageForumTopicEdited: + return UnmarshalMessageForumTopicEdited(data) + + case TypeMessageForumTopicIsClosedToggled: + return UnmarshalMessageForumTopicIsClosedToggled(data) + + case TypeMessageForumTopicIsHiddenToggled: + return UnmarshalMessageForumTopicIsHiddenToggled(data) + + case TypeMessageSuggestProfilePhoto: + return UnmarshalMessageSuggestProfilePhoto(data) case TypeMessageCustomServiceAction: return UnmarshalMessageCustomServiceAction(data) @@ -13445,11 +18801,35 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePaymentSuccessfulBot: return UnmarshalMessagePaymentSuccessfulBot(data) + case TypeMessageGiftedPremium: + return UnmarshalMessageGiftedPremium(data) + + case TypeMessagePremiumGiftCode: + return UnmarshalMessagePremiumGiftCode(data) + + case TypeMessagePremiumGiveawayCreated: + return UnmarshalMessagePremiumGiveawayCreated(data) + + case TypeMessagePremiumGiveaway: + return UnmarshalMessagePremiumGiveaway(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) - case TypeMessageWebsiteConnected: - return UnmarshalMessageWebsiteConnected(data) + case TypeMessageUserShared: + return UnmarshalMessageUserShared(data) + + case TypeMessageChatShared: + return UnmarshalMessageChatShared(data) + + case TypeMessageBotWriteAccessAllowed: + return UnmarshalMessageBotWriteAccessAllowed(data) + + case TypeMessageWebAppDataSent: + return UnmarshalMessageWebAppDataSent(data) + + case TypeMessageWebAppDataReceived: + return UnmarshalMessageWebAppDataReceived(data) case TypeMessagePassportDataSent: return UnmarshalMessagePassportDataSent(data) @@ -13499,6 +18879,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypeStrikethrough: return UnmarshalTextEntityTypeStrikethrough(data) + case TypeTextEntityTypeSpoiler: + return UnmarshalTextEntityTypeSpoiler(data) + case TypeTextEntityTypeCode: return UnmarshalTextEntityTypeCode(data) @@ -13508,12 +18891,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypePreCode: return UnmarshalTextEntityTypePreCode(data) + case TypeTextEntityTypeBlockQuote: + return UnmarshalTextEntityTypeBlockQuote(data) + case TypeTextEntityTypeTextUrl: return UnmarshalTextEntityTypeTextUrl(data) case TypeTextEntityTypeMentionName: return UnmarshalTextEntityTypeMentionName(data) + case TypeTextEntityTypeCustomEmoji: + return UnmarshalTextEntityTypeCustomEmoji(data) + case TypeTextEntityTypeMediaTimestamp: return UnmarshalTextEntityTypeMediaTimestamp(data) @@ -13526,6 +18915,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSchedulingStateSendWhenOnline: return UnmarshalMessageSchedulingStateSendWhenOnline(data) + case TypeMessageSelfDestructTypeTimer: + return UnmarshalMessageSelfDestructTypeTimer(data) + + case TypeMessageSelfDestructTypeImmediately: + return UnmarshalMessageSelfDestructTypeImmediately(data) + case TypeMessageSendOptions: return UnmarshalMessageSendOptions(data) @@ -13580,6 +18975,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessagePoll: return UnmarshalInputMessagePoll(data) + case TypeInputMessageStory: + return UnmarshalInputMessageStory(data) + case TypeInputMessageForwarded: return UnmarshalInputMessageForwarded(data) @@ -13625,6 +19023,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesFilterUnreadMention: return UnmarshalSearchMessagesFilterUnreadMention(data) + case TypeSearchMessagesFilterUnreadReaction: + return UnmarshalSearchMessagesFilterUnreadReaction(data) + case TypeSearchMessagesFilterFailedToSend: return UnmarshalSearchMessagesFilterFailedToSend(data) @@ -13709,6 +19110,129 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStickerSets: return UnmarshalStickerSets(data) + case TypeTrendingStickerSets: + return UnmarshalTrendingStickerSets(data) + + case TypeEmojiCategory: + return UnmarshalEmojiCategory(data) + + case TypeEmojiCategories: + return UnmarshalEmojiCategories(data) + + case TypeEmojiCategoryTypeDefault: + return UnmarshalEmojiCategoryTypeDefault(data) + + case TypeEmojiCategoryTypeEmojiStatus: + return UnmarshalEmojiCategoryTypeEmojiStatus(data) + + case TypeEmojiCategoryTypeChatPhoto: + return UnmarshalEmojiCategoryTypeChatPhoto(data) + + case TypeStoryViewer: + return UnmarshalStoryViewer(data) + + case TypeStoryViewers: + return UnmarshalStoryViewers(data) + + case TypeStoryAreaPosition: + return UnmarshalStoryAreaPosition(data) + + case TypeStoryAreaTypeLocation: + return UnmarshalStoryAreaTypeLocation(data) + + case TypeStoryAreaTypeVenue: + return UnmarshalStoryAreaTypeVenue(data) + + case TypeStoryAreaTypeSuggestedReaction: + return UnmarshalStoryAreaTypeSuggestedReaction(data) + + case TypeStoryArea: + return UnmarshalStoryArea(data) + + case TypeInputStoryAreaTypeLocation: + return UnmarshalInputStoryAreaTypeLocation(data) + + case TypeInputStoryAreaTypeFoundVenue: + return UnmarshalInputStoryAreaTypeFoundVenue(data) + + case TypeInputStoryAreaTypePreviousVenue: + return UnmarshalInputStoryAreaTypePreviousVenue(data) + + case TypeInputStoryAreaTypeSuggestedReaction: + return UnmarshalInputStoryAreaTypeSuggestedReaction(data) + + case TypeInputStoryArea: + return UnmarshalInputStoryArea(data) + + case TypeInputStoryAreas: + return UnmarshalInputStoryAreas(data) + + case TypeStoryVideo: + return UnmarshalStoryVideo(data) + + case TypeStoryContentPhoto: + return UnmarshalStoryContentPhoto(data) + + case TypeStoryContentVideo: + return UnmarshalStoryContentVideo(data) + + case TypeStoryContentUnsupported: + return UnmarshalStoryContentUnsupported(data) + + case TypeInputStoryContentPhoto: + return UnmarshalInputStoryContentPhoto(data) + + case TypeInputStoryContentVideo: + return UnmarshalInputStoryContentVideo(data) + + case TypeStoryListMain: + return UnmarshalStoryListMain(data) + + case TypeStoryListArchive: + return UnmarshalStoryListArchive(data) + + case TypeStoryInteractionInfo: + return UnmarshalStoryInteractionInfo(data) + + case TypeStory: + return UnmarshalStory(data) + + case TypeStories: + return UnmarshalStories(data) + + case TypeStoryInfo: + return UnmarshalStoryInfo(data) + + case TypeChatActiveStories: + return UnmarshalChatActiveStories(data) + + case TypeChatBoostSourceGiftCode: + return UnmarshalChatBoostSourceGiftCode(data) + + case TypeChatBoostSourceGiveaway: + return UnmarshalChatBoostSourceGiveaway(data) + + case TypeChatBoostSourcePremium: + return UnmarshalChatBoostSourcePremium(data) + + case TypePrepaidPremiumGiveaway: + return UnmarshalPrepaidPremiumGiveaway(data) + + case TypeChatBoostStatus: + return UnmarshalChatBoostStatus(data) + + case TypeChatBoost: + return UnmarshalChatBoost(data) + + case TypeFoundChatBoosts: + return UnmarshalFoundChatBoosts(data) + + case TypeChatBoostSlot: + return UnmarshalChatBoostSlot(data) + + case TypeChatBoostSlots: + return UnmarshalChatBoostSlots(data) + case TypeCallDiscardReasonEmpty: return UnmarshalCallDiscardReasonEmpty(data) @@ -13769,6 +19293,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGroupCallVideoQualityFull: return UnmarshalGroupCallVideoQualityFull(data) + case TypeGroupCallStream: + return UnmarshalGroupCallStream(data) + + case TypeGroupCallStreams: + return UnmarshalGroupCallStreams(data) + + case TypeRtmpUrl: + return UnmarshalRtmpUrl(data) + case TypeGroupCallRecentSpeaker: return UnmarshalGroupCallRecentSpeaker(data) @@ -13814,9 +19347,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCall: return UnmarshalCall(data) + case TypeFirebaseAuthenticationSettingsAndroid: + return UnmarshalFirebaseAuthenticationSettingsAndroid(data) + + case TypeFirebaseAuthenticationSettingsIos: + return UnmarshalFirebaseAuthenticationSettingsIos(data) + case TypePhoneNumberAuthenticationSettings: return UnmarshalPhoneNumberAuthenticationSettings(data) + case TypeAddedReaction: + return UnmarshalAddedReaction(data) + + case TypeAddedReactions: + return UnmarshalAddedReactions(data) + + case TypeAvailableReaction: + return UnmarshalAvailableReaction(data) + + case TypeAvailableReactions: + return UnmarshalAvailableReactions(data) + + case TypeEmojiReaction: + return UnmarshalEmojiReaction(data) + case TypeAnimations: return UnmarshalAnimations(data) @@ -13829,9 +19383,42 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeImportedContacts: return UnmarshalImportedContacts(data) + case TypeSpeechRecognitionResultPending: + return UnmarshalSpeechRecognitionResultPending(data) + + case TypeSpeechRecognitionResultText: + return UnmarshalSpeechRecognitionResultText(data) + + case TypeSpeechRecognitionResultError: + return UnmarshalSpeechRecognitionResultError(data) + + case TypeAttachmentMenuBotColor: + return UnmarshalAttachmentMenuBotColor(data) + + case TypeAttachmentMenuBot: + return UnmarshalAttachmentMenuBot(data) + + case TypeSentWebAppMessage: + return UnmarshalSentWebAppMessage(data) + + case TypeBotWriteAccessAllowReasonConnectedWebsite: + return UnmarshalBotWriteAccessAllowReasonConnectedWebsite(data) + + case TypeBotWriteAccessAllowReasonAddedToAttachmentMenu: + return UnmarshalBotWriteAccessAllowReasonAddedToAttachmentMenu(data) + + case TypeBotWriteAccessAllowReasonLaunchedWebApp: + return UnmarshalBotWriteAccessAllowReasonLaunchedWebApp(data) + + case TypeBotWriteAccessAllowReasonAcceptedRequest: + return UnmarshalBotWriteAccessAllowReasonAcceptedRequest(data) + case TypeHttpUrl: return UnmarshalHttpUrl(data) + case TypeUserLink: + return UnmarshalUserLink(data) + case TypeInputInlineQueryResultAnimation: return UnmarshalInputInlineQueryResultAnimation(data) @@ -13904,6 +19491,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInlineQueryResultVoiceNote: return UnmarshalInlineQueryResultVoiceNote(data) + case TypeInlineQueryResultsButtonTypeStartBot: + return UnmarshalInlineQueryResultsButtonTypeStartBot(data) + + case TypeInlineQueryResultsButtonTypeWebApp: + return UnmarshalInlineQueryResultsButtonTypeWebApp(data) + + case TypeInlineQueryResultsButton: + return UnmarshalInlineQueryResultsButton(data) + case TypeInlineQueryResults: return UnmarshalInlineQueryResults(data) @@ -13934,15 +19530,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventMessageDeleted: return UnmarshalChatEventMessageDeleted(data) - case TypeChatEventPollStopped: - return UnmarshalChatEventPollStopped(data) - case TypeChatEventMessagePinned: return UnmarshalChatEventMessagePinned(data) case TypeChatEventMessageUnpinned: return UnmarshalChatEventMessageUnpinned(data) + case TypeChatEventPollStopped: + return UnmarshalChatEventPollStopped(data) + case TypeChatEventMemberJoined: return UnmarshalChatEventMemberJoined(data) @@ -13952,60 +19548,75 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventMemberJoinedByRequest: return UnmarshalChatEventMemberJoinedByRequest(data) - case TypeChatEventMemberLeft: - return UnmarshalChatEventMemberLeft(data) - case TypeChatEventMemberInvited: return UnmarshalChatEventMemberInvited(data) + case TypeChatEventMemberLeft: + return UnmarshalChatEventMemberLeft(data) + case TypeChatEventMemberPromoted: return UnmarshalChatEventMemberPromoted(data) case TypeChatEventMemberRestricted: return UnmarshalChatEventMemberRestricted(data) - case TypeChatEventTitleChanged: - return UnmarshalChatEventTitleChanged(data) - - case TypeChatEventPermissionsChanged: - return UnmarshalChatEventPermissionsChanged(data) + case TypeChatEventAvailableReactionsChanged: + return UnmarshalChatEventAvailableReactionsChanged(data) case TypeChatEventDescriptionChanged: return UnmarshalChatEventDescriptionChanged(data) - case TypeChatEventUsernameChanged: - return UnmarshalChatEventUsernameChanged(data) - - case TypeChatEventPhotoChanged: - return UnmarshalChatEventPhotoChanged(data) - - case TypeChatEventInvitesToggled: - return UnmarshalChatEventInvitesToggled(data) - case TypeChatEventLinkedChatChanged: return UnmarshalChatEventLinkedChatChanged(data) - case TypeChatEventSlowModeDelayChanged: - return UnmarshalChatEventSlowModeDelayChanged(data) - - case TypeChatEventMessageTtlChanged: - return UnmarshalChatEventMessageTtlChanged(data) - - case TypeChatEventSignMessagesToggled: - return UnmarshalChatEventSignMessagesToggled(data) - - case TypeChatEventHasProtectedContentToggled: - return UnmarshalChatEventHasProtectedContentToggled(data) - - case TypeChatEventStickerSetChanged: - return UnmarshalChatEventStickerSetChanged(data) - case TypeChatEventLocationChanged: return UnmarshalChatEventLocationChanged(data) + case TypeChatEventMessageAutoDeleteTimeChanged: + return UnmarshalChatEventMessageAutoDeleteTimeChanged(data) + + case TypeChatEventPermissionsChanged: + return UnmarshalChatEventPermissionsChanged(data) + + case TypeChatEventPhotoChanged: + return UnmarshalChatEventPhotoChanged(data) + + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) + + case TypeChatEventStickerSetChanged: + return UnmarshalChatEventStickerSetChanged(data) + + case TypeChatEventTitleChanged: + return UnmarshalChatEventTitleChanged(data) + + case TypeChatEventUsernameChanged: + return UnmarshalChatEventUsernameChanged(data) + + case TypeChatEventActiveUsernamesChanged: + return UnmarshalChatEventActiveUsernamesChanged(data) + + case TypeChatEventAccentColorChanged: + return UnmarshalChatEventAccentColorChanged(data) + + case TypeChatEventBackgroundCustomEmojiChanged: + return UnmarshalChatEventBackgroundCustomEmojiChanged(data) + + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) + + case TypeChatEventInvitesToggled: + return UnmarshalChatEventInvitesToggled(data) + case TypeChatEventIsAllHistoryAvailableToggled: return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventHasAggressiveAntiSpamEnabledToggled: + return UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data) + + case TypeChatEventSignMessagesToggled: + return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventInviteLinkEdited: return UnmarshalChatEventInviteLinkEdited(data) @@ -14021,14 +19632,35 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventVideoChatEnded: return UnmarshalChatEventVideoChatEnded(data) + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEventVideoChatParticipantIsMutedToggled: return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) case TypeChatEventVideoChatParticipantVolumeLevelChanged: return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) - case TypeChatEventVideoChatMuteNewParticipantsToggled: - return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEventIsForumToggled: + return UnmarshalChatEventIsForumToggled(data) + + case TypeChatEventForumTopicCreated: + return UnmarshalChatEventForumTopicCreated(data) + + case TypeChatEventForumTopicEdited: + return UnmarshalChatEventForumTopicEdited(data) + + case TypeChatEventForumTopicToggleIsClosed: + return UnmarshalChatEventForumTopicToggleIsClosed(data) + + case TypeChatEventForumTopicToggleIsHidden: + return UnmarshalChatEventForumTopicToggleIsHidden(data) + + case TypeChatEventForumTopicDeleted: + return UnmarshalChatEventForumTopicDeleted(data) + + case TypeChatEventForumTopicPinned: + return UnmarshalChatEventForumTopicPinned(data) case TypeChatEvent: return UnmarshalChatEvent(data) @@ -14060,6 +19692,174 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLocalizationTargetInfo: return UnmarshalLocalizationTargetInfo(data) + case TypePremiumLimitTypeSupergroupCount: + return UnmarshalPremiumLimitTypeSupergroupCount(data) + + case TypePremiumLimitTypePinnedChatCount: + return UnmarshalPremiumLimitTypePinnedChatCount(data) + + case TypePremiumLimitTypeCreatedPublicChatCount: + return UnmarshalPremiumLimitTypeCreatedPublicChatCount(data) + + case TypePremiumLimitTypeSavedAnimationCount: + return UnmarshalPremiumLimitTypeSavedAnimationCount(data) + + case TypePremiumLimitTypeFavoriteStickerCount: + return UnmarshalPremiumLimitTypeFavoriteStickerCount(data) + + case TypePremiumLimitTypeChatFolderCount: + return UnmarshalPremiumLimitTypeChatFolderCount(data) + + case TypePremiumLimitTypeChatFolderChosenChatCount: + return UnmarshalPremiumLimitTypeChatFolderChosenChatCount(data) + + case TypePremiumLimitTypePinnedArchivedChatCount: + return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data) + + case TypePremiumLimitTypeCaptionLength: + return UnmarshalPremiumLimitTypeCaptionLength(data) + + case TypePremiumLimitTypeBioLength: + return UnmarshalPremiumLimitTypeBioLength(data) + + case TypePremiumLimitTypeChatFolderInviteLinkCount: + return UnmarshalPremiumLimitTypeChatFolderInviteLinkCount(data) + + case TypePremiumLimitTypeShareableChatFolderCount: + return UnmarshalPremiumLimitTypeShareableChatFolderCount(data) + + case TypePremiumLimitTypeActiveStoryCount: + return UnmarshalPremiumLimitTypeActiveStoryCount(data) + + case TypePremiumLimitTypeWeeklySentStoryCount: + return UnmarshalPremiumLimitTypeWeeklySentStoryCount(data) + + case TypePremiumLimitTypeMonthlySentStoryCount: + return UnmarshalPremiumLimitTypeMonthlySentStoryCount(data) + + case TypePremiumLimitTypeStoryCaptionLength: + return UnmarshalPremiumLimitTypeStoryCaptionLength(data) + + case TypePremiumLimitTypeStorySuggestedReactionAreaCount: + return UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data) + + case TypePremiumFeatureIncreasedLimits: + return UnmarshalPremiumFeatureIncreasedLimits(data) + + case TypePremiumFeatureIncreasedUploadFileSize: + return UnmarshalPremiumFeatureIncreasedUploadFileSize(data) + + case TypePremiumFeatureImprovedDownloadSpeed: + return UnmarshalPremiumFeatureImprovedDownloadSpeed(data) + + case TypePremiumFeatureVoiceRecognition: + return UnmarshalPremiumFeatureVoiceRecognition(data) + + case TypePremiumFeatureDisabledAds: + return UnmarshalPremiumFeatureDisabledAds(data) + + case TypePremiumFeatureUniqueReactions: + return UnmarshalPremiumFeatureUniqueReactions(data) + + case TypePremiumFeatureUniqueStickers: + return UnmarshalPremiumFeatureUniqueStickers(data) + + case TypePremiumFeatureCustomEmoji: + return UnmarshalPremiumFeatureCustomEmoji(data) + + case TypePremiumFeatureAdvancedChatManagement: + return UnmarshalPremiumFeatureAdvancedChatManagement(data) + + case TypePremiumFeatureProfileBadge: + return UnmarshalPremiumFeatureProfileBadge(data) + + case TypePremiumFeatureEmojiStatus: + return UnmarshalPremiumFeatureEmojiStatus(data) + + case TypePremiumFeatureAnimatedProfilePhoto: + return UnmarshalPremiumFeatureAnimatedProfilePhoto(data) + + case TypePremiumFeatureForumTopicIcon: + return UnmarshalPremiumFeatureForumTopicIcon(data) + + case TypePremiumFeatureAppIcons: + return UnmarshalPremiumFeatureAppIcons(data) + + case TypePremiumFeatureRealTimeChatTranslation: + return UnmarshalPremiumFeatureRealTimeChatTranslation(data) + + case TypePremiumFeatureUpgradedStories: + return UnmarshalPremiumFeatureUpgradedStories(data) + + case TypePremiumFeatureChatBoost: + return UnmarshalPremiumFeatureChatBoost(data) + + case TypePremiumFeatureAccentColor: + return UnmarshalPremiumFeatureAccentColor(data) + + case TypePremiumStoryFeaturePriorityOrder: + return UnmarshalPremiumStoryFeaturePriorityOrder(data) + + case TypePremiumStoryFeatureStealthMode: + return UnmarshalPremiumStoryFeatureStealthMode(data) + + case TypePremiumStoryFeaturePermanentViewsHistory: + return UnmarshalPremiumStoryFeaturePermanentViewsHistory(data) + + case TypePremiumStoryFeatureCustomExpirationDuration: + return UnmarshalPremiumStoryFeatureCustomExpirationDuration(data) + + case TypePremiumStoryFeatureSaveStories: + return UnmarshalPremiumStoryFeatureSaveStories(data) + + case TypePremiumStoryFeatureLinksAndFormatting: + return UnmarshalPremiumStoryFeatureLinksAndFormatting(data) + + case TypePremiumLimit: + return UnmarshalPremiumLimit(data) + + case TypePremiumFeatures: + return UnmarshalPremiumFeatures(data) + + case TypePremiumSourceLimitExceeded: + return UnmarshalPremiumSourceLimitExceeded(data) + + case TypePremiumSourceFeature: + return UnmarshalPremiumSourceFeature(data) + + case TypePremiumSourceStoryFeature: + return UnmarshalPremiumSourceStoryFeature(data) + + case TypePremiumSourceLink: + return UnmarshalPremiumSourceLink(data) + + case TypePremiumSourceSettings: + return UnmarshalPremiumSourceSettings(data) + + case TypePremiumFeaturePromotionAnimation: + return UnmarshalPremiumFeaturePromotionAnimation(data) + + case TypePremiumState: + return UnmarshalPremiumState(data) + + case TypeStorePaymentPurposePremiumSubscription: + return UnmarshalStorePaymentPurposePremiumSubscription(data) + + case TypeStorePaymentPurposeGiftedPremium: + return UnmarshalStorePaymentPurposeGiftedPremium(data) + + case TypeStorePaymentPurposePremiumGiftCodes: + return UnmarshalStorePaymentPurposePremiumGiftCodes(data) + + case TypeStorePaymentPurposePremiumGiveaway: + return UnmarshalStorePaymentPurposePremiumGiveaway(data) + + case TypeTelegramPaymentPurposePremiumGiftCodes: + return UnmarshalTelegramPaymentPurposePremiumGiftCodes(data) + + case TypeTelegramPaymentPurposePremiumGiveaway: + return UnmarshalTelegramPaymentPurposePremiumGiveaway(data) + case TypeDeviceTokenFirebaseCloudMessaging: return UnmarshalDeviceTokenFirebaseCloudMessaging(data) @@ -14093,6 +19893,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeDeviceTokenTizenPush: return UnmarshalDeviceTokenTizenPush(data) + case TypeDeviceTokenHuaweiPush: + return UnmarshalDeviceTokenHuaweiPush(data) + case TypePushReceiverId: return UnmarshalPushReceiverId(data) @@ -14114,18 +19917,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBackgroundTypeFill: return UnmarshalBackgroundTypeFill(data) - case TypeBackground: - return UnmarshalBackground(data) - - case TypeBackgrounds: - return UnmarshalBackgrounds(data) - case TypeInputBackgroundLocal: return UnmarshalInputBackgroundLocal(data) case TypeInputBackgroundRemote: return UnmarshalInputBackgroundRemote(data) + case TypeInputBackgroundPrevious: + return UnmarshalInputBackgroundPrevious(data) + case TypeThemeSettings: return UnmarshalThemeSettings(data) @@ -14135,6 +19935,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeHashtags: return UnmarshalHashtags(data) + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(data) + + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(data) + + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(data) + + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data) + + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(data) + + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(data) + case TypeCanTransferOwnershipResultOk: return UnmarshalCanTransferOwnershipResultOk(data) @@ -14156,8 +19974,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCheckChatUsernameResultUsernameOccupied: return UnmarshalCheckChatUsernameResultUsernameOccupied(data) - case TypeCheckChatUsernameResultPublicChatsTooMuch: - return UnmarshalCheckChatUsernameResultPublicChatsTooMuch(data) + case TypeCheckChatUsernameResultUsernamePurchasable: + return UnmarshalCheckChatUsernameResultUsernamePurchasable(data) + + case TypeCheckChatUsernameResultPublicChatsTooMany: + return UnmarshalCheckChatUsernameResultPublicChatsTooMany(data) case TypeCheckChatUsernameResultPublicGroupsUnavailable: return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data) @@ -14225,12 +20046,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentPoll: return UnmarshalPushMessageContentPoll(data) + case TypePushMessageContentPremiumGiftCode: + return UnmarshalPushMessageContentPremiumGiftCode(data) + + case TypePushMessageContentPremiumGiveaway: + return UnmarshalPushMessageContentPremiumGiveaway(data) + case TypePushMessageContentScreenshotTaken: return UnmarshalPushMessageContentScreenshotTaken(data) case TypePushMessageContentSticker: return UnmarshalPushMessageContentSticker(data) + case TypePushMessageContentStory: + return UnmarshalPushMessageContentStory(data) + case TypePushMessageContentText: return UnmarshalPushMessageContentText(data) @@ -14255,6 +20085,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentChatChangeTitle: return UnmarshalPushMessageContentChatChangeTitle(data) + case TypePushMessageContentChatSetBackground: + return UnmarshalPushMessageContentChatSetBackground(data) + case TypePushMessageContentChatSetTheme: return UnmarshalPushMessageContentChatSetTheme(data) @@ -14267,6 +20100,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentChatJoinByRequest: return UnmarshalPushMessageContentChatJoinByRequest(data) + case TypePushMessageContentRecurringPayment: + return UnmarshalPushMessageContentRecurringPayment(data) + + case TypePushMessageContentSuggestProfilePhoto: + return UnmarshalPushMessageContentSuggestProfilePhoto(data) + case TypePushMessageContentMessageForwards: return UnmarshalPushMessageContentMessageForwards(data) @@ -14297,6 +20136,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeNotificationGroupTypeCalls: return UnmarshalNotificationGroupTypeCalls(data) + case TypeNotificationSound: + return UnmarshalNotificationSound(data) + + case TypeNotificationSounds: + return UnmarshalNotificationSounds(data) + case TypeNotification: return UnmarshalNotification(data) @@ -14336,6 +20181,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeJsonValueObject: return UnmarshalJsonValueObject(data) + case TypeStoryPrivacySettingsEveryone: + return UnmarshalStoryPrivacySettingsEveryone(data) + + case TypeStoryPrivacySettingsContacts: + return UnmarshalStoryPrivacySettingsContacts(data) + + case TypeStoryPrivacySettingsCloseFriends: + return UnmarshalStoryPrivacySettingsCloseFriends(data) + + case TypeStoryPrivacySettingsSelectedUsers: + return UnmarshalStoryPrivacySettingsSelectedUsers(data) + case TypeUserPrivacySettingRuleAllowAll: return UnmarshalUserPrivacySettingRuleAllowAll(data) @@ -14375,6 +20232,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingShowPhoneNumber: return UnmarshalUserPrivacySettingShowPhoneNumber(data) + case TypeUserPrivacySettingShowBio: + return UnmarshalUserPrivacySettingShowBio(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -14387,54 +20247,135 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingAllowFindingByPhoneNumber: return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) + case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages: + return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data) + case TypeAccountTtl: return UnmarshalAccountTtl(data) + case TypeMessageAutoDeleteTime: + return UnmarshalMessageAutoDeleteTime(data) + + case TypeSessionTypeAndroid: + return UnmarshalSessionTypeAndroid(data) + + case TypeSessionTypeApple: + return UnmarshalSessionTypeApple(data) + + case TypeSessionTypeBrave: + return UnmarshalSessionTypeBrave(data) + + case TypeSessionTypeChrome: + return UnmarshalSessionTypeChrome(data) + + case TypeSessionTypeEdge: + return UnmarshalSessionTypeEdge(data) + + case TypeSessionTypeFirefox: + return UnmarshalSessionTypeFirefox(data) + + case TypeSessionTypeIpad: + return UnmarshalSessionTypeIpad(data) + + case TypeSessionTypeIphone: + return UnmarshalSessionTypeIphone(data) + + case TypeSessionTypeLinux: + return UnmarshalSessionTypeLinux(data) + + case TypeSessionTypeMac: + return UnmarshalSessionTypeMac(data) + + case TypeSessionTypeOpera: + return UnmarshalSessionTypeOpera(data) + + case TypeSessionTypeSafari: + return UnmarshalSessionTypeSafari(data) + + case TypeSessionTypeUbuntu: + return UnmarshalSessionTypeUbuntu(data) + + case TypeSessionTypeUnknown: + return UnmarshalSessionTypeUnknown(data) + + case TypeSessionTypeVivaldi: + return UnmarshalSessionTypeVivaldi(data) + + case TypeSessionTypeWindows: + return UnmarshalSessionTypeWindows(data) + + case TypeSessionTypeXbox: + return UnmarshalSessionTypeXbox(data) + case TypeSession: return UnmarshalSession(data) case TypeSessions: return UnmarshalSessions(data) + case TypeUnconfirmedSession: + return UnmarshalUnconfirmedSession(data) + case TypeConnectedWebsite: return UnmarshalConnectedWebsite(data) case TypeConnectedWebsites: return UnmarshalConnectedWebsites(data) - case TypeChatReportReasonSpam: - return UnmarshalChatReportReasonSpam(data) + case TypeReportReasonSpam: + return UnmarshalReportReasonSpam(data) - case TypeChatReportReasonViolence: - return UnmarshalChatReportReasonViolence(data) + case TypeReportReasonViolence: + return UnmarshalReportReasonViolence(data) - case TypeChatReportReasonPornography: - return UnmarshalChatReportReasonPornography(data) + case TypeReportReasonPornography: + return UnmarshalReportReasonPornography(data) - case TypeChatReportReasonChildAbuse: - return UnmarshalChatReportReasonChildAbuse(data) + case TypeReportReasonChildAbuse: + return UnmarshalReportReasonChildAbuse(data) - case TypeChatReportReasonCopyright: - return UnmarshalChatReportReasonCopyright(data) + case TypeReportReasonCopyright: + return UnmarshalReportReasonCopyright(data) - case TypeChatReportReasonUnrelatedLocation: - return UnmarshalChatReportReasonUnrelatedLocation(data) + case TypeReportReasonUnrelatedLocation: + return UnmarshalReportReasonUnrelatedLocation(data) - case TypeChatReportReasonFake: - return UnmarshalChatReportReasonFake(data) + case TypeReportReasonFake: + return UnmarshalReportReasonFake(data) - case TypeChatReportReasonCustom: - return UnmarshalChatReportReasonCustom(data) + case TypeReportReasonIllegalDrugs: + return UnmarshalReportReasonIllegalDrugs(data) + + case TypeReportReasonPersonalDetails: + return UnmarshalReportReasonPersonalDetails(data) + + case TypeReportReasonCustom: + return UnmarshalReportReasonCustom(data) + + case TypeTargetChatCurrent: + return UnmarshalTargetChatCurrent(data) + + case TypeTargetChatChosen: + return UnmarshalTargetChatChosen(data) + + case TypeTargetChatInternalLink: + return UnmarshalTargetChatInternalLink(data) case TypeInternalLinkTypeActiveSessions: return UnmarshalInternalLinkTypeActiveSessions(data) + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(data) + case TypeInternalLinkTypeAuthenticationCode: return UnmarshalInternalLinkTypeAuthenticationCode(data) case TypeInternalLinkTypeBackground: return UnmarshalInternalLinkTypeBackground(data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(data) + case TypeInternalLinkTypeBotStart: return UnmarshalInternalLinkTypeBotStart(data) @@ -14444,18 +20385,39 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeChatBoost: + return UnmarshalInternalLinkTypeChatBoost(data) + + case TypeInternalLinkTypeChatFolderInvite: + return UnmarshalInternalLinkTypeChatFolderInvite(data) + + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(data) + case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) - case TypeInternalLinkTypeFilterSettings: - return UnmarshalInternalLinkTypeFilterSettings(data) + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeInstantView: + return UnmarshalInternalLinkTypeInstantView(data) + + case TypeInternalLinkTypeInvoice: + return UnmarshalInternalLinkTypeInvoice(data) + case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(data) @@ -14468,6 +20430,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(data) + + case TypeInternalLinkTypePremiumGiftCode: + return UnmarshalInternalLinkTypePremiumGiftCode(data) + + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -14477,12 +20448,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeQrCodeAuthentication: return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + case TypeInternalLinkTypeRestorePurchases: + return UnmarshalInternalLinkTypeRestorePurchases(data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) + case TypeInternalLinkTypeSideMenuBot: + return UnmarshalInternalLinkTypeSideMenuBot(data) + case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) + case TypeInternalLinkTypeStory: + return UnmarshalInternalLinkTypeStory(data) + case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) @@ -14495,15 +20475,36 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeUnsupportedProxy: return UnmarshalInternalLinkTypeUnsupportedProxy(data) + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(data) + + case TypeInternalLinkTypeUserToken: + return UnmarshalInternalLinkTypeUserToken(data) + case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(data) + case TypeInternalLinkTypeWebApp: + return UnmarshalInternalLinkTypeWebApp(data) + case TypeMessageLink: return UnmarshalMessageLink(data) case TypeMessageLinkInfo: return UnmarshalMessageLinkInfo(data) + case TypeChatBoostLink: + return UnmarshalChatBoostLink(data) + + case TypeChatBoostLinkInfo: + return UnmarshalChatBoostLinkInfo(data) + + case TypeBlockListMain: + return UnmarshalBlockListMain(data) + + case TypeBlockListStories: + return UnmarshalBlockListStories(data) + case TypeFilePart: return UnmarshalFilePart(data) @@ -14519,9 +20520,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFileTypeDocument: return UnmarshalFileTypeDocument(data) + case TypeFileTypeNotificationSound: + return UnmarshalFileTypeNotificationSound(data) + case TypeFileTypePhoto: return UnmarshalFileTypePhoto(data) + case TypeFileTypePhotoStory: + return UnmarshalFileTypePhotoStory(data) + case TypeFileTypeProfilePhoto: return UnmarshalFileTypeProfilePhoto(data) @@ -14549,6 +20556,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFileTypeVideoNote: return UnmarshalFileTypeVideoNote(data) + case TypeFileTypeVideoStory: + return UnmarshalFileTypeVideoStory(data) + case TypeFileTypeVoiceNote: return UnmarshalFileTypeVoiceNote(data) @@ -14600,6 +20610,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAutoDownloadSettingsPresets: return UnmarshalAutoDownloadSettingsPresets(data) + case TypeAutosaveSettingsScopePrivateChats: + return UnmarshalAutosaveSettingsScopePrivateChats(data) + + case TypeAutosaveSettingsScopeGroupChats: + return UnmarshalAutosaveSettingsScopeGroupChats(data) + + case TypeAutosaveSettingsScopeChannelChats: + return UnmarshalAutosaveSettingsScopeChannelChats(data) + + case TypeAutosaveSettingsScopeChat: + return UnmarshalAutosaveSettingsScopeChat(data) + + case TypeScopeAutosaveSettings: + return UnmarshalScopeAutosaveSettings(data) + + case TypeAutosaveSettingsException: + return UnmarshalAutosaveSettingsException(data) + + case TypeAutosaveSettings: + return UnmarshalAutosaveSettings(data) + case TypeConnectionStateWaitingForNetwork: return UnmarshalConnectionStateWaitingForNetwork(data) @@ -14636,6 +20667,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTopChatCategoryForwardChats: return UnmarshalTopChatCategoryForwardChats(data) + case TypeFoundPosition: + return UnmarshalFoundPosition(data) + + case TypeFoundPositions: + return UnmarshalFoundPositions(data) + case TypeTMeUrlTypeUser: return UnmarshalTMeUrlTypeUser(data) @@ -14672,6 +20709,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedActionSetPassword: return UnmarshalSuggestedActionSetPassword(data) + case TypeSuggestedActionUpgradePremium: + return UnmarshalSuggestedActionUpgradePremium(data) + + case TypeSuggestedActionRestorePremium: + return UnmarshalSuggestedActionRestorePremium(data) + + case TypeSuggestedActionSubscribeToAnnualPremium: + return UnmarshalSuggestedActionSubscribeToAnnualPremium(data) + case TypeCount: return UnmarshalCount(data) @@ -14681,6 +20727,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSeconds: return UnmarshalSeconds(data) + case TypeFileDownloadedPrefixSize: + return UnmarshalFileDownloadedPrefixSize(data) + case TypeDeepLinkInfo: return UnmarshalDeepLinkInfo(data) @@ -14705,11 +20754,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProxies: return UnmarshalProxies(data) - case TypeInputStickerStatic: - return UnmarshalInputStickerStatic(data) - - case TypeInputStickerAnimated: - return UnmarshalInputStickerAnimated(data) + case TypeInputSticker: + return UnmarshalInputSticker(data) case TypeDateRange: return UnmarshalDateRange(data) @@ -14810,6 +20856,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateMessageMentionRead: return UnmarshalUpdateMessageMentionRead(data) + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(data) + case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(data) @@ -14822,6 +20871,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatPhoto: return UnmarshalUpdateChatPhoto(data) + case TypeUpdateChatAccentColor: + return UnmarshalUpdateChatAccentColor(data) + + case TypeUpdateChatBackgroundCustomEmoji: + return UnmarshalUpdateChatBackgroundCustomEmoji(data) + case TypeUpdateChatPermissions: return UnmarshalUpdateChatPermissions(data) @@ -14840,14 +20895,17 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatActionBar: return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(data) + case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(data) case TypeUpdateChatMessageSender: return UnmarshalUpdateChatMessageSender(data) - case TypeUpdateChatMessageTtl: - return UnmarshalUpdateChatMessageTtl(data) + case TypeUpdateChatMessageAutoDeleteTime: + return UnmarshalUpdateChatMessageAutoDeleteTime(data) case TypeUpdateChatNotificationSettings: return UnmarshalUpdateChatNotificationSettings(data) @@ -14858,12 +20916,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(data) + case TypeUpdateChatBackground: + return UnmarshalUpdateChatBackground(data) + case TypeUpdateChatTheme: return UnmarshalUpdateChatTheme(data) case TypeUpdateChatUnreadMentionCount: return UnmarshalUpdateChatUnreadMentionCount(data) + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(data) + case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(data) @@ -14873,21 +20937,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatHasProtectedContent: return UnmarshalUpdateChatHasProtectedContent(data) - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(data) - - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(data) + case TypeUpdateChatIsTranslatable: + return UnmarshalUpdateChatIsTranslatable(data) case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(data) - case TypeUpdateChatFilters: - return UnmarshalUpdateChatFilters(data) + case TypeUpdateChatBlockList: + return UnmarshalUpdateChatBlockList(data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(data) + + case TypeUpdateChatFolders: + return UnmarshalUpdateChatFolders(data) case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) + case TypeUpdateForumTopicInfo: + return UnmarshalUpdateForumTopicInfo(data) + case TypeUpdateScopeNotificationSettings: return UnmarshalUpdateScopeNotificationSettings(data) @@ -14945,6 +21015,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateFileGenerationStop: return UnmarshalUpdateFileGenerationStop(data) + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(data) + + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(data) + + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(data) + + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(data) + case TypeUpdateCall: return UnmarshalUpdateCall(data) @@ -14966,6 +21048,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateUnreadChatCount: return UnmarshalUpdateUnreadChatCount(data) + case TypeUpdateStory: + return UnmarshalUpdateStory(data) + + case TypeUpdateStoryDeleted: + return UnmarshalUpdateStoryDeleted(data) + + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(data) + + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(data) + + case TypeUpdateChatActiveStories: + return UnmarshalUpdateChatActiveStories(data) + + case TypeUpdateStoryListChatCount: + return UnmarshalUpdateStoryListChatCount(data) + + case TypeUpdateStoryStealthMode: + return UnmarshalUpdateStoryStealthMode(data) + case TypeUpdateOption: return UnmarshalUpdateOption(data) @@ -14987,12 +21090,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSavedAnimations: return UnmarshalUpdateSavedAnimations(data) + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(data) + case TypeUpdateSelectedBackground: return UnmarshalUpdateSelectedBackground(data) case TypeUpdateChatThemes: return UnmarshalUpdateChatThemes(data) + case TypeUpdateAccentColors: + return UnmarshalUpdateAccentColors(data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(data) @@ -15005,6 +21114,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(data) + case TypeUpdateUnconfirmedSession: + return UnmarshalUpdateUnconfirmedSession(data) + + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(data) + + case TypeUpdateActiveEmojiReactions: + return UnmarshalUpdateActiveEmojiReactions(data) + + case TypeUpdateDefaultReactionType: + return UnmarshalUpdateDefaultReactionType(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) @@ -15017,6 +21141,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(data) + case TypeUpdateAddChatMembersPrivacyForbidden: + return UnmarshalUpdateAddChatMembersPrivacyForbidden(data) + + case TypeUpdateAutosaveSettings: + return UnmarshalUpdateAutosaveSettings(data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(data) @@ -15053,6 +21183,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateNewChatJoinRequest: return UnmarshalUpdateNewChatJoinRequest(data) + case TypeUpdateChatBoost: + return UnmarshalUpdateChatBoost(data) + case TypeUpdates: return UnmarshalUpdates(data) @@ -15071,6 +21204,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLogTags: return UnmarshalLogTags(data) + case TypeUserSupportInfo: + return UnmarshalUserSupportInfo(data) + case TypeTestInt: return UnmarshalTestInt(data) diff --git a/data/td_api.json b/data/td_api.json index fd374de..161a708 100755 --- a/data/td_api.json +++ b/data/td_api.json @@ -77,88 +77,6 @@ "class": "Ok", "properties": [] }, - { - "name": "tdlibParameters", - "description": "Contains parameters for TDLib initialization", - "class": "TdlibParameters", - "properties": [ - { - "name": "use_test_dc", - "type": "Bool", - "description": "If set to true, the Telegram test environment will be used instead of the production environment" - }, - { - "name": "database_directory", - "type": "string", - "description": "The path to the directory for the persistent database; if empty, the current working directory will be used" - }, - { - "name": "files_directory", - "type": "string", - "description": "The path to the directory for storing files; if empty, database_directory will be used" - }, - { - "name": "use_file_database", - "type": "Bool", - "description": "If set to true, information about downloaded and uploaded files will be saved between application restarts" - }, - { - "name": "use_chat_info_database", - "type": "Bool", - "description": "If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database" - }, - { - "name": "use_message_database", - "type": "Bool", - "description": "If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database" - }, - { - "name": "use_secret_chats", - "type": "Bool", - "description": "If set to true, support for secret chats will be enabled" - }, - { - "name": "api_id", - "type": "int32", - "description": "Application identifier for Telegram API access, which can be obtained at https://my.telegram.org" - }, - { - "name": "api_hash", - "type": "string", - "description": "Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org" - }, - { - "name": "system_language_code", - "type": "string", - "description": "IETF language tag of the user's operating system language; must be non-empty" - }, - { - "name": "device_model", - "type": "string", - "description": "Model of the device the application is being run on; must be non-empty" - }, - { - "name": "system_version", - "type": "string", - "description": "Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib" - }, - { - "name": "application_version", - "type": "string", - "description": "Application version; must be non-empty" - }, - { - "name": "enable_storage_optimizer", - "type": "Bool", - "description": "If set to true, old files will automatically be deleted" - }, - { - "name": "ignore_file_names", - "type": "Bool", - "description": "If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name" - } - ] - }, { "name": "authenticationCodeTypeTelegramMessage", "description": "An authentication code is delivered via a private Telegram message, which can be viewed from another active session", @@ -173,7 +91,7 @@ }, { "name": "authenticationCodeTypeSms", - "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", "class": "AuthenticationCodeType", "properties": [ { @@ -224,6 +142,62 @@ } ] }, + { + "name": "authenticationCodeTypeFragment", + "description": "An authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT", + "class": "AuthenticationCodeType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "URL to open to receive the code" + }, + { + "name": "length", + "type": "int32", + "description": "Length of the code" + } + ] + }, + { + "name": "authenticationCodeTypeFirebaseAndroid", + "description": "An authentication code is delivered via Firebase Authentication to the official Android application", + "class": "AuthenticationCodeType", + "properties": [ + { + "name": "nonce", + "type": "bytes", + "description": "Nonce to pass to the SafetyNet Attestation API" + }, + { + "name": "length", + "type": "int32", + "description": "Length of the code" + } + ] + }, + { + "name": "authenticationCodeTypeFirebaseIos", + "description": "An authentication code is delivered via Firebase Authentication to the official iOS application", + "class": "AuthenticationCodeType", + "properties": [ + { + "name": "receipt", + "type": "string", + "description": "Receipt of successful application token validation to compare with receipt from push notification" + }, + { + "name": "push_timeout", + "type": "int32", + "description": "Time after the next authentication method is supposed to be used if verification push notification isn't received, in seconds" + }, + { + "name": "length", + "type": "int32", + "description": "Length of the code" + } + ] + }, { "name": "authenticationCodeInfo", "description": "Information about the authentication code that was sent", @@ -268,6 +242,66 @@ } ] }, + { + "name": "emailAddressAuthenticationCode", + "description": "An authentication code delivered to a user's email address", + "class": "EmailAddressAuthentication", + "properties": [ + { + "name": "code", + "type": "string", + "description": "The code" + } + ] + }, + { + "name": "emailAddressAuthenticationAppleId", + "description": "An authentication token received through Apple ID", + "class": "EmailAddressAuthentication", + "properties": [ + { + "name": "token", + "type": "string", + "description": "The token" + } + ] + }, + { + "name": "emailAddressAuthenticationGoogleId", + "description": "An authentication token received through Google ID", + "class": "EmailAddressAuthentication", + "properties": [ + { + "name": "token", + "type": "string", + "description": "The token" + } + ] + }, + { + "name": "emailAddressResetStateAvailable", + "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", + "class": "EmailAddressResetState", + "properties": [ + { + "name": "wait_period", + "type": "int32", + "description": "Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium" + } + ] + }, + { + "name": "emailAddressResetStatePending", + "description": "Email address reset has already been requested. Call resetAuthenticationEmailAddress to check whether immediate reset is possible", + "class": "EmailAddressResetState", + "properties": [ + { + "name": "reset_in", + "type": "int32", + "description": "Left time before the email address will be reset, in seconds. updateAuthorizationState is not sent when this field changes" + } + ] + }, { "name": "textEntity", "description": "Represents a part of the text that needs to be formatted in some unusual way", @@ -315,7 +349,7 @@ { "name": "entities", "type": "vector\u003ctextEntity\u003e", - "description": "Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other" + "description": "Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other" } ] }, @@ -332,7 +366,7 @@ { "name": "min_user_age", "type": "int32", - "description": "The minimum age of a user to be able to accept the terms; 0 if any" + "description": "The minimum age of a user to be able to accept the terms; 0 if age isn't restricted" }, { "name": "show_popup", @@ -343,31 +377,63 @@ }, { "name": "authorizationStateWaitTdlibParameters", - "description": "TDLib needs TdlibParameters for initialization", + "description": "Initialization parameters are needed. Call setTdlibParameters to provide them", "class": "AuthorizationState", "properties": [] }, { - "name": "authorizationStateWaitEncryptionKey", - "description": "TDLib needs an encryption key to decrypt the local database", + "name": "authorizationStateWaitPhoneNumber", + "description": "TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options", + "class": "AuthorizationState", + "properties": [] + }, + { + "name": "authorizationStateWaitEmailAddress", + "description": "TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed", "class": "AuthorizationState", "properties": [ { - "name": "is_encrypted", + "name": "allow_apple_id", "type": "Bool", - "description": "True, if the database is currently encrypted" + "description": "True, if authorization through Apple ID is allowed" + }, + { + "name": "allow_google_id", + "type": "Bool", + "description": "True, if authorization through Google ID is allowed" } ] }, { - "name": "authorizationStateWaitPhoneNumber", - "description": "TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options", + "name": "authorizationStateWaitEmailCode", + "description": "TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code", "class": "AuthorizationState", - "properties": [] + "properties": [ + { + "name": "allow_apple_id", + "type": "Bool", + "description": "True, if authorization through Apple ID is allowed" + }, + { + "name": "allow_google_id", + "type": "Bool", + "description": "True, if authorization through Google ID is allowed" + }, + { + "name": "code_info", + "type": "emailAddressAuthenticationCodeInfo", + "description": "Information about the sent authentication code" + }, + { + "name": "email_address_reset_state", + "type": "EmailAddressResetState", + "description": "Reset state of the email address; may be null if the email address can't be reset" + } + ] }, { "name": "authorizationStateWaitCode", - "description": "TDLib needs the user's authentication code to authorize", + "description": "TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code", "class": "AuthorizationState", "properties": [ { @@ -391,7 +457,7 @@ }, { "name": "authorizationStateWaitRegistration", - "description": "The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration", + "description": "The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data", "class": "AuthorizationState", "properties": [ { @@ -403,7 +469,7 @@ }, { "name": "authorizationStateWaitPassword", - "description": "The user has been authorized, but needs to enter a password to start using the application", + "description": "The user has been authorized, but needs to enter a 2-step verification password to start using the application. Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week", "class": "AuthorizationState", "properties": [ { @@ -416,6 +482,11 @@ "type": "Bool", "description": "True, if a recovery email address has been set up" }, + { + "name": "has_passport_data", + "type": "Bool", + "description": "True, if some Telegram Passport elements were saved" + }, { "name": "recovery_email_address_pattern", "type": "string", @@ -425,7 +496,7 @@ }, { "name": "authorizationStateReady", - "description": "The user has been successfully authorized. TDLib is now ready to answer queries", + "description": "The user has been successfully authorized. TDLib is now ready to answer general requests", "class": "AuthorizationState", "properties": [] }, @@ -477,10 +548,15 @@ "type": "emailAddressAuthenticationCodeInfo", "description": "Information about the recovery email address to which the confirmation email was sent; may be null" }, + { + "name": "login_email_address_pattern", + "type": "string", + "description": "Pattern of the email address set up for logging in" + }, { "name": "pending_reset_date", "type": "int32", - "description": "If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword" + "description": "If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword" } ] }, @@ -545,17 +621,17 @@ }, { "name": "download_offset", - "type": "int32", + "type": "int53", "description": "Download will be started from this offset. downloaded_prefix_size is calculated from this offset" }, { "name": "downloaded_prefix_size", - "type": "int32", + "type": "int53", "description": "If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes" }, { "name": "downloaded_size", - "type": "int32", + "type": "int53", "description": "Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage" } ] @@ -568,7 +644,7 @@ { "name": "id", "type": "string", - "description": "Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and \"#url#\" as the conversion string. Application must generate the file by downloading it to the specified location" + "description": "Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the identifier starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and \"#url#\" as the conversion string. Application must generate the file by downloading it to the specified location" }, { "name": "unique_id", @@ -587,7 +663,7 @@ }, { "name": "uploaded_size", - "type": "int32", + "type": "int53", "description": "Size of the remote available part of the file, in bytes; 0 if unknown" } ] @@ -604,12 +680,12 @@ }, { "name": "size", - "type": "int32", + "type": "int53", "description": "File size, in bytes; 0 if unknown" }, { "name": "expected_size", - "type": "int32", + "type": "int53", "description": "Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress" }, { @@ -626,7 +702,7 @@ }, { "name": "inputFileId", - "description": "A file defined by its unique ID", + "description": "A file defined by its unique identifier", "class": "InputFile", "properties": [ { @@ -638,7 +714,7 @@ }, { "name": "inputFileRemote", - "description": "A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application", + "description": "A file defined by its remote identifier. The remote identifier is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application", "class": "InputFile", "properties": [ { @@ -677,7 +753,7 @@ }, { "name": "expected_size", - "type": "int32", + "type": "int53", "description": "Expected size of the generated file, in bytes; 0 if unknown" } ] @@ -742,27 +818,9 @@ "class": "ThumbnailFormat", "properties": [] }, - { - "name": "thumbnailFormatPng", - "description": "The thumbnail is in PNG format. It will be used only for background patterns", - "class": "ThumbnailFormat", - "properties": [] - }, - { - "name": "thumbnailFormatWebp", - "description": "The thumbnail is in WEBP format. It will be used only for some stickers", - "class": "ThumbnailFormat", - "properties": [] - }, { "name": "thumbnailFormatGif", - "description": "The thumbnail is in static GIF format. It will be used only for some bot inline results", - "class": "ThumbnailFormat", - "properties": [] - }, - { - "name": "thumbnailFormatTgs", - "description": "The thumbnail is in TGS format. It will be used only for animated sticker sets", + "description": "The thumbnail is in static GIF format. It will be used only for some bot inline query results", "class": "ThumbnailFormat", "properties": [] }, @@ -772,6 +830,30 @@ "class": "ThumbnailFormat", "properties": [] }, + { + "name": "thumbnailFormatPng", + "description": "The thumbnail is in PNG format. It will be used only for background patterns", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatTgs", + "description": "The thumbnail is in TGS format. It will be used only for TGS sticker sets", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatWebm", + "description": "The thumbnail is in WEBM format. It will be used only for WEBM sticker sets", + "class": "ThumbnailFormat", + "properties": [] + }, + { + "name": "thumbnailFormatWebp", + "description": "The thumbnail is in WEBP format. It will be used only for some stickers", + "class": "ThumbnailFormat", + "properties": [] + }, { "name": "thumbnail", "description": "Represents a thumbnail", @@ -850,6 +932,83 @@ } ] }, + { + "name": "stickerFormatWebp", + "description": "The sticker is an image in WEBP format", + "class": "StickerFormat", + "properties": [] + }, + { + "name": "stickerFormatTgs", + "description": "The sticker is an animation in TGS format", + "class": "StickerFormat", + "properties": [] + }, + { + "name": "stickerFormatWebm", + "description": "The sticker is a video in WEBM format", + "class": "StickerFormat", + "properties": [] + }, + { + "name": "stickerTypeRegular", + "description": "The sticker is a regular sticker", + "class": "StickerType", + "properties": [] + }, + { + "name": "stickerTypeMask", + "description": "The sticker is a mask in WEBP format to be placed on photos or videos", + "class": "StickerType", + "properties": [] + }, + { + "name": "stickerTypeCustomEmoji", + "description": "The sticker is a custom emoji to be used inside message text and caption", + "class": "StickerType", + "properties": [] + }, + { + "name": "stickerFullTypeRegular", + "description": "The sticker is a regular sticker", + "class": "StickerFullType", + "properties": [ + { + "name": "premium_animation", + "type": "file", + "description": "Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker" + } + ] + }, + { + "name": "stickerFullTypeMask", + "description": "The sticker is a mask in WEBP format to be placed on photos or videos", + "class": "StickerFullType", + "properties": [ + { + "name": "mask_position", + "type": "maskPosition", + "description": "Position where the mask is placed; may be null" + } + ] + }, + { + "name": "stickerFullTypeCustomEmoji", + "description": "The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji", + "class": "StickerFullType", + "properties": [ + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Identifier of the custom emoji" + }, + { + "name": "needs_repainting", + "type": "Bool", + "description": "True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places" + } + ] + }, { "name": "closedVectorPath", "description": "Represents a closed vector path. The path begins at the end point of the last command", @@ -1013,7 +1172,12 @@ { "name": "album_cover_thumbnail", "type": "thumbnail", - "description": "The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null" + "description": "The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null" + }, + { + "name": "external_album_covers", + "type": "vector\u003cthumbnail\u003e", + "description": "Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate" }, { "name": "audio", @@ -1081,10 +1245,15 @@ "description": "Describes a sticker", "class": "Sticker", "properties": [ + { + "name": "id", + "type": "int64", + "description": "Unique sticker identifier within the set; 0 if none" + }, { "name": "set_id", "type": "int64", - "description": "The identifier of the sticker set to which the sticker belongs; 0 if none" + "description": "Identifier of the sticker set to which the sticker belongs; 0 if none" }, { "name": "width", @@ -1102,19 +1271,14 @@ "description": "Emoji corresponding to the sticker" }, { - "name": "is_animated", - "type": "Bool", - "description": "True, if the sticker is an animated sticker in TGS format" + "name": "format", + "type": "StickerFormat", + "description": "Sticker format" }, { - "name": "is_mask", - "type": "Bool", - "description": "True, if the sticker is a mask" - }, - { - "name": "mask_position", - "type": "maskPosition", - "description": "Position where the mask is placed; may be null" + "name": "full_type", + "type": "StickerFullType", + "description": "Sticker's full type" }, { "name": "outline", @@ -1200,6 +1364,11 @@ "type": "int32", "description": "Duration of the video, in seconds; as defined by the sender" }, + { + "name": "waveform", + "type": "bytes", + "description": "A waveform representation of the video note's audio in 5-bit format; may be empty if unknown" + }, { "name": "length", "type": "int32", @@ -1215,6 +1384,11 @@ "type": "thumbnail", "description": "Video thumbnail in JPEG format; as defined by the sender; may be null" }, + { + "name": "speech_recognition_result", + "type": "SpeechRecognitionResult", + "description": "Result of speech recognition in the video note; may be null" + }, { "name": "video", "type": "file", @@ -1242,6 +1416,11 @@ "type": "string", "description": "MIME type of the file; as defined by the sender" }, + { + "name": "speech_recognition_result", + "type": "SpeechRecognitionResult", + "description": "Result of speech recognition in the voice note; may be null" + }, { "name": "voice", "type": "file", @@ -1251,13 +1430,23 @@ }, { "name": "animatedEmoji", - "description": "Describes an animated representation of an emoji", + "description": "Describes an animated or custom representation of an emoji", "class": "AnimatedEmoji", "properties": [ { "name": "sticker", "type": "sticker", - "description": "Animated sticker for the emoji" + "description": "Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs" + }, + { + "name": "sticker_width", + "type": "int32", + "description": "Expected width of the sticker, which can be used if the sticker is null" + }, + { + "name": "sticker_height", + "type": "int32", + "description": "Expected height of the sticker, which can be used if the sticker is null" }, { "name": "fitzpatrick_type", @@ -1267,7 +1456,7 @@ { "name": "sound", "type": "file", - "description": "File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container" + "description": "File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container" } ] }, @@ -1299,7 +1488,7 @@ { "name": "user_id", "type": "int53", - "description": "Identifier of the user, if known; otherwise 0" + "description": "Identifier of the user, if known; 0 otherwise" } ] }, @@ -1364,18 +1553,18 @@ }, { "name": "game", - "description": "Describes a game", + "description": "Describes a game. Use getInternalLink with internalLinkTypeGame to share the game", "class": "Game", "properties": [ { "name": "id", "type": "int64", - "description": "Game ID" + "description": "Unique game identifier" }, { "name": "short_name", "type": "string", - "description": "Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name}" + "description": "Game short name" }, { "name": "title", @@ -1404,6 +1593,38 @@ } ] }, + { + "name": "webApp", + "description": "Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App", + "class": "WebApp", + "properties": [ + { + "name": "short_name", + "type": "string", + "description": "Web App short name" + }, + { + "name": "title", + "type": "string", + "description": "Web App title" + }, + { + "name": "description", + "type": "string", + "description": "Web App description" + }, + { + "name": "photo", + "type": "photo", + "description": "Web App photo" + }, + { + "name": "animation", + "type": "animation", + "description": "Web App animation; may be null" + } + ] + }, { "name": "poll", "description": "Describes a poll", @@ -1430,9 +1651,9 @@ "description": "Total number of voters, participating in the poll" }, { - "name": "recent_voter_user_ids", - "type": "vector\u003cint53\u003e", - "description": "User identifiers of recent voters, if the poll is non-anonymous" + "name": "recent_voter_ids", + "type": "vector\u003cMessageSender\u003e", + "description": "Identifiers of recent voters, if the poll is non-anonymous" }, { "name": "is_anonymous", @@ -1461,6 +1682,72 @@ } ] }, + { + "name": "background", + "description": "Describes a chat background", + "class": "Background", + "properties": [ + { + "name": "id", + "type": "int64", + "description": "Unique background identifier" + }, + { + "name": "is_default", + "type": "Bool", + "description": "True, if this is one of default backgrounds" + }, + { + "name": "is_dark", + "type": "Bool", + "description": "True, if the background is dark and is recommended to be used with dark theme" + }, + { + "name": "name", + "type": "string", + "description": "Unique background name" + }, + { + "name": "document", + "type": "document", + "description": "Document with the background; may be null. Null only for filled backgrounds" + }, + { + "name": "type", + "type": "BackgroundType", + "description": "Type of the background" + } + ] + }, + { + "name": "backgrounds", + "description": "Contains a list of backgrounds", + "class": "Backgrounds", + "properties": [ + { + "name": "backgrounds", + "type": "vector\u003cbackground\u003e", + "description": "A list of backgrounds" + } + ] + }, + { + "name": "chatBackground", + "description": "Describes a background set for a specific chat", + "class": "ChatBackground", + "properties": [ + { + "name": "background", + "type": "background", + "description": "The background" + }, + { + "name": "dark_theme_dimming", + "type": "int32", + "description": "Dimming of the background in dark themes, as a percentage; 0-100" + } + ] + }, { "name": "profilePhoto", "description": "Describes a user profile photo", @@ -1490,6 +1777,11 @@ "name": "has_animation", "type": "Bool", "description": "True, if the photo has animated variant" + }, + { + "name": "is_personal", + "type": "Bool", + "description": "True, if the photo is visible only for the current user" } ] }, @@ -1517,6 +1809,11 @@ "name": "has_animation", "type": "Bool", "description": "True, if the photo has animated variant" + }, + { + "name": "is_personal", + "type": "Bool", + "description": "True, if the photo is visible only for the current user" } ] }, @@ -1537,6 +1834,11 @@ "description": "A bot (see https://core.telegram.org/bots)", "class": "UserType", "properties": [ + { + "name": "can_be_edited", + "type": "Bool", + "description": "True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription" + }, { "name": "can_join_groups", "type": "Bool", @@ -1561,6 +1863,11 @@ "name": "need_location", "type": "Bool", "description": "True, if the location of the user is expected to be sent with every inline query to this bot" + }, + { + "name": "can_be_added_to_attachment_menu", + "type": "Bool", + "description": "True, if the bot can be added to attachment or side menu" } ] }, @@ -1604,6 +1911,23 @@ } ] }, + { + "name": "botMenuButton", + "description": "Describes a button to be shown instead of bot commands menu button", + "class": "BotMenuButton", + "properties": [ + { + "name": "text", + "type": "string", + "description": "Text of the button" + }, + { + "name": "url", + "type": "string", + "description": "URL to be passed to openWebApp" + } + ] + }, { "name": "chatLocation", "description": "Represents a location to which a chat is connected", @@ -1621,6 +1945,52 @@ } ] }, + { + "name": "chatPhotoStickerTypeRegularOrMask", + "description": "Information about the sticker, which was used to create the chat photo", + "class": "ChatPhotoStickerType", + "properties": [ + { + "name": "sticker_set_id", + "type": "int64", + "description": "Sticker set identifier" + }, + { + "name": "sticker_id", + "type": "int64", + "description": "Identifier of the sticker in the set" + } + ] + }, + { + "name": "chatPhotoStickerTypeCustomEmoji", + "description": "Information about the custom emoji, which was used to create the chat photo", + "class": "ChatPhotoStickerType", + "properties": [ + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Identifier of the custom emoji" + } + ] + }, + { + "name": "chatPhotoSticker", + "description": "Information about the sticker, which was used to create the chat photo. The sticker is shown at the center of the photo and occupies at most 67% of it", + "class": "ChatPhotoSticker", + "properties": [ + { + "name": "type", + "type": "ChatPhotoStickerType", + "description": "Type of the sticker" + }, + { + "name": "background_fill", + "type": "BackgroundFill", + "description": "The fill to be used as background for the sticker; rotation angle in backgroundFillGradient isn't supported" + } + ] + }, { "name": "animatedChatPhoto", "description": "Animated variant of a chat photo in MPEG4 format", @@ -1671,7 +2041,17 @@ { "name": "animation", "type": "animatedChatPhoto", - "description": "Animated variant of the photo in MPEG4 format; may be null" + "description": "A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null" + }, + { + "name": "small_animation", + "type": "animatedChatPhoto", + "description": "A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available" + }, + { + "name": "sticker", + "type": "chatPhotoSticker", + "description": "Sticker-based version of the chat photo; may be null" } ] }, @@ -1718,7 +2098,7 @@ }, { "name": "inputChatPhotoAnimation", - "description": "An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 800 and be at most 2MB in size", + "description": "An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 1280 and be at most 2MB in size", "class": "InputChatPhoto", "properties": [ { @@ -1733,6 +2113,517 @@ } ] }, + { + "name": "inputChatPhotoSticker", + "description": "A sticker on a custom background", + "class": "InputChatPhoto", + "properties": [ + { + "name": "sticker", + "type": "chatPhotoSticker", + "description": "Information about the sticker" + } + ] + }, + { + "name": "chatPermissions", + "description": "Describes actions that a user is allowed to take in a chat", + "class": "ChatPermissions", + "properties": [ + { + "name": "can_send_basic_messages", + "type": "Bool", + "description": "True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues" + }, + { + "name": "can_send_audios", + "type": "Bool", + "description": "True, if the user can send music files" + }, + { + "name": "can_send_documents", + "type": "Bool", + "description": "True, if the user can send documents" + }, + { + "name": "can_send_photos", + "type": "Bool", + "description": "True, if the user can send photos" + }, + { + "name": "can_send_videos", + "type": "Bool", + "description": "True, if the user can send videos" + }, + { + "name": "can_send_video_notes", + "type": "Bool", + "description": "True, if the user can send video notes" + }, + { + "name": "can_send_voice_notes", + "type": "Bool", + "description": "True, if the user can send voice notes" + }, + { + "name": "can_send_polls", + "type": "Bool", + "description": "True, if the user can send polls" + }, + { + "name": "can_send_other_messages", + "type": "Bool", + "description": "True, if the user can send animations, games, stickers, and dice and use inline bots" + }, + { + "name": "can_add_web_page_previews", + "type": "Bool", + "description": "True, if the user may add a web page preview to their messages" + }, + { + "name": "can_change_info", + "type": "Bool", + "description": "True, if the user can change the chat title, photo, and other settings" + }, + { + "name": "can_invite_users", + "type": "Bool", + "description": "True, if the user can invite new users to the chat" + }, + { + "name": "can_pin_messages", + "type": "Bool", + "description": "True, if the user can pin messages" + }, + { + "name": "can_manage_topics", + "type": "Bool", + "description": "True, if the user can manage topics" + } + ] + }, + { + "name": "chatAdministratorRights", + "description": "Describes rights of the administrator", + "class": "ChatAdministratorRights", + "properties": [ + { + "name": "can_manage_chat", + "type": "Bool", + "description": "True, if the administrator can get chat event log, get chat boosts in channels, get channel members, report supergroup spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only" + }, + { + "name": "can_change_info", + "type": "Bool", + "description": "True, if the administrator can change the chat title, photo, and other settings" + }, + { + "name": "can_post_messages", + "type": "Bool", + "description": "True, if the administrator can create channel posts or view channel statistics; applicable to channels only" + }, + { + "name": "can_edit_messages", + "type": "Bool", + "description": "True, if the administrator can edit messages of other users and pin messages; applicable to channels only" + }, + { + "name": "can_delete_messages", + "type": "Bool", + "description": "True, if the administrator can delete messages of other users" + }, + { + "name": "can_invite_users", + "type": "Bool", + "description": "True, if the administrator can invite new users to the chat" + }, + { + "name": "can_restrict_members", + "type": "Bool", + "description": "True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels" + }, + { + "name": "can_pin_messages", + "type": "Bool", + "description": "True, if the administrator can pin messages; applicable to basic groups and supergroups only" + }, + { + "name": "can_manage_topics", + "type": "Bool", + "description": "True, if the administrator can manage topics; applicable to forum supergroups only" + }, + { + "name": "can_promote_members", + "type": "Bool", + "description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them" + }, + { + "name": "can_manage_video_chats", + "type": "Bool", + "description": "True, if the administrator can manage video chats" + }, + { + "name": "can_post_stories", + "type": "Bool", + "description": "True, if the administrator can create new channel stories, or edit and delete posted stories; applicable to channels only" + }, + { + "name": "can_edit_stories", + "type": "Bool", + "description": "True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to channels only" + }, + { + "name": "can_delete_stories", + "type": "Bool", + "description": "True, if the administrator can delete stories posted by other users; applicable to channels only" + }, + { + "name": "is_anonymous", + "type": "Bool", + "description": "True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only" + } + ] + }, + { + "name": "premiumPaymentOption", + "description": "Describes an option for buying Telegram Premium to a user", + "class": "PremiumPaymentOption", + "properties": [ + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code for Telegram Premium subscription payment" + }, + { + "name": "amount", + "type": "int53", + "description": "The amount to pay, in the smallest units of the currency" + }, + { + "name": "discount_percentage", + "type": "int32", + "description": "The discount associated with this option, as a percentage" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active" + }, + { + "name": "store_product_id", + "type": "string", + "description": "Identifier of the store product associated with the option" + }, + { + "name": "payment_link", + "type": "InternalLinkType", + "description": "An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available" + } + ] + }, + { + "name": "premiumStatePaymentOption", + "description": "Describes an option for buying or upgrading Telegram Premium for self", + "class": "PremiumStatePaymentOption", + "properties": [ + { + "name": "payment_option", + "type": "premiumPaymentOption", + "description": "Information about the payment option" + }, + { + "name": "is_current", + "type": "Bool", + "description": "True, if this is the currently used Telegram Premium subscription option" + }, + { + "name": "is_upgrade", + "type": "Bool", + "description": "True, if the payment option can be used to upgrade the existing Telegram Premium subscription" + }, + { + "name": "last_transaction_id", + "type": "string", + "description": "Identifier of the last in-store transaction for the currently used option" + } + ] + }, + { + "name": "premiumGiftCodePaymentOption", + "description": "Describes an option for creating Telegram Premium gift codes", + "class": "PremiumGiftCodePaymentOption", + "properties": [ + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code for Telegram Premium gift code payment" + }, + { + "name": "amount", + "type": "int53", + "description": "The amount to pay, in the smallest units of the currency" + }, + { + "name": "user_count", + "type": "int32", + "description": "Number of users which will be able to activate the gift codes" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active" + }, + { + "name": "store_product_id", + "type": "string", + "description": "Identifier of the store product associated with the option; may be empty if none" + }, + { + "name": "store_product_quantity", + "type": "int32", + "description": "Number of times the store product must be paid" + } + ] + }, + { + "name": "premiumGiftCodePaymentOptions", + "description": "Contains a list of options for creating Telegram Premium gift codes", + "class": "PremiumGiftCodePaymentOptions", + "properties": [ + { + "name": "options", + "type": "vector\u003cpremiumGiftCodePaymentOption\u003e", + "description": "The list of options" + } + ] + }, + { + "name": "premiumGiftCodeInfo", + "description": "Contains information about a Telegram Premium gift code", + "class": "PremiumGiftCodeInfo", + "properties": [ + { + "name": "creator_id", + "type": "MessageSender", + "description": "Identifier of a chat or a user that created the gift code" + }, + { + "name": "creation_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the code was created" + }, + { + "name": "is_from_giveaway", + "type": "Bool", + "description": "True, if the gift code was created for a giveaway" + }, + { + "name": "giveaway_message_id", + "type": "int53", + "description": "Identifier of the corresponding giveaway message; can be 0 or an identifier of a deleted message" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active after code activation" + }, + { + "name": "user_id", + "type": "int53", + "description": "Identifier of a user for which the code was created; 0 if none" + }, + { + "name": "use_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the code was activated; 0 if none" + } + ] + }, + { + "name": "premiumGiveawayParticipantStatusEligible", + "description": "The user is eligible for the giveaway", + "class": "PremiumGiveawayParticipantStatus", + "properties": [] + }, + { + "name": "premiumGiveawayParticipantStatusParticipating", + "description": "The user participates in the giveaway", + "class": "PremiumGiveawayParticipantStatus", + "properties": [] + }, + { + "name": "premiumGiveawayParticipantStatusAlreadyWasMember", + "description": "The user can't participate in the giveaway, because they have already been member of the chat", + "class": "PremiumGiveawayParticipantStatus", + "properties": [ + { + "name": "joined_chat_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the user joined the chat" + } + ] + }, + { + "name": "premiumGiveawayParticipantStatusAdministrator", + "description": "The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway", + "class": "PremiumGiveawayParticipantStatus", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat administered by the user" + } + ] + }, + { + "name": "premiumGiveawayParticipantStatusDisallowedCountry", + "description": "The user can't participate in the giveaway, because they phone number is from a disallowed country", + "class": "PremiumGiveawayParticipantStatus", + "properties": [ + { + "name": "user_country_code", + "type": "string", + "description": "A two-letter ISO 3166-1 alpha-2 country code of the user's country" + } + ] + }, + { + "name": "premiumGiveawayInfoOngoing", + "description": "Describes an ongoing giveaway", + "class": "PremiumGiveawayInfo", + "properties": [ + { + "name": "creation_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the giveaway was created" + }, + { + "name": "status", + "type": "PremiumGiveawayParticipantStatus", + "description": "Status of the current user in the giveaway" + }, + { + "name": "is_ended", + "type": "Bool", + "description": "True, if the giveaway has ended and results are being prepared" + } + ] + }, + { + "name": "premiumGiveawayInfoCompleted", + "description": "Describes a completed giveaway", + "class": "PremiumGiveawayInfo", + "properties": [ + { + "name": "creation_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the giveaway was created" + }, + { + "name": "actual_winners_selection_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway" + }, + { + "name": "was_refunded", + "type": "Bool", + "description": "True, if the giveaway was canceled and was fully refunded" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Number of winners in the giveaway" + }, + { + "name": "activation_count", + "type": "int32", + "description": "Number of winners, which activated their gift codes" + }, + { + "name": "gift_code", + "type": "string", + "description": "Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway" + } + ] + }, + { + "name": "accentColor", + "description": "Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews", + "class": "AccentColor", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Accent color identifier" + }, + { + "name": "built_in_accent_color_id", + "type": "int32", + "description": "Identifier of a built-in color to use in places, where only one color is needed; 0-6" + }, + { + "name": "light_theme_colors", + "type": "vector\u003cint32\u003e", + "description": "The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes" + }, + { + "name": "dark_theme_colors", + "type": "vector\u003cint32\u003e", + "description": "The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes" + } + ] + }, + { + "name": "emojiStatus", + "description": "Describes a custom emoji to be shown instead of the Telegram Premium badge", + "class": "EmojiStatus", + "properties": [ + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Identifier of the custom emoji in stickerFormatTgs format" + }, + { + "name": "expiration_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the status will expire; 0 if never" + } + ] + }, + { + "name": "emojiStatuses", + "description": "Contains a list of custom emoji identifiers, which can be set as emoji statuses", + "class": "EmojiStatuses", + "properties": [ + { + "name": "custom_emoji_ids", + "type": "vector\u003cint64\u003e", + "description": "The list of custom emoji identifiers" + } + ] + }, + { + "name": "usernames", + "description": "Describes usernames assigned to a user, a supergroup, or a channel", + "class": "Usernames", + "properties": [ + { + "name": "active_usernames", + "type": "vector\u003cstring\u003e", + "description": "List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames" + }, + { + "name": "disabled_usernames", + "type": "vector\u003cstring\u003e", + "description": "List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive" + }, + { + "name": "editable_username", + "type": "string", + "description": "The active username, which can be changed with setUsername or setSupergroupUsername" + } + ] + }, { "name": "user", "description": "Represents a user", @@ -1754,9 +2645,9 @@ "description": "Last name of the user" }, { - "name": "username", - "type": "string", - "description": "Username of the user" + "name": "usernames", + "type": "usernames", + "description": "Usernames of the user; may be null" }, { "name": "phone_number", @@ -1773,6 +2664,21 @@ "type": "profilePhoto", "description": "Profile photo of the user; may be null" }, + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview" + }, + { + "name": "background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the reply header background; 0 if none. For Telegram Premium users only" + }, + { + "name": "emoji_status", + "type": "emojiStatus", + "description": "Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only" + }, { "name": "is_contact", "type": "Bool", @@ -1783,11 +2689,21 @@ "type": "Bool", "description": "The user is a contact of the current user and the current user is a contact of the user" }, + { + "name": "is_close_friend", + "type": "Bool", + "description": "The user is a close friend of the current user; implies that the user is a contact" + }, { "name": "is_verified", "type": "Bool", "description": "True, if the user is verified" }, + { + "name": "is_premium", + "type": "Bool", + "description": "True, if the user is a Telegram Premium user" + }, { "name": "is_support", "type": "Bool", @@ -1808,10 +2724,20 @@ "type": "Bool", "description": "True, if many users reported this user as a fake account" }, + { + "name": "has_active_stories", + "type": "Bool", + "description": "True, if the user has non-expired stories available to the current user" + }, + { + "name": "has_unread_active_stories", + "type": "Bool", + "description": "True, if the user has unread non-expired stories available to the current user" + }, { "name": "have_access", "type": "Bool", - "description": "If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser" + "description": "If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method" }, { "name": "type", @@ -1822,6 +2748,78 @@ "name": "language_code", "type": "string", "description": "IETF language tag of the user's language; only available to bots" + }, + { + "name": "added_to_attachment_menu", + "type": "Bool", + "description": "True, if the user added the current bot to attachment menu; only available to bots" + } + ] + }, + { + "name": "botInfo", + "description": "Contains information about a bot", + "class": "BotInfo", + "properties": [ + { + "name": "short_description", + "type": "string", + "description": "The text that is shown on the bot's profile page and is sent together with the link when users share the bot" + }, + { + "name": "description", + "type": "string", + "description": "The text shown in the chat with the bot if the chat is empty" + }, + { + "name": "photo", + "type": "photo", + "description": "Photo shown in the chat with the bot if the chat is empty; may be null" + }, + { + "name": "animation", + "type": "animation", + "description": "Animation shown in the chat with the bot if the chat is empty; may be null" + }, + { + "name": "menu_button", + "type": "botMenuButton", + "description": "Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown" + }, + { + "name": "commands", + "type": "vector\u003cbotCommand\u003e", + "description": "List of the bot commands" + }, + { + "name": "default_group_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to basic group and supergroup chats; may be null" + }, + { + "name": "default_channel_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to channels; may be null" + }, + { + "name": "edit_commands_link", + "type": "InternalLinkType", + "description": "The internal link, which can be used to edit bot commands; may be null" + }, + { + "name": "edit_description_link", + "type": "InternalLinkType", + "description": "The internal link, which can be used to edit bot description; may be null" + }, + { + "name": "edit_description_media_link", + "type": "InternalLinkType", + "description": "The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null" + }, + { + "name": "edit_settings_link", + "type": "InternalLinkType", + "description": "The internal link, which can be used to edit bot settings; may be null" } ] }, @@ -1831,14 +2829,24 @@ "class": "UserFullInfo", "properties": [ { - "name": "photo", + "name": "personal_photo", "type": "chatPhoto", - "description": "User profile photo; may be null" + "description": "User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos" }, { - "name": "is_blocked", - "type": "Bool", - "description": "True, if the user is blocked by the current user" + "name": "photo", + "type": "chatPhoto", + "description": "User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo" + }, + { + "name": "public_photo", + "type": "chatPhoto", + "description": "User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos" + }, + { + "name": "block_list", + "type": "BlockList", + "description": "Block list to which the user is added; may be null if none" }, { "name": "can_be_called", @@ -1860,6 +2868,16 @@ "type": "Bool", "description": "True, if the user can't be linked in forwarded messages due to their privacy settings" }, + { + "name": "has_restricted_voice_and_video_note_messages", + "type": "Bool", + "description": "True, if voice and video notes can't be sent or forwarded to the user" + }, + { + "name": "has_pinned_stories", + "type": "Bool", + "description": "True, if the user has pinned stories" + }, { "name": "need_phone_number_privacy_exception", "type": "Bool", @@ -1867,18 +2885,13 @@ }, { "name": "bio", - "type": "string", - "description": "A short user bio" + "type": "formattedText", + "description": "A short user bio; may be null for bots" }, { - "name": "share_text", - "type": "string", - "description": "For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot" - }, - { - "name": "description", - "type": "string", - "description": "For bots, the text shown in the chat with the bot if the chat is empty" + "name": "premium_gift_options", + "type": "vector\u003cpremiumPaymentOption\u003e", + "description": "The list of available options for gifting Telegram Premium to the user" }, { "name": "group_in_common_count", @@ -1886,9 +2899,9 @@ "description": "Number of group chats where both the other user and the current user are a member; 0 for the current user" }, { - "name": "commands", - "type": "vector\u003cbotCommand\u003e", - "description": "For bots, list of the bot commands" + "name": "bot_info", + "type": "botInfo", + "description": "For bots, information about the bot; may be null if the user isn't a bot" } ] }, @@ -1900,7 +2913,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of users found" + "description": "Approximate total number of users found" }, { "name": "user_ids", @@ -1943,53 +2956,6 @@ } ] }, - { - "name": "chatPermissions", - "description": "Describes actions that a user is allowed to take in a chat", - "class": "ChatPermissions", - "properties": [ - { - "name": "can_send_messages", - "type": "Bool", - "description": "True, if the user can send text messages, contacts, locations, and venues" - }, - { - "name": "can_send_media_messages", - "type": "Bool", - "description": "True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions" - }, - { - "name": "can_send_polls", - "type": "Bool", - "description": "True, if the user can send polls. Implies can_send_messages permissions" - }, - { - "name": "can_send_other_messages", - "type": "Bool", - "description": "True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions" - }, - { - "name": "can_add_web_page_previews", - "type": "Bool", - "description": "True, if the user may add a web page preview to their messages. Implies can_send_messages permissions" - }, - { - "name": "can_change_info", - "type": "Bool", - "description": "True, if the user can change the chat title, photo, and other settings" - }, - { - "name": "can_invite_users", - "type": "Bool", - "description": "True, if the user can invite new users to the chat" - }, - { - "name": "can_pin_messages", - "type": "Bool", - "description": "True, if the user can pin messages" - } - ] - }, { "name": "chatMemberStatusCreator", "description": "The user is the owner of the chat and has all the administrator privileges", @@ -2028,59 +2994,9 @@ "description": "True, if the current user can edit the administrator privileges for the called user" }, { - "name": "can_manage_chat", - "type": "Bool", - "description": "True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only" - }, - { - "name": "can_change_info", - "type": "Bool", - "description": "True, if the administrator can change the chat title, photo, and other settings" - }, - { - "name": "can_post_messages", - "type": "Bool", - "description": "True, if the administrator can create channel posts; applicable to channels only" - }, - { - "name": "can_edit_messages", - "type": "Bool", - "description": "True, if the administrator can edit messages of other users and pin messages; applicable to channels only" - }, - { - "name": "can_delete_messages", - "type": "Bool", - "description": "True, if the administrator can delete messages of other users" - }, - { - "name": "can_invite_users", - "type": "Bool", - "description": "True, if the administrator can invite new users to the chat" - }, - { - "name": "can_restrict_members", - "type": "Bool", - "description": "True, if the administrator can restrict, ban, or unban chat members; always true for channels" - }, - { - "name": "can_pin_messages", - "type": "Bool", - "description": "True, if the administrator can pin messages; applicable to basic groups and supergroups only" - }, - { - "name": "can_promote_members", - "type": "Bool", - "description": "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them" - }, - { - "name": "can_manage_video_chats", - "type": "Bool", - "description": "True, if the administrator can manage video chats" - }, - { - "name": "is_anonymous", - "type": "Bool", - "description": "True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only" + "name": "rights", + "type": "chatAdministratorRights", + "description": "Rights of the administrator" } ] }, @@ -2148,7 +3064,7 @@ { "name": "joined_chat_date", "type": "int32", - "description": "Point in time (Unix timestamp) when the user joined the chat" + "description": "Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat" }, { "name": "status", @@ -2165,7 +3081,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chat members found" + "description": "Approximate total number of chat members found" }, { "name": "members", @@ -2380,7 +3296,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chat invite links found" + "description": "Approximate total number of chat invite links found" }, { "name": "invite_links", @@ -2438,6 +3354,11 @@ "type": "int32", "description": "Point in time (Unix timestamp) when the user joined the chat" }, + { + "name": "via_chat_folder_invite_link", + "type": "Bool", + "description": "True, if the user has joined the chat using an invite link for a chat folder" + }, { "name": "approver_user_id", "type": "int53", @@ -2453,7 +3374,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chat members found" + "description": "Approximate total number of chat members found" }, { "name": "members", @@ -2462,6 +3383,24 @@ } ] }, + { + "name": "inviteLinkChatTypeBasicGroup", + "description": "The link is an invite link for a basic group", + "class": "InviteLinkChatType", + "properties": [] + }, + { + "name": "inviteLinkChatTypeSupergroup", + "description": "The link is an invite link for a supergroup", + "class": "InviteLinkChatType", + "properties": [] + }, + { + "name": "inviteLinkChatTypeChannel", + "description": "The link is an invite link for a channel", + "class": "InviteLinkChatType", + "properties": [] + }, { "name": "chatInviteLinkInfo", "description": "Contains information about a chat invite link", @@ -2479,7 +3418,7 @@ }, { "name": "type", - "type": "ChatType", + "type": "InviteLinkChatType", "description": "Type of the chat" }, { @@ -2492,6 +3431,11 @@ "type": "chatPhotoInfo", "description": "Chat photo; may be null" }, + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color for chat title and background of chat photo" + }, { "name": "description", "type": "string", @@ -2516,6 +3460,21 @@ "name": "is_public", "type": "Bool", "description": "True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup" + }, + { + "name": "is_verified", + "type": "Bool", + "description": "True, if the chat is verified" + }, + { + "name": "is_scam", + "type": "Bool", + "description": "True, if many users reported this chat as a scam" + }, + { + "name": "is_fake", + "type": "Bool", + "description": "True, if many users reported this chat as a fake account" } ] }, @@ -2549,7 +3508,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of requests found" + "description": "Approximate total number of requests found" }, { "name": "requests", @@ -2615,7 +3574,7 @@ { "name": "photo", "type": "chatPhoto", - "description": "Chat photo; may be null" + "description": "Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo" }, { "name": "description", @@ -2632,6 +3591,16 @@ "type": "vector\u003cchatMember\u003e", "description": "Group members" }, + { + "name": "can_hide_members", + "type": "Bool", + "description": "True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup" + }, + { + "name": "can_toggle_aggressive_anti_spam", + "type": "Bool", + "description": "True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup" + }, { "name": "invite_link", "type": "chatInviteLink", @@ -2655,9 +3624,9 @@ "description": "Supergroup or channel identifier" }, { - "name": "username", - "type": "string", - "description": "Username of the supergroup or channel; empty for private supergroups or channels" + "name": "usernames", + "type": "usernames", + "description": "Usernames of the supergroup or channel; may be null" }, { "name": "date", @@ -2667,12 +3636,12 @@ { "name": "status", "type": "ChatMemberStatus", - "description": "Status of the current user in the supergroup or channel; custom title will be always empty" + "description": "Status of the current user in the supergroup or channel; custom title will always be empty" }, { "name": "member_count", "type": "int32", - "description": "Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules" + "description": "Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, getUserPrivacySettingRules, or in chatFolderInviteLinkInfo.missing_chat_ids" }, { "name": "has_linked_chat", @@ -2689,6 +3658,16 @@ "type": "Bool", "description": "True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels" }, + { + "name": "join_to_send_messages", + "type": "Bool", + "description": "True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups" + }, + { + "name": "join_by_request", + "type": "Bool", + "description": "True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat" + }, { "name": "is_slow_mode_enabled", "type": "Bool", @@ -2704,6 +3683,11 @@ "type": "Bool", "description": "True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members" }, + { + "name": "is_forum", + "type": "Bool", + "description": "True, if the supergroup must be shown as a forum by default" + }, { "name": "is_verified", "type": "Bool", @@ -2723,6 +3707,16 @@ "name": "is_fake", "type": "Bool", "description": "True, if many users reported this supergroup or channel as a fake account" + }, + { + "name": "has_active_stories", + "type": "Bool", + "description": "True, if the channel has non-expired stories available to the current user" + }, + { + "name": "has_unread_active_stories", + "type": "Bool", + "description": "True, if the channel has unread non-expired stories available to the current user" } ] }, @@ -2734,7 +3728,7 @@ { "name": "photo", "type": "chatPhoto", - "description": "Chat photo; may be null" + "description": "Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo" }, { "name": "description", @@ -2779,12 +3773,17 @@ { "name": "can_get_members", "type": "Bool", - "description": "True, if members of the chat can be retrieved" + "description": "True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers" }, { - "name": "can_set_username", + "name": "has_hidden_members", "type": "Bool", - "description": "True, if the chat username can be changed" + "description": "True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers" + }, + { + "name": "can_hide_members", + "type": "Bool", + "description": "True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators" }, { "name": "can_set_sticker_set", @@ -2801,10 +3800,25 @@ "type": "Bool", "description": "True, if the supergroup or channel statistics are available" }, + { + "name": "can_toggle_aggressive_anti_spam", + "type": "Bool", + "description": "True, if aggressive anti-spam checks can be enabled or disabled in the supergroup" + }, { "name": "is_all_history_available", "type": "Bool", - "description": "True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators" + "description": "True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators" + }, + { + "name": "has_aggressive_anti_spam_enabled", + "type": "Bool", + "description": "True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators" + }, + { + "name": "has_pinned_stories", + "type": "Bool", + "description": "True, if the channel has pinned stories" }, { "name": "sticker_set_id", @@ -2814,12 +3828,12 @@ { "name": "location", "type": "chatLocation", - "description": "Location to which the supergroup is connected; may be null" + "description": "Location to which the supergroup is connected; may be null if none" }, { "name": "invite_link", "type": "chatInviteLink", - "description": "Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only" + "description": "Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only" }, { "name": "bot_commands", @@ -2879,7 +3893,7 @@ { "name": "is_outbound", "type": "Bool", - "description": "True, if the chat was created by the current user; otherwise false" + "description": "True, if the chat was created by the current user; false otherwise" }, { "name": "key_hash", @@ -2889,7 +3903,7 @@ { "name": "layer", "type": "int32", - "description": "Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer \u003e= 101" + "description": "Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer \u003e= 101, files bigger than 2000MB are supported if the layer \u003e= 143, spoiler and custom emoji text entities are supported if the layer \u003e= 144" } ] }, @@ -2925,7 +3939,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of messages senders found" + "description": "Approximate total number of messages senders found" }, { "name": "senders", @@ -2935,9 +3949,67 @@ ] }, { - "name": "messageForwardOriginUser", + "name": "chatMessageSender", + "description": "Represents a message sender, which can be used to send messages in a chat", + "class": "ChatMessageSender", + "properties": [ + { + "name": "sender", + "type": "MessageSender", + "description": "Available message senders" + }, + { + "name": "needs_premium", + "type": "Bool", + "description": "True, if Telegram Premium is needed to use the message sender" + } + ] + }, + { + "name": "chatMessageSenders", + "description": "Represents a list of message senders, which can be used to send messages in a chat", + "class": "ChatMessageSenders", + "properties": [ + { + "name": "senders", + "type": "vector\u003cchatMessageSender\u003e", + "description": "List of available message senders" + } + ] + }, + { + "name": "messageViewer", + "description": "Represents a viewer of a message", + "class": "MessageViewer", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier of the viewer" + }, + { + "name": "view_date", + "type": "int32", + "description": "Approximate point in time (Unix timestamp) when the message was viewed" + } + ] + }, + { + "name": "messageViewers", + "description": "Represents a list of message viewers", + "class": "MessageViewers", + "properties": [ + { + "name": "viewers", + "type": "vector\u003cmessageViewer\u003e", + "description": "List of message viewers" + } + ] + }, + { + "name": "messageOriginUser", "description": "The message was originally sent by a known user", - "class": "MessageForwardOrigin", + "class": "MessageOrigin", "properties": [ { "name": "sender_user_id", @@ -2947,9 +4019,21 @@ ] }, { - "name": "messageForwardOriginChat", + "name": "messageOriginHiddenUser", + "description": "The message was originally sent by a user, which is hidden by their privacy settings", + "class": "MessageOrigin", + "properties": [ + { + "name": "sender_name", + "type": "string", + "description": "Name of the sender" + } + ] + }, + { + "name": "messageOriginChat", "description": "The message was originally sent on behalf of a chat", - "class": "MessageForwardOrigin", + "class": "MessageOrigin", "properties": [ { "name": "sender_chat_id", @@ -2964,26 +4048,14 @@ ] }, { - "name": "messageForwardOriginHiddenUser", - "description": "The message was originally sent by a user, which is hidden by their privacy settings", - "class": "MessageForwardOrigin", - "properties": [ - { - "name": "sender_name", - "type": "string", - "description": "Name of the sender" - } - ] - }, - { - "name": "messageForwardOriginChannel", + "name": "messageOriginChannel", "description": "The message was originally a post in a channel", - "class": "MessageForwardOrigin", + "class": "MessageOrigin", "properties": [ { "name": "chat_id", "type": "int53", - "description": "Identifier of the chat from which the message was originally forwarded" + "description": "Identifier of the channel chat to which the message was originally sent" }, { "name": "message_id", @@ -2998,14 +4070,26 @@ ] }, { - "name": "messageForwardOriginMessageImport", - "description": "The message was imported from an exported message history", - "class": "MessageForwardOrigin", + "name": "reactionTypeEmoji", + "description": "A reaction with an emoji", + "class": "ReactionType", "properties": [ { - "name": "sender_name", + "name": "emoji", "type": "string", - "description": "Name of the sender" + "description": "Text representation of the reaction" + } + ] + }, + { + "name": "reactionTypeCustomEmoji", + "description": "A reaction with a custom emoji", + "class": "ReactionType", + "properties": [ + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Unique identifier of the custom emoji" } ] }, @@ -3016,8 +4100,8 @@ "properties": [ { "name": "origin", - "type": "MessageForwardOrigin", - "description": "Origin of a forwarded message" + "type": "MessageOrigin", + "description": "Origin of the forwarded message" }, { "name": "date", @@ -3041,6 +4125,23 @@ } ] }, + { + "name": "messageImportInfo", + "description": "Contains information about a message created with importMessages", + "class": "MessageImportInfo", + "properties": [ + { + "name": "sender_name", + "type": "string", + "description": "Name of the original sender" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the message was originally sent" + } + ] + }, { "name": "messageReplyInfo", "description": "Contains information about replies to a message", @@ -3073,6 +4174,38 @@ } ] }, + { + "name": "messageReaction", + "description": "Contains information about a reaction to a message", + "class": "MessageReaction", + "properties": [ + { + "name": "type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "total_count", + "type": "int32", + "description": "Number of times the reaction was added" + }, + { + "name": "is_chosen", + "type": "Bool", + "description": "True, if the reaction is chosen by the current user" + }, + { + "name": "used_sender_id", + "type": "MessageSender", + "description": "Identifier of the message sender used by the current user to add the reaction; null if unknown or the reaction isn't chosen" + }, + { + "name": "recent_sender_ids", + "type": "vector\u003cMessageSender\u003e", + "description": "Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats" + } + ] + }, { "name": "messageInteractionInfo", "description": "Contains information about interactions with a message", @@ -3092,6 +4225,33 @@ "name": "reply_info", "type": "messageReplyInfo", "description": "Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself" + }, + { + "name": "reactions", + "type": "vector\u003cmessageReaction\u003e", + "description": "The list of reactions added to the message" + } + ] + }, + { + "name": "unreadReaction", + "description": "Contains information about an unread reaction to a message", + "class": "UnreadReaction", + "properties": [ + { + "name": "type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the sender, added the reaction" + }, + { + "name": "is_big", + "type": "Bool", + "description": "True, if the reaction was added with a big animation" } ] }, @@ -3099,7 +4259,13 @@ "name": "messageSendingStatePending", "description": "The message is being sent now, but has not yet been delivered to the server", "class": "MessageSendingState", - "properties": [] + "properties": [ + { + "name": "sending_id", + "type": "int32", + "description": "Non-persistent message sending identifier, specified by the application" + } + ] }, { "name": "messageSendingStateFailed", @@ -3107,14 +4273,9 @@ "class": "MessageSendingState", "properties": [ { - "name": "error_code", - "type": "int32", - "description": "An error code; 0 if unknown" - }, - { - "name": "error_message", - "type": "string", - "description": "Error message" + "name": "error", + "type": "error", + "description": "The cause of the message sending failure" }, { "name": "can_retry", @@ -3126,6 +4287,16 @@ "type": "Bool", "description": "True, if the message can be re-sent only on behalf of a different sender" }, + { + "name": "need_another_reply_quote", + "type": "Bool", + "description": "True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message" + }, + { + "name": "need_drop_reply", + "type": "Bool", + "description": "True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages" + }, { "name": "retry_after", "type": "double", @@ -3133,6 +4304,104 @@ } ] }, + { + "name": "messageReplyToMessage", + "description": "Describes a message replied by a given message", + "class": "MessageReplyTo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat" + }, + { + "name": "message_id", + "type": "int53", + "description": "The identifier of the message; may be 0 if the replied message is in unknown chat" + }, + { + "name": "quote", + "type": "formattedText", + "description": "Manually or automatically chosen quote from the replied message; may be null if none. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the quote" + }, + { + "name": "is_quote_manual", + "type": "Bool", + "description": "True, if the quote was manually chosen by the message sender" + }, + { + "name": "origin", + "type": "MessageOrigin", + "description": "Information about origin of the message if the message was replied from another chat; may be null for messages from the same chat" + }, + { + "name": "origin_send_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the message was sent if the message was replied from another chat; 0 for messages from the same chat" + }, + { + "name": "content", + "type": "MessageContent", + "description": "Media content of the message if the message was replied from another chat; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, messagePhoto, messagePoll, messagePremiumGiveaway, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote" + } + ] + }, + { + "name": "messageReplyToStory", + "description": "Describes a story replied by a given message", + "class": "MessageReplyTo", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + } + ] + }, + { + "name": "inputMessageReplyToMessage", + "description": "Describes a message to be replied", + "class": "InputMessageReplyTo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat only if message.can_be_replied_in_another_chat" + }, + { + "name": "message_id", + "type": "int53", + "description": "The identifier of the message to be replied in the same or the specified chat" + }, + { + "name": "quote", + "type": "formattedText", + "description": "Manually chosen quote from the message to be replied; pass null if none; 0-getOption(\"message_reply_quote_length_max\") characters. Must always be null for replies in secret chats. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote" + } + ] + }, + { + "name": "inputMessageReplyToStory", + "description": "Describes a story to be replied", + "class": "InputMessageReplyTo", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + } + ] + }, { "name": "message", "description": "Describes a message", @@ -3156,12 +4425,12 @@ { "name": "sending_state", "type": "MessageSendingState", - "description": "The sending state of the message; may be null" + "description": "The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent" }, { "name": "scheduling_state", "type": "MessageSchedulingState", - "description": "The scheduling state of the message; may be null" + "description": "The scheduling state of the message; may be null if the message isn't scheduled" }, { "name": "is_outgoing", @@ -3183,6 +4452,11 @@ "type": "Bool", "description": "True, if the message can be forwarded" }, + { + "name": "can_be_replied_in_another_chat", + "type": "Bool", + "description": "True, if the message can be replied in another chat" + }, { "name": "can_be_saved", "type": "Bool", @@ -3198,15 +4472,20 @@ "type": "Bool", "description": "True, if the message can be deleted for all users" }, + { + "name": "can_get_added_reactions", + "type": "Bool", + "description": "True, if the list of added reactions is available through getMessageAddedReactions" + }, { "name": "can_get_statistics", "type": "Bool", - "description": "True, if the message statistics are available" + "description": "True, if the message statistics are available through getMessageStatistics" }, { "name": "can_get_message_thread", "type": "Bool", - "description": "True, if the message thread info is available" + "description": "True, if information about the message thread is available through getMessageThread and getMessageThreadHistory" }, { "name": "can_get_viewers", @@ -3216,7 +4495,12 @@ { "name": "can_get_media_timestamp_links", "type": "Bool", - "description": "True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description" + "description": "True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink" + }, + { + "name": "can_report_reactions", + "type": "Bool", + "description": "True, if reactions on the message can be reported through reportMessageReactions" }, { "name": "has_timestamped_media", @@ -3228,6 +4512,11 @@ "type": "Bool", "description": "True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts" }, + { + "name": "is_topic_message", + "type": "Bool", + "description": "True, if the message is a forum topic message" + }, { "name": "contains_unread_mention", "type": "Bool", @@ -3246,22 +4535,27 @@ { "name": "forward_info", "type": "messageForwardInfo", - "description": "Information about the initial message sender; may be null" + "description": "Information about the initial message sender; may be null if none or unknown" + }, + { + "name": "import_info", + "type": "messageImportInfo", + "description": "Information about the initial message for messages created with importMessages; may be null if the message isn't imported" }, { "name": "interaction_info", "type": "messageInteractionInfo", - "description": "Information about interactions with the message; may be null" + "description": "Information about interactions with the message; may be null if none" }, { - "name": "reply_in_chat_id", - "type": "int53", - "description": "If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id" + "name": "unread_reactions", + "type": "vector\u003cunreadReaction\u003e", + "description": "Information about unread reactions added to the message" }, { - "name": "reply_to_message_id", - "type": "int53", - "description": "If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message" + "name": "reply_to", + "type": "MessageReplyTo", + "description": "Information about the message or the story this message is replying to; may be null if none" }, { "name": "message_thread_id", @@ -3269,14 +4563,19 @@ "description": "If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs" }, { - "name": "ttl", - "type": "int32", - "description": "For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires" + "name": "self_destruct_type", + "type": "MessageSelfDestructType", + "description": "The message's self-destruct type; may be null if none" }, { - "name": "ttl_expires_in", + "name": "self_destruct_in", "type": "double", - "description": "Time left before the message expires, in seconds. If the TTL timer isn't started yet, equals to the value of the ttl field" + "description": "Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet" + }, + { + "name": "auto_delete_in", + "type": "double", + "description": "Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never" }, { "name": "via_bot_user_id", @@ -3306,7 +4605,7 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "Reply markup for the message; may be null" + "description": "Reply markup for the message; may be null if none" } ] }, @@ -3318,7 +4617,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of messages found" + "description": "Approximate total number of messages found" }, { "name": "messages", @@ -3335,7 +4634,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of messages found; -1 if unknown" + "description": "Approximate total number of messages found; -1 if unknown" }, { "name": "messages", @@ -3349,6 +4648,28 @@ } ] }, + { + "name": "foundChatMessages", + "description": "Contains a list of messages found by a search in a given chat", + "class": "FoundChatMessages", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of messages found; -1 if unknown" + }, + { + "name": "messages", + "type": "vector\u003cmessage\u003e", + "description": "List of messages" + }, + { + "name": "next_from_message_id", + "type": "int53", + "description": "The offset for the next request. If 0, there are no more results" + } + ] + }, { "name": "messagePosition", "description": "Contains information about a message in a specific position", @@ -3379,7 +4700,7 @@ { "name": "total_count", "type": "int32", - "description": "Total count of messages found" + "description": "Total number of messages found" }, { "name": "positions", @@ -3422,6 +4743,156 @@ } ] }, + { + "name": "messageSourceChatHistory", + "description": "The message is from a chat history", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceMessageThreadHistory", + "description": "The message is from a message thread history", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceForumTopicHistory", + "description": "The message is from a forum topic history", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceHistoryPreview", + "description": "The message is from chat, message thread or forum topic history preview", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceChatList", + "description": "The message is from a chat list or a forum topic list", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceSearch", + "description": "The message is from search results, including file downloads, local file list, outgoing document messages, calendar", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceChatEventLog", + "description": "The message is from a chat event log", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceNotification", + "description": "The message is from a notification", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceScreenshot", + "description": "The message was screenshotted; the source must be used only if the message content was visible during the screenshot", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceOther", + "description": "The message is from some other source", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSponsorTypeBot", + "description": "The sponsor is a bot", + "class": "MessageSponsorType", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "User identifier of the bot" + }, + { + "name": "link", + "type": "InternalLinkType", + "description": "An internal link to be opened when the sponsored message is clicked" + } + ] + }, + { + "name": "messageSponsorTypePublicChannel", + "description": "The sponsor is a public channel chat", + "class": "MessageSponsorType", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Sponsor chat identifier" + }, + { + "name": "link", + "type": "InternalLinkType", + "description": "An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead" + } + ] + }, + { + "name": "messageSponsorTypePrivateChannel", + "description": "The sponsor is a private channel chat", + "class": "MessageSponsorType", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Title of the chat" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link for the channel" + } + ] + }, + { + "name": "messageSponsorTypeWebsite", + "description": "The sponsor is a website", + "class": "MessageSponsorType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "URL of the website" + }, + { + "name": "name", + "type": "string", + "description": "Name of the website" + } + ] + }, + { + "name": "messageSponsor", + "description": "Information about the sponsor of a message", + "class": "MessageSponsor", + "properties": [ + { + "name": "type", + "type": "MessageSponsorType", + "description": "Type of the sponsor" + }, + { + "name": "photo", + "type": "chatPhotoInfo", + "description": "Photo of the sponsor; may be null if must not be shown" + }, + { + "name": "info", + "type": "string", + "description": "Additional optional information about the sponsor to be shown along with the message" + } + ] + }, { "name": "sponsoredMessage", "description": "Describes a sponsored message", @@ -3433,19 +4904,117 @@ "description": "Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages" }, { - "name": "sponsor_chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "link", - "type": "InternalLinkType", - "description": "An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead" + "name": "is_recommended", + "type": "Bool", + "description": "True, if the message needs to be labeled as \"recommended\" instead of \"sponsored\"" }, { "name": "content", "type": "MessageContent", "description": "Content of the message. Currently, can be only of the type messageText" + }, + { + "name": "sponsor", + "type": "messageSponsor", + "description": "Information about the sponsor of the message" + }, + { + "name": "additional_info", + "type": "string", + "description": "If non-empty, additional information about the sponsored message to be shown along with the message" + } + ] + }, + { + "name": "sponsoredMessages", + "description": "Contains a list of sponsored messages", + "class": "SponsoredMessages", + "properties": [ + { + "name": "messages", + "type": "vector\u003csponsoredMessage\u003e", + "description": "List of sponsored messages" + }, + { + "name": "messages_between", + "type": "int32", + "description": "The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages" + } + ] + }, + { + "name": "fileDownload", + "description": "Describes a file added to file download list", + "class": "FileDownload", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "File identifier" + }, + { + "name": "message", + "type": "message", + "description": "The message with the file" + }, + { + "name": "add_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the file was added to the download list" + }, + { + "name": "complete_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "True, if downloading of the file is paused" + } + ] + }, + { + "name": "downloadedFileCounts", + "description": "Contains number of being downloaded and recently downloaded files found", + "class": "DownloadedFileCounts", + "properties": [ + { + "name": "active_count", + "type": "int32", + "description": "Number of active file downloads found, including paused" + }, + { + "name": "paused_count", + "type": "int32", + "description": "Number of paused file downloads found" + }, + { + "name": "completed_count", + "type": "int32", + "description": "Number of completed file downloads found" + } + ] + }, + { + "name": "foundFileDownloads", + "description": "Contains a list of downloaded files, found by a search", + "class": "FoundFileDownloads", + "properties": [ + { + "name": "total_counts", + "type": "downloadedFileCounts", + "description": "Total number of suitable files, ignoring offset" + }, + { + "name": "files", + "type": "vector\u003cfileDownload\u003e", + "description": "The list of files" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, there are no more results" } ] }, @@ -3457,25 +5026,25 @@ }, { "name": "notificationSettingsScopeGroupChats", - "description": "Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value", + "description": "Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value", "class": "NotificationSettingsScope", "properties": [] }, { "name": "notificationSettingsScopeChannelChats", - "description": "Notification settings applied to all channels when the corresponding chat setting has a default value", + "description": "Notification settings applied to all channel chats when the corresponding chat setting has a default value", "class": "NotificationSettingsScope", "properties": [] }, { "name": "chatNotificationSettings", - "description": "Contains information about notification settings for a chat", + "description": "Contains information about notification settings for a chat or a forum topic", "class": "ChatNotificationSettings", "properties": [ { "name": "use_default_mute_for", "type": "Bool", - "description": "If true, mute_for is ignored and the value for the relevant type of chat is used instead" + "description": "If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead" }, { "name": "mute_for", @@ -3485,27 +5054,57 @@ { "name": "use_default_sound", "type": "Bool", - "description": "If true, sound is ignored and the value for the relevant type of chat is used instead" + "description": "If true, the value for the relevant type of chat or the forum chat is used instead of sound_id" }, { - "name": "sound", - "type": "string", - "description": "The name of an audio file to be used for notification sounds; only applies to iOS applications" + "name": "sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played for messages; 0 if sound is disabled" }, { "name": "use_default_show_preview", "type": "Bool", - "description": "If true, show_preview is ignored and the value for the relevant type of chat is used instead" + "description": "If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead" }, { "name": "show_preview", "type": "Bool", "description": "True, if message content must be displayed in notifications" }, + { + "name": "use_default_mute_stories", + "type": "Bool", + "description": "If true, mute_stories is ignored and the value for the relevant type of chat is used instead" + }, + { + "name": "mute_stories", + "type": "Bool", + "description": "True, if story notifications are disabled for the chat" + }, + { + "name": "use_default_story_sound", + "type": "Bool", + "description": "If true, the value for the relevant type of chat is used instead of story_sound_id" + }, + { + "name": "story_sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played for stories; 0 if sound is disabled" + }, + { + "name": "use_default_show_story_sender", + "type": "Bool", + "description": "If true, show_story_sender is ignored and the value for the relevant type of chat is used instead" + }, + { + "name": "show_story_sender", + "type": "Bool", + "description": "True, if the sender of stories must be displayed in notifications" + }, { "name": "use_default_disable_pinned_message_notifications", "type": "Bool", - "description": "If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead" + "description": "If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead" }, { "name": "disable_pinned_message_notifications", @@ -3515,7 +5114,7 @@ { "name": "use_default_disable_mention_notifications", "type": "Bool", - "description": "If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead" + "description": "If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead" }, { "name": "disable_mention_notifications", @@ -3535,15 +5134,35 @@ "description": "Time left before notifications will be unmuted, in seconds" }, { - "name": "sound", - "type": "string", - "description": "The name of an audio file to be used for notification sounds; only applies to iOS applications" + "name": "sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played; 0 if sound is disabled" }, { "name": "show_preview", "type": "Bool", "description": "True, if message content must be displayed in notifications" }, + { + "name": "use_default_mute_stories", + "type": "Bool", + "description": "If true, mute_stories is ignored and story notifications are received only for the first 5 chats from topChatCategoryUsers" + }, + { + "name": "mute_stories", + "type": "Bool", + "description": "True, if story notifications are disabled for the chat" + }, + { + "name": "story_sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played for stories; 0 if sound is disabled" + }, + { + "name": "show_story_sender", + "type": "Bool", + "description": "True, if the sender of stories must be displayed in notifications" + }, { "name": "disable_pinned_message_notifications", "type": "Bool", @@ -3562,9 +5181,9 @@ "class": "DraftMessage", "properties": [ { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of the message to reply to; 0 if none" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none" }, { "name": "date", @@ -3637,34 +5256,51 @@ ] }, { - "name": "chatFilter", - "description": "Represents a filter of user chats", - "class": "ChatFilter", + "name": "chatFolderIcon", + "description": "Represents an icon for a chat folder", + "class": "ChatFolderIcon", + "properties": [ + { + "name": "name", + "type": "string", + "description": "The chosen icon name for short folder representation; one of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\", \"Airplane\", \"Book\", \"Light\", \"Like\", \"Money\", \"Note\", \"Palette\"" + } + ] + }, + { + "name": "chatFolder", + "description": "Represents a folder for user chats", + "class": "ChatFolder", "properties": [ { "name": "title", "type": "string", - "description": "The title of the filter; 1-12 characters without line feeds" + "description": "The title of the folder; 1-12 characters without line feeds" }, { - "name": "icon_name", - "type": "string", - "description": "The chosen icon name for short filter representation. If non-empty, must be one of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\". If empty, use getChatFilterDefaultIconName to get default icon name for the filter" + "name": "icon", + "type": "chatFolderIcon", + "description": "The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder" + }, + { + "name": "is_shareable", + "type": "Bool", + "description": "True, if at least one link has been created for the folder" }, { "name": "pinned_chat_ids", "type": "vector\u003cint53\u003e", - "description": "The chat identifiers of pinned chats in the filtered chat list" + "description": "The chat identifiers of pinned chats in the folder. There can be up to getOption(\"chat_folder_chosen_chat_count_max\") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" }, { "name": "included_chat_ids", "type": "vector\u003cint53\u003e", - "description": "The chat identifiers of always included chats in the filtered chat list" + "description": "The chat identifiers of always included chats in the folder. There can be up to getOption(\"chat_folder_chosen_chat_count_max\") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" }, { "name": "excluded_chat_ids", "type": "vector\u003cint53\u003e", - "description": "The chat identifiers of always excluded chats in the filtered chat list" + "description": "The chat identifiers of always excluded chats in the folder. There can be up to getOption(\"chat_folder_chosen_chat_count_max\") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" }, { "name": "exclude_muted", @@ -3709,53 +5345,141 @@ ] }, { - "name": "chatFilterInfo", - "description": "Contains basic information about a chat filter", - "class": "ChatFilterInfo", + "name": "chatFolderInfo", + "description": "Contains basic information about a chat folder", + "class": "ChatFolderInfo", "properties": [ { "name": "id", "type": "int32", - "description": "Unique chat filter identifier" + "description": "Unique chat folder identifier" }, { "name": "title", "type": "string", - "description": "The title of the filter; 1-12 characters without line feeds" + "description": "The title of the folder; 1-12 characters without line feeds" }, { - "name": "icon_name", - "type": "string", - "description": "The chosen or default icon name for short filter representation. One of \"All\", \"Unread\", \"Unmuted\", \"Bots\", \"Channels\", \"Groups\", \"Private\", \"Custom\", \"Setup\", \"Cat\", \"Crown\", \"Favorite\", \"Flower\", \"Game\", \"Home\", \"Love\", \"Mask\", \"Party\", \"Sport\", \"Study\", \"Trade\", \"Travel\", \"Work\"" + "name": "icon", + "type": "chatFolderIcon", + "description": "The chosen or default icon for the chat folder" + }, + { + "name": "is_shareable", + "type": "Bool", + "description": "True, if at least one link has been created for the folder" + }, + { + "name": "has_my_invite_links", + "type": "Bool", + "description": "True, if the chat folder has invite links created by the current user" } ] }, { - "name": "recommendedChatFilter", - "description": "Describes a recommended chat filter", - "class": "RecommendedChatFilter", + "name": "chatFolderInviteLink", + "description": "Contains a chat folder invite link", + "class": "ChatFolderInviteLink", "properties": [ { - "name": "filter", - "type": "chatFilter", - "description": "The chat filter" + "name": "invite_link", + "type": "string", + "description": "The chat folder invite link" + }, + { + "name": "name", + "type": "string", + "description": "Name of the link" + }, + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of chats, included in the link" + } + ] + }, + { + "name": "chatFolderInviteLinks", + "description": "Represents a list of chat folder invite links", + "class": "ChatFolderInviteLinks", + "properties": [ + { + "name": "invite_links", + "type": "vector\u003cchatFolderInviteLink\u003e", + "description": "List of the invite links" + } + ] + }, + { + "name": "chatFolderInviteLinkInfo", + "description": "Contains information about an invite link to a chat folder", + "class": "ChatFolderInviteLinkInfo", + "properties": [ + { + "name": "chat_folder_info", + "type": "chatFolderInfo", + "description": "Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet" + }, + { + "name": "missing_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the chats from the link, which aren't added to the folder yet" + }, + { + "name": "added_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the chats from the link, which are added to the folder already" + } + ] + }, + { + "name": "recommendedChatFolder", + "description": "Describes a recommended chat folder", + "class": "RecommendedChatFolder", + "properties": [ + { + "name": "folder", + "type": "chatFolder", + "description": "The chat folder" }, { "name": "description", "type": "string", - "description": "Chat filter description" + "description": "Chat folder description" } ] }, { - "name": "recommendedChatFilters", - "description": "Contains a list of recommended chat filters", - "class": "RecommendedChatFilters", + "name": "recommendedChatFolders", + "description": "Contains a list of recommended chat folders", + "class": "RecommendedChatFolders", "properties": [ { - "name": "chat_filters", - "type": "vector\u003crecommendedChatFilter\u003e", - "description": "List of recommended chat filters" + "name": "chat_folders", + "type": "vector\u003crecommendedChatFolder\u003e", + "description": "List of recommended chat folders" + } + ] + }, + { + "name": "archiveChatListSettings", + "description": "Contains settings for automatic moving of chats to and from the Archive chat lists", + "class": "ArchiveChatListSettings", + "properties": [ + { + "name": "archive_and_mute_new_chats_from_unknown_users", + "type": "Bool", + "description": "True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option \"can_archive_and_mute_new_chats_from_unknown_users\" is true" + }, + { + "name": "keep_unmuted_chats_archived", + "type": "Bool", + "description": "True, if unmuted chats will be kept in the Archive chat list when they get a new message" + }, + { + "name": "keep_chats_from_folders_archived", + "type": "Bool", + "description": "True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true" } ] }, @@ -3772,14 +5496,14 @@ "properties": [] }, { - "name": "chatListFilter", - "description": "A list of chats belonging to a chat filter", + "name": "chatListFolder", + "description": "A list of chats added to a chat folder", "class": "ChatList", "properties": [ { - "name": "chat_filter_id", + "name": "chat_folder_id", "type": "int32", - "description": "Chat filter identifier" + "description": "Chat folder identifier" } ] }, @@ -3845,6 +5569,24 @@ } ] }, + { + "name": "chatAvailableReactionsAll", + "description": "All reactions are available in the chat", + "class": "ChatAvailableReactions", + "properties": [] + }, + { + "name": "chatAvailableReactionsSome", + "description": "Only specific reactions are available in the chat", + "class": "ChatAvailableReactions", + "properties": [ + { + "name": "reactions", + "type": "vector\u003cReactionType\u003e", + "description": "The list of reactions" + } + ] + }, { "name": "videoChat", "description": "Describes a video chat", @@ -3892,6 +5634,16 @@ "type": "chatPhotoInfo", "description": "Chat photo; may be null" }, + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview" + }, + { + "name": "background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none" + }, { "name": "permissions", "type": "chatPermissions", @@ -3900,7 +5652,7 @@ { "name": "last_message", "type": "message", - "description": "Last message in the chat; may be null" + "description": "Last message in the chat; may be null if none or unknown" }, { "name": "positions", @@ -3912,21 +5664,26 @@ "type": "MessageSender", "description": "Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender" }, + { + "name": "block_list", + "type": "BlockList", + "description": "Block list to which the chat is added; may be null if none" + }, { "name": "has_protected_content", "type": "Bool", "description": "True, if chat content can't be saved locally, forwarded, or copied" }, + { + "name": "is_translatable", + "type": "Bool", + "description": "True, if translation of all messages in the chat must be suggested to the user" + }, { "name": "is_marked_as_unread", "type": "Bool", "description": "True, if the chat is marked as unread" }, - { - "name": "is_blocked", - "type": "Bool", - "description": "True, if the chat is blocked by the current user and private messages from the chat can't be received" - }, { "name": "has_scheduled_messages", "type": "Bool", @@ -3973,14 +5730,29 @@ "description": "Number of unread messages with a mention/reply in the chat" }, { - "name": "notification_settings", - "type": "chatNotificationSettings", - "description": "Notification settings for this chat" + "name": "unread_reaction_count", + "type": "int32", + "description": "Number of messages with unread reactions in the chat" }, { - "name": "message_ttl", + "name": "notification_settings", + "type": "chatNotificationSettings", + "description": "Notification settings for the chat" + }, + { + "name": "available_reactions", + "type": "ChatAvailableReactions", + "description": "Types of reaction, available in the chat" + }, + { + "name": "message_auto_delete_time", "type": "int32", - "description": "Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats" + "description": "Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date" + }, + { + "name": "background", + "type": "chatBackground", + "description": "Background set for the chat; may be null if none" }, { "name": "theme_name", @@ -3990,7 +5762,7 @@ { "name": "action_bar", "type": "ChatActionBar", - "description": "Information about actions which must be possible to do through the chat action bar; may be null" + "description": "Information about actions which must be possible to do through the chat action bar; may be null if none" }, { "name": "video_chat", @@ -4000,7 +5772,7 @@ { "name": "pending_join_requests", "type": "chatJoinRequestsInfo", - "description": "Information about pending join requests; may be null" + "description": "Information about pending join requests; may be null if none" }, { "name": "reply_markup_message_id", @@ -4010,7 +5782,7 @@ { "name": "draft_message", "type": "draftMessage", - "description": "A draft of a message in the chat; may be null" + "description": "A draft of a message in the chat; may be null if none" }, { "name": "client_data", @@ -4027,7 +5799,7 @@ { "name": "total_count", "type": "int32", - "description": "Approximate total count of chats found" + "description": "Approximate total number of chats found" }, { "name": "chat_ids", @@ -4072,7 +5844,7 @@ }, { "name": "publicChatTypeHasUsername", - "description": "The chat is public, because it has username", + "description": "The chat is public, because it has an active username", "class": "PublicChatType", "properties": [] }, @@ -4084,7 +5856,7 @@ }, { "name": "chatActionBarReportSpam", - "description": "The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam", + "description": "The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown", "class": "ChatActionBar", "properties": [ { @@ -4096,7 +5868,7 @@ }, { "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", + "description": "The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation", "class": "ChatActionBar", "properties": [] }, @@ -4108,7 +5880,7 @@ }, { "name": "chatActionBarReportAddBlock", - "description": "The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact", + "description": "The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method setMessageSenderBlockList, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown", "class": "ChatActionBar", "properties": [ { @@ -4192,6 +5964,107 @@ } ] }, + { + "name": "keyboardButtonTypeRequestUser", + "description": "A button that requests a user to be shared by the current user; available only in private chats. Use the method shareUserWithBot to complete the request", + "class": "KeyboardButtonType", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Unique button identifier" + }, + { + "name": "restrict_user_is_bot", + "type": "Bool", + "description": "True, if the shared user must or must not be a bot" + }, + { + "name": "user_is_bot", + "type": "Bool", + "description": "True, if the shared user must be a bot; otherwise, the shared user must no be a bot. Ignored if restrict_user_is_bot is false" + }, + { + "name": "restrict_user_is_premium", + "type": "Bool", + "description": "True, if the shared user must or must not be a Telegram Premium user" + }, + { + "name": "user_is_premium", + "type": "Bool", + "description": "True, if the shared user must be a Telegram Premium user; otherwise, the shared user must no be a Telegram Premium user. Ignored if restrict_user_is_premium is false" + } + ] + }, + { + "name": "keyboardButtonTypeRequestChat", + "description": "A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request", + "class": "KeyboardButtonType", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Unique button identifier" + }, + { + "name": "chat_is_channel", + "type": "Bool", + "description": "True, if the chat must be a channel; otherwise, a basic group or a supergroup chat is shared" + }, + { + "name": "restrict_chat_is_forum", + "type": "Bool", + "description": "True, if the chat must or must not be a forum supergroup" + }, + { + "name": "chat_is_forum", + "type": "Bool", + "description": "True, if the chat must be a forum supergroup; otherwise, the chat must not be a forum supergroup. Ignored if restrict_chat_is_forum is false" + }, + { + "name": "restrict_chat_has_username", + "type": "Bool", + "description": "True, if the chat must or must not have a username" + }, + { + "name": "chat_has_username", + "type": "Bool", + "description": "True, if the chat must have a username; otherwise, the chat must not have a username. Ignored if restrict_chat_has_username is false" + }, + { + "name": "chat_is_created", + "type": "Bool", + "description": "True, if the chat must be created by the current user" + }, + { + "name": "user_administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected user administrator rights in the chat; may be null if they aren't restricted" + }, + { + "name": "bot_administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected bot administrator rights in the chat; may be null if they aren't restricted" + }, + { + "name": "bot_is_member", + "type": "Bool", + "description": "True, if the bot must be a member of the chat; for basic group and supergroup chats only" + } + ] + }, + { + "name": "keyboardButtonTypeWebApp", + "description": "A button that opens a Web App by calling getWebAppUrl", + "class": "KeyboardButtonType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "An HTTP URL to pass to getWebAppUrl" + } + ] + }, { "name": "keyboardButton", "description": "Represents a single button in a bot keyboard", @@ -4223,13 +6096,13 @@ }, { "name": "inlineKeyboardButtonTypeLoginUrl", - "description": "A button that opens a specified URL and automatically authorize the current user if allowed to do so", + "description": "A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo", "class": "InlineKeyboardButtonType", "properties": [ { "name": "url", "type": "string", - "description": "An HTTP URL to open" + "description": "An HTTP URL to pass to getLoginUrlInfo" }, { "name": "id", @@ -4243,6 +6116,18 @@ } ] }, + { + "name": "inlineKeyboardButtonTypeWebApp", + "description": "A button that opens a Web App by calling openWebApp", + "class": "InlineKeyboardButtonType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "An HTTP URL to pass to openWebApp" + } + ] + }, { "name": "inlineKeyboardButtonTypeCallback", "description": "A button that sends a callback query to a bot", @@ -4257,7 +6142,7 @@ }, { "name": "inlineKeyboardButtonTypeCallbackWithPassword", - "description": "A button that asks for password of the current user and then sends a callback query to a bot", + "description": "A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot", "class": "InlineKeyboardButtonType", "properties": [ { @@ -4284,9 +6169,9 @@ "description": "Inline query to be sent to the bot" }, { - "name": "in_current_chat", - "type": "Bool", - "description": "True, if the inline query must be sent from the current chat" + "name": "target_chat", + "type": "TargetChat", + "description": "Target chat from which to send the inline query" } ] }, @@ -4327,7 +6212,7 @@ }, { "name": "replyMarkupRemoveKeyboard", - "description": "Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, UpdateChatReplyMarkup with message_id == 0 will be sent", + "description": "Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 will be sent", "class": "ReplyMarkup", "properties": [ { @@ -4364,6 +6249,11 @@ "type": "vector\u003cvector\u003ckeyboardButton\u003e\u003e", "description": "A list of rows of bot keyboard buttons" }, + { + "name": "is_persistent", + "type": "Bool", + "description": "True, if the keyboard is supposed to always be shown when the ordinary keyboard is hidden" + }, { "name": "resize_keyboard", "type": "Bool", @@ -4400,7 +6290,7 @@ }, { "name": "loginUrlInfoOpen", - "description": "An HTTP url needs to be open", + "description": "An HTTP URL needs to be open", "class": "LoginUrlInfo", "properties": [ { @@ -4409,9 +6299,9 @@ "description": "The URL to open" }, { - "name": "skip_confirm", + "name": "skip_confirmation", "type": "Bool", - "description": "True, if there is no need to show an ordinary open URL confirm" + "description": "True, if there is no need to show an ordinary open URL confirmation" } ] }, @@ -4438,7 +6328,46 @@ { "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" + "description": "True, if the user must be asked for the permission to the bot to send them messages" + } + ] + }, + { + "name": "foundWebApp", + "description": "Contains information about a Web App found by its short name", + "class": "FoundWebApp", + "properties": [ + { + "name": "web_app", + "type": "webApp", + "description": "The Web App" + }, + { + "name": "request_write_access", + "type": "Bool", + "description": "True, if the user must be asked for the permission to the bot to send them messages" + }, + { + "name": "skip_confirmation", + "type": "Bool", + "description": "True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden" + } + ] + }, + { + "name": "webAppInfo", + "description": "Contains information about a Web App", + "class": "WebAppInfo", + "properties": [ + { + "name": "launch_id", + "type": "int64", + "description": "Unique identifier for the Web App launch" + }, + { + "name": "url", + "type": "string", + "description": "A Web App URL to open in a web view" } ] }, @@ -4460,7 +6389,7 @@ { "name": "reply_info", "type": "messageReplyInfo", - "description": "Information about the message thread" + "description": "Information about the message thread; may be null for forum topic threads" }, { "name": "unread_message_count", @@ -4475,7 +6404,197 @@ { "name": "draft_message", "type": "draftMessage", - "description": "A draft of a message in the message thread; may be null" + "description": "A draft of a message in the message thread; may be null if none" + } + ] + }, + { + "name": "forumTopicIcon", + "description": "Describes a forum topic icon", + "class": "ForumTopicIcon", + "properties": [ + { + "name": "color", + "type": "int32", + "description": "Color of the topic icon in RGB format" + }, + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Unique identifier of the custom emoji shown on the topic icon; 0 if none" + } + ] + }, + { + "name": "forumTopicInfo", + "description": "Contains basic information about a forum topic", + "class": "ForumTopicInfo", + "properties": [ + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the topic" + }, + { + "name": "name", + "type": "string", + "description": "Name of the topic" + }, + { + "name": "icon", + "type": "forumTopicIcon", + "description": "Icon of the topic" + }, + { + "name": "creation_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the topic was created" + }, + { + "name": "creator_id", + "type": "MessageSender", + "description": "Identifier of the creator of the topic" + }, + { + "name": "is_general", + "type": "Bool", + "description": "True, if the topic is the General topic list" + }, + { + "name": "is_outgoing", + "type": "Bool", + "description": "True, if the topic was created by the current user" + }, + { + "name": "is_closed", + "type": "Bool", + "description": "True, if the topic is closed" + }, + { + "name": "is_hidden", + "type": "Bool", + "description": "True, if the topic is hidden above the topic list and closed; for General topic only" + } + ] + }, + { + "name": "forumTopic", + "description": "Describes a forum topic", + "class": "ForumTopic", + "properties": [ + { + "name": "info", + "type": "forumTopicInfo", + "description": "Basic information about the topic" + }, + { + "name": "last_message", + "type": "message", + "description": "Last message in the topic; may be null if unknown" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the topic is pinned in the topic list" + }, + { + "name": "unread_count", + "type": "int32", + "description": "Number of unread messages in the topic" + }, + { + "name": "last_read_inbox_message_id", + "type": "int53", + "description": "Identifier of the last read incoming message" + }, + { + "name": "last_read_outbox_message_id", + "type": "int53", + "description": "Identifier of the last read outgoing message" + }, + { + "name": "unread_mention_count", + "type": "int32", + "description": "Number of unread messages with a mention/reply in the topic" + }, + { + "name": "unread_reaction_count", + "type": "int32", + "description": "Number of messages with unread reactions in the topic" + }, + { + "name": "notification_settings", + "type": "chatNotificationSettings", + "description": "Notification settings for the topic" + }, + { + "name": "draft_message", + "type": "draftMessage", + "description": "A draft of a message in the topic; may be null if none" + } + ] + }, + { + "name": "forumTopics", + "description": "Describes a list of forum topics", + "class": "ForumTopics", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of forum topics found" + }, + { + "name": "topics", + "type": "vector\u003cforumTopic\u003e", + "description": "List of forum topics" + }, + { + "name": "next_offset_date", + "type": "int32", + "description": "Offset date for the next getForumTopics request" + }, + { + "name": "next_offset_message_id", + "type": "int53", + "description": "Offset message identifier for the next getForumTopics request" + }, + { + "name": "next_offset_message_thread_id", + "type": "int53", + "description": "Offset message thread identifier for the next getForumTopics request" + } + ] + }, + { + "name": "linkPreviewOptions", + "description": "Options to be used for generation of a link preview", + "class": "LinkPreviewOptions", + "properties": [ + { + "name": "is_disabled", + "type": "Bool", + "description": "True, if link preview must be disabled" + }, + { + "name": "url", + "type": "string", + "description": "URL to use for link preview. If empty, then the first URL found in the message text will be used" + }, + { + "name": "force_small_media", + "type": "Bool", + "description": "True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified" + }, + { + "name": "force_large_media", + "type": "Bool", + "description": "True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified" + }, + { + "name": "show_above_text", + "type": "Bool", + "description": "True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats" } ] }, @@ -5309,10 +7428,15 @@ "type": "chatPhotoInfo", "description": "Chat photo; may be null" }, + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color for chat title and background of chat photo" + }, { "name": "username", "type": "string", - "description": "Chat username, by which all other information about the chat can be resolved" + "description": "Chat username by which all other information about the chat can be resolved" } ] }, @@ -5453,7 +7577,7 @@ }, { "name": "webPage", - "description": "Describes a web page preview", + "description": "Describes a link preview", "class": "WebPage", "properties": [ { @@ -5521,6 +7645,26 @@ "type": "string", "description": "Author of the content" }, + { + "name": "has_large_media", + "type": "Bool", + "description": "True, if the preview has large media and its appearance can be changed" + }, + { + "name": "show_large_media", + "type": "Bool", + "description": "True, if large media preview must be shown" + }, + { + "name": "skip_confirmation", + "type": "Bool", + "description": "True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear" + }, + { + "name": "show_above_text", + "type": "Bool", + "description": "True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text" + }, { "name": "animation", "type": "animation", @@ -5556,10 +7700,20 @@ "type": "voiceNote", "description": "Preview of the content as a voice note, if available; may be null" }, + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the previewed story; 0 if none" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the previewed story; 0 if none" + }, { "name": "instant_view_version", "type": "int32", - "description": "Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none" + "description": "Version of web page instant view (currently, can be 1 or 2); 0 if none" } ] }, @@ -5626,6 +7780,11 @@ "name": "formatted_phone_number", "type": "string", "description": "The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user" + }, + { + "name": "is_anonymous", + "type": "Bool", + "description": "True, if the phone number was bought on Fragment and isn't tied to a SIM card" } ] }, @@ -5700,6 +7859,78 @@ } ] }, + { + "name": "themeParameters", + "description": "Contains parameters of the application theme", + "class": "ThemeParameters", + "properties": [ + { + "name": "background_color", + "type": "int32", + "description": "A color of the background in the RGB24 format" + }, + { + "name": "secondary_background_color", + "type": "int32", + "description": "A secondary color for the background in the RGB24 format" + }, + { + "name": "header_background_color", + "type": "int32", + "description": "A color of the header background in the RGB24 format" + }, + { + "name": "section_background_color", + "type": "int32", + "description": "A color of the section background in the RGB24 format" + }, + { + "name": "text_color", + "type": "int32", + "description": "A color of text in the RGB24 format" + }, + { + "name": "accent_text_color", + "type": "int32", + "description": "An accent color of the text in the RGB24 format" + }, + { + "name": "section_header_text_color", + "type": "int32", + "description": "A color of text on the section headers in the RGB24 format" + }, + { + "name": "subtitle_text_color", + "type": "int32", + "description": "A color of the subtitle text in the RGB24 format" + }, + { + "name": "destructive_text_color", + "type": "int32", + "description": "A color of the text for destructive actions in the RGB24 format" + }, + { + "name": "hint_color", + "type": "int32", + "description": "A color of hints in the RGB24 format" + }, + { + "name": "link_color", + "type": "int32", + "description": "A color of links in the RGB24 format" + }, + { + "name": "button_color", + "type": "int32", + "description": "A color of the buttons in the RGB24 format" + }, + { + "name": "button_text_color", + "type": "int32", + "description": "A color of text on the buttons in the RGB24 format" + } + ] + }, { "name": "labeledPricePart", "description": "Portion of the price of a product (e.g., \"delivery cost\", \"tax amount\")", @@ -5742,6 +7973,16 @@ "type": "vector\u003cint53\u003e", "description": "Suggested amounts of tip in the smallest units of the currency" }, + { + "name": "recurring_payment_terms_of_service_url", + "type": "string", + "description": "An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay" + }, + { + "name": "terms_of_service_url", + "type": "string", + "description": "An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay" + }, { "name": "is_test", "type": "Bool", @@ -5835,7 +8076,7 @@ }, { "name": "savedCredentials", - "description": "Contains information about saved card credentials", + "description": "Contains information about saved payment credentials", "class": "SavedCredentials", "properties": [ { @@ -5904,9 +8145,21 @@ ] }, { - "name": "paymentsProviderStripe", + "name": "paymentProviderSmartGlocal", + "description": "Smart Glocal payment provider", + "class": "PaymentProvider", + "properties": [ + { + "name": "public_token", + "type": "string", + "description": "Public payment token" + } + ] + }, + { + "name": "paymentProviderStripe", "description": "Stripe payment provider", - "class": "PaymentsProviderStripe", + "class": "PaymentProvider", "properties": [ { "name": "publishable_key", @@ -5931,39 +8184,31 @@ ] }, { - "name": "paymentFormTheme", - "description": "Theme colors for a payment form", - "class": "PaymentFormTheme", + "name": "paymentProviderOther", + "description": "Some other payment provider, for which a web payment form must be shown", + "class": "PaymentProvider", "properties": [ { - "name": "background_color", - "type": "int32", - "description": "A color of the payment form background in the RGB24 format" + "name": "url", + "type": "string", + "description": "Payment form URL" + } + ] + }, + { + "name": "paymentOption", + "description": "Describes an additional payment option", + "class": "PaymentOption", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Title for the payment option" }, { - "name": "text_color", - "type": "int32", - "description": "A color of text in the RGB24 format" - }, - { - "name": "hint_color", - "type": "int32", - "description": "A color of hints in the RGB24 format" - }, - { - "name": "link_color", - "type": "int32", - "description": "A color of links in the RGB24 format" - }, - { - "name": "button_color", - "type": "int32", - "description": "A color of the buttons in the RGB24 format" - }, - { - "name": "button_text_color", - "type": "int32", - "description": "A color of text on the buttons in the RGB24 format" + "name": "url", + "type": "string", + "description": "Payment form URL to be opened in a web view" } ] }, @@ -5980,12 +8225,7 @@ { "name": "invoice", "type": "invoice", - "description": "Full information of the invoice" - }, - { - "name": "url", - "type": "string", - "description": "Payment form URL" + "description": "Full information about the invoice" }, { "name": "seller_bot_user_id", @@ -5993,14 +8233,19 @@ "description": "User identifier of the seller bot" }, { - "name": "payments_provider_user_id", + "name": "payment_provider_user_id", "type": "int53", "description": "User identifier of the payment provider bot" }, { - "name": "payments_provider", - "type": "paymentsProviderStripe", - "description": "Information about the payment provider, if available, to support it natively without the need for opening the URL; may be null" + "name": "payment_provider", + "type": "PaymentProvider", + "description": "Information about the payment provider" + }, + { + "name": "additional_payment_options", + "type": "vector\u003cpaymentOption\u003e", + "description": "The list of additional payment options" }, { "name": "saved_order_info", @@ -6009,8 +8254,8 @@ }, { "name": "saved_credentials", - "type": "savedCredentials", - "description": "Information about saved card credentials; may be null" + "type": "vector\u003csavedCredentials\u003e", + "description": "The list of saved payment credentials" }, { "name": "can_save_credentials", @@ -6020,13 +8265,28 @@ { "name": "need_password", "type": "Bool", - "description": "True, if the user will be able to save credentials protected by a password they set up" + "description": "True, if the user will be able to save credentials, if sets up a 2-step verification password" + }, + { + "name": "product_title", + "type": "string", + "description": "Product title" + }, + { + "name": "product_description", + "type": "formattedText", + "description": "Product description" + }, + { + "name": "product_photo", + "type": "photo", + "description": "Product photo; may be null" } ] }, { "name": "validatedOrderInfo", - "description": "Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options", + "description": "Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options", "class": "ValidatedOrderInfo", "properties": [ { @@ -6049,7 +8309,7 @@ { "name": "success", "type": "Bool", - "description": "True, if the payment request was successful; otherwise the verification_url will be non-empty" + "description": "True, if the payment request was successful; otherwise, the verification_url will be non-empty" }, { "name": "verification_url", @@ -6070,7 +8330,7 @@ }, { "name": "description", - "type": "string", + "type": "formattedText", "description": "Product description" }, { @@ -6089,7 +8349,7 @@ "description": "User identifier of the seller bot" }, { - "name": "payments_provider_user_id", + "name": "payment_provider_user_id", "type": "int53", "description": "User identifier of the payment provider bot" }, @@ -6120,6 +8380,157 @@ } ] }, + { + "name": "inputInvoiceMessage", + "description": "An invoice from a message of the type messageInvoice", + "class": "InputInvoice", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + } + ] + }, + { + "name": "inputInvoiceName", + "description": "An invoice from a link of the type internalLinkTypeInvoice", + "class": "InputInvoice", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Name of the invoice" + } + ] + }, + { + "name": "inputInvoiceTelegram", + "description": "An invoice for a payment toward Telegram; must not be used in the in-store apps", + "class": "InputInvoice", + "properties": [ + { + "name": "purpose", + "type": "TelegramPaymentPurpose", + "description": "Transaction purpose" + } + ] + }, + { + "name": "messageExtendedMediaPreview", + "description": "The media is hidden until the invoice is paid", + "class": "MessageExtendedMedia", + "properties": [ + { + "name": "width", + "type": "int32", + "description": "Media width; 0 if unknown" + }, + { + "name": "height", + "type": "int32", + "description": "Media height; 0 if unknown" + }, + { + "name": "duration", + "type": "int32", + "description": "Media duration; 0 if unknown" + }, + { + "name": "minithumbnail", + "type": "minithumbnail", + "description": "Media minithumbnail; may be null" + }, + { + "name": "caption", + "type": "formattedText", + "description": "Media caption" + } + ] + }, + { + "name": "messageExtendedMediaPhoto", + "description": "The media is a photo", + "class": "MessageExtendedMedia", + "properties": [ + { + "name": "photo", + "type": "photo", + "description": "The photo" + }, + { + "name": "caption", + "type": "formattedText", + "description": "Photo caption" + } + ] + }, + { + "name": "messageExtendedMediaVideo", + "description": "The media is a video", + "class": "MessageExtendedMedia", + "properties": [ + { + "name": "video", + "type": "video", + "description": "The video" + }, + { + "name": "caption", + "type": "formattedText", + "description": "Photo caption" + } + ] + }, + { + "name": "messageExtendedMediaUnsupported", + "description": "The media is unsupported", + "class": "MessageExtendedMedia", + "properties": [ + { + "name": "caption", + "type": "formattedText", + "description": "Media caption" + } + ] + }, + { + "name": "premiumGiveawayParameters", + "description": "Describes parameters of a Telegram Premium giveaway", + "class": "PremiumGiveawayParameters", + "properties": [ + { + "name": "boosted_chat_id", + "type": "int53", + "description": "Identifier of the channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription" + }, + { + "name": "additional_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of other channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption(\"giveaway_additional_chat_count_max\") additional chats" + }, + { + "name": "winners_selection_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption(\"giveaway_duration_max\") seconds in the future in scheduled giveaways" + }, + { + "name": "only_new_members", + "type": "Bool", + "description": "True, if only new subscribers of the chats will be eligible for the giveaway" + }, + { + "name": "country_codes", + "type": "vector\u003cstring\u003e", + "description": "The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption(\"giveaway_country_count_max\") chosen countries. Users with phone number that was bought on Fragment can participate in any giveaway and the country code \"FT\" must not be specified in the list" + } + ] + }, { "name": "datedFile", "description": "File with the date it was uploaded", @@ -6305,9 +8716,9 @@ "description": "Document number; 1-24 characters" }, { - "name": "expiry_date", + "name": "expiration_date", "type": "date", - "description": "Document expiry date; may be null if not applicable" + "description": "Document expiration date; may be null if not applicable" }, { "name": "front_side", @@ -6342,9 +8753,9 @@ "description": "Document number; 1-24 characters" }, { - "name": "expiry_date", + "name": "expiration_date", "type": "date", - "description": "Document expiry date; pass null if not applicable" + "description": "Document expiration date; pass null if not applicable" }, { "name": "front_side", @@ -7120,7 +9531,12 @@ { "name": "web_page", "type": "webPage", - "description": "A preview of the web page that's mentioned in the text; may be null" + "description": "A link preview attached to the message; may be null" + }, + { + "name": "link_preview_options", + "type": "linkPreviewOptions", + "description": "Options which was used for generation of the link preview; may be null if default options were used" } ] }, @@ -7139,6 +9555,11 @@ "type": "formattedText", "description": "Animation caption" }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the animation preview must be covered by a spoiler animation" + }, { "name": "is_secret", "type": "Bool", @@ -7188,13 +9609,18 @@ { "name": "photo", "type": "photo", - "description": "The photo description" + "description": "The photo" }, { "name": "caption", "type": "formattedText", "description": "Photo caption" }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the photo preview must be covered by a spoiler animation" + }, { "name": "is_secret", "type": "Bool", @@ -7204,7 +9630,7 @@ }, { "name": "messageExpiredPhoto", - "description": "An expired photo message (self-destructed after TTL has elapsed)", + "description": "A self-destructed photo message", "class": "MessageContent", "properties": [] }, @@ -7217,6 +9643,11 @@ "name": "sticker", "type": "sticker", "description": "The sticker description" + }, + { + "name": "is_premium", + "type": "Bool", + "description": "True, if premium animation of the sticker must be played" } ] }, @@ -7235,6 +9666,11 @@ "type": "formattedText", "description": "Video caption" }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the video preview must be covered by a spoiler animation" + }, { "name": "is_secret", "type": "Bool", @@ -7244,7 +9680,7 @@ }, { "name": "messageExpiredVideo", - "description": "An expired video message (self-destructed after TTL has elapsed)", + "description": "A self-destructed video message", "class": "MessageContent", "properties": [] }, @@ -7320,7 +9756,7 @@ { "name": "proximity_alert_radius", "type": "int32", - "description": "For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only for the message sender" + "description": "For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only to the message sender" } ] }, @@ -7421,9 +9857,31 @@ } ] }, + { + "name": "messageStory", + "description": "A message with a forwarded story", + "class": "MessageContent", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + }, + { + "name": "via_mention", + "type": "Bool", + "description": "True, if the story was automatically forwarded because of a mention of the user" + } + ] + }, { "name": "messageInvoice", - "description": "A message with an invoice from a bot", + "description": "A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice", "class": "MessageContent", "properties": [ { @@ -7433,7 +9891,7 @@ }, { "name": "description", - "type": "string", + "type": "formattedText", "description": "Product description" }, { @@ -7454,7 +9912,7 @@ { "name": "start_parameter", "type": "string", - "description": "Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter}" + "description": "Unique invoice bot start_parameter to be passed to getInternalLink" }, { "name": "is_test", @@ -7470,6 +9928,11 @@ "name": "receipt_message_id", "type": "int53", "description": "The identifier of the message with the receipt, after the product has been purchased" + }, + { + "name": "extended_media", + "type": "MessageExtendedMedia", + "description": "Extended media attached to the invoice; may be null" } ] }, @@ -7695,6 +10158,23 @@ "class": "MessageContent", "properties": [] }, + { + "name": "messageChatSetBackground", + "description": "A new background was set in the chat", + "class": "MessageContent", + "properties": [ + { + "name": "old_background_message_id", + "type": "int53", + "description": "Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message" + }, + { + "name": "background", + "type": "chatBackground", + "description": "The new background" + } + ] + }, { "name": "messageChatSetTheme", "description": "A theme in the chat has been changed", @@ -7703,19 +10183,99 @@ { "name": "theme_name", "type": "string", - "description": "If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one" + "description": "If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one" } ] }, { - "name": "messageChatSetTtl", - "description": "The TTL (Time To Live) setting for messages in the chat has been changed", + "name": "messageChatSetMessageAutoDeleteTime", + "description": "The auto-delete or self-destruct timer for messages in the chat has been changed", "class": "MessageContent", "properties": [ { - "name": "ttl", + "name": "message_auto_delete_time", "type": "int32", - "description": "New message TTL" + "description": "New value auto-delete or self-destruct time, in seconds; 0 if disabled" + }, + { + "name": "from_user_id", + "type": "int53", + "description": "If not 0, a user identifier, which default setting was automatically applied" + } + ] + }, + { + "name": "messageForumTopicCreated", + "description": "A forum topic has been created", + "class": "MessageContent", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Name of the topic" + }, + { + "name": "icon", + "type": "forumTopicIcon", + "description": "Icon of the topic" + } + ] + }, + { + "name": "messageForumTopicEdited", + "description": "A forum topic has been edited", + "class": "MessageContent", + "properties": [ + { + "name": "name", + "type": "string", + "description": "If non-empty, the new name of the topic" + }, + { + "name": "edit_icon_custom_emoji_id", + "type": "Bool", + "description": "True, if icon's custom_emoji_id is changed" + }, + { + "name": "icon_custom_emoji_id", + "type": "int64", + "description": "New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false" + } + ] + }, + { + "name": "messageForumTopicIsClosedToggled", + "description": "A forum topic has been closed or opened", + "class": "MessageContent", + "properties": [ + { + "name": "is_closed", + "type": "Bool", + "description": "True, if the topic was closed; otherwise, the topic was reopened" + } + ] + }, + { + "name": "messageForumTopicIsHiddenToggled", + "description": "A General forum topic has been hidden or unhidden", + "class": "MessageContent", + "properties": [ + { + "name": "is_hidden", + "type": "Bool", + "description": "True, if the topic was hidden; otherwise, the topic was unhidden" + } + ] + }, + { + "name": "messageSuggestProfilePhoto", + "description": "A profile photo was suggested to a user in a private chat", + "class": "MessageContent", + "properties": [ + { + "name": "photo", + "type": "chatPhoto", + "description": "The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo" } ] }, @@ -7761,12 +10321,12 @@ { "name": "invoice_chat_id", "type": "int53", - "description": "Identifier of the chat, containing the corresponding invoice message; 0 if unknown" + "description": "Identifier of the chat, containing the corresponding invoice message" }, { "name": "invoice_message_id", "type": "int53", - "description": "Identifier of the message with the corresponding invoice; can be an identifier of a deleted message" + "description": "Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message" }, { "name": "currency", @@ -7777,6 +10337,21 @@ "name": "total_amount", "type": "int53", "description": "Total price for the product, in the smallest units of the currency" + }, + { + "name": "is_recurring", + "type": "Bool", + "description": "True, if this is a recurring payment" + }, + { + "name": "is_first_recurring", + "type": "Bool", + "description": "True, if this is the first recurring payment" + }, + { + "name": "invoice_name", + "type": "string", + "description": "Name of the invoice; may be empty if unknown" } ] }, @@ -7795,6 +10370,16 @@ "type": "int53", "description": "Total price for the product, in the smallest units of the currency" }, + { + "name": "is_recurring", + "type": "Bool", + "description": "True, if this is a recurring payment" + }, + { + "name": "is_first_recurring", + "type": "Bool", + "description": "True, if this is the first recurring payment" + }, { "name": "invoice_payload", "type": "bytes", @@ -7822,6 +10407,118 @@ } ] }, + { + "name": "messageGiftedPremium", + "description": "Telegram Premium was gifted to the user", + "class": "MessageContent", + "properties": [ + { + "name": "gifter_user_id", + "type": "int53", + "description": "The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous" + }, + { + "name": "currency", + "type": "string", + "description": "Currency for the paid amount" + }, + { + "name": "amount", + "type": "int53", + "description": "The paid amount, in the smallest units of the currency" + }, + { + "name": "cryptocurrency", + "type": "string", + "description": "Cryptocurrency used to pay for the gift; may be empty if none" + }, + { + "name": "cryptocurrency_amount", + "type": "int64", + "description": "The paid amount, in the smallest units of the cryptocurrency" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active" + }, + { + "name": "sticker", + "type": "sticker", + "description": "A sticker to be shown in the message; may be null if unknown" + } + ] + }, + { + "name": "messagePremiumGiftCode", + "description": "A Telegram Premium gift code was created for the user", + "class": "MessageContent", + "properties": [ + { + "name": "creator_id", + "type": "MessageSender", + "description": "Identifier of a chat or a user that created the gift code" + }, + { + "name": "is_from_giveaway", + "type": "Bool", + "description": "True, if the gift code was created for a giveaway" + }, + { + "name": "is_unclaimed", + "type": "Bool", + "description": "True, if the winner for the corresponding Telegram Premium subscription wasn't chosen" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active after code activation" + }, + { + "name": "sticker", + "type": "sticker", + "description": "A sticker to be shown in the message; may be null if unknown" + }, + { + "name": "code", + "type": "string", + "description": "The gift code" + } + ] + }, + { + "name": "messagePremiumGiveawayCreated", + "description": "A Telegram Premium giveaway was created for the chat", + "class": "MessageContent", + "properties": [] + }, + { + "name": "messagePremiumGiveaway", + "description": "A Telegram Premium giveaway", + "class": "MessageContent", + "properties": [ + { + "name": "parameters", + "type": "premiumGiveawayParameters", + "description": "Giveaway parameters" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Number of users which will receive Telegram Premium subscription gift codes" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active after code activation" + }, + { + "name": "sticker", + "type": "sticker", + "description": "A sticker to be shown in the message; may be null if unknown" + } + ] + }, { "name": "messageContactRegistered", "description": "A contact has registered with Telegram", @@ -7829,20 +10526,83 @@ "properties": [] }, { - "name": "messageWebsiteConnected", - "description": "The current user has connected a website by logging in using Telegram Login Widget on it", + "name": "messageUserShared", + "description": "The current user shared a user, which was requested by the bot", "class": "MessageContent", "properties": [ { - "name": "domain_name", + "name": "user_id", + "type": "int53", + "description": "Identifier of the shared user" + }, + { + "name": "button_id", + "type": "int32", + "description": "Identifier of the keyboard button with the request" + } + ] + }, + { + "name": "messageChatShared", + "description": "The current user shared a chat, which was requested by the bot", + "class": "MessageContent", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the shared chat" + }, + { + "name": "button_id", + "type": "int32", + "description": "Identifier of the keyboard button with the request" + } + ] + }, + { + "name": "messageBotWriteAccessAllowed", + "description": "The user allowed the bot to send messages", + "class": "MessageContent", + "properties": [ + { + "name": "reason", + "type": "BotWriteAccessAllowReason", + "description": "The reason why the bot was allowed to write messages" + } + ] + }, + { + "name": "messageWebAppDataSent", + "description": "Data from a Web App has been sent to a bot", + "class": "MessageContent", + "properties": [ + { + "name": "button_text", "type": "string", - "description": "Domain name of the connected website" + "description": "Text of the keyboardButtonTypeWebApp button, which opened the Web App" + } + ] + }, + { + "name": "messageWebAppDataReceived", + "description": "Data from a Web App has been received; for bots only", + "class": "MessageContent", + "properties": [ + { + "name": "button_text", + "type": "string", + "description": "Text of the keyboardButtonTypeWebApp button, which opened the Web App" + }, + { + "name": "data", + "type": "string", + "description": "The data" } ] }, { "name": "messagePassportDataSent", - "description": "Telegram Passport data has been sent", + "description": "Telegram Passport data has been sent to a bot", "class": "MessageContent", "properties": [ { @@ -7893,13 +10653,13 @@ }, { "name": "messageUnsupported", - "description": "Message content that is not supported in the current TDLib version", + "description": "A message content that is not supported in the current TDLib version", "class": "MessageContent", "properties": [] }, { "name": "textEntityTypeMention", - "description": "A mention of a user by their username", + "description": "A mention of a user, a supergroup, or a channel by their username", "class": "TextEntityType", "properties": [] }, @@ -7969,6 +10729,12 @@ "class": "TextEntityType", "properties": [] }, + { + "name": "textEntityTypeSpoiler", + "description": "A spoiler text", + "class": "TextEntityType", + "properties": [] + }, { "name": "textEntityTypeCode", "description": "Text that must be formatted as if inside a code HTML tag", @@ -7993,6 +10759,12 @@ } ] }, + { + "name": "textEntityTypeBlockQuote", + "description": "Text that must be formatted as if inside a blockquote HTML tag", + "class": "TextEntityType", + "properties": [] + }, { "name": "textEntityTypeTextUrl", "description": "A text description shown instead of a raw URL", @@ -8017,6 +10789,18 @@ } ] }, + { + "name": "textEntityTypeCustomEmoji", + "description": "A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji", + "class": "TextEntityType", + "properties": [ + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Unique identifier of the custom emoji" + } + ] + }, { "name": "textEntityTypeMediaTimestamp", "description": "A media timestamp", @@ -8025,7 +10809,7 @@ { "name": "media_timestamp", "type": "int32", - "description": "Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message" + "description": "Timestamp from which a video/audio/video note/voice note/story playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message" } ] }, @@ -8059,7 +10843,7 @@ { "name": "send_date", "type": "int32", - "description": "Date the message will be sent. The date must be within 367 days in the future" + "description": "Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future" } ] }, @@ -8069,6 +10853,24 @@ "class": "MessageSchedulingState", "properties": [] }, + { + "name": "messageSelfDestructTypeTimer", + "description": "The message will be self-destructed in the specified time after its content was opened", + "class": "MessageSelfDestructType", + "properties": [ + { + "name": "self_destruct_time", + "type": "int32", + "description": "The message's self-destruct time, in seconds; must be between 0 and 60 in private chats" + } + ] + }, + { + "name": "messageSelfDestructTypeImmediately", + "description": "The message can be opened only once and will be self-destructed once closed", + "class": "MessageSelfDestructType", + "properties": [] + }, { "name": "messageSendOptions", "description": "Options to be used when a message is sent", @@ -8084,16 +10886,36 @@ "type": "Bool", "description": "Pass true if the message is sent from the background" }, + { + "name": "protect_content", + "type": "Bool", + "description": "Pass true if the content of the message must be protected from forwarding and saving; for bots only" + }, + { + "name": "update_order_of_installed_sticker_sets", + "type": "Bool", + "description": "Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum" + }, { "name": "scheduling_state", "type": "MessageSchedulingState", "description": "Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled" + }, + { + "name": "sending_id", + "type": "int32", + "description": "Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates" + }, + { + "name": "only_preview", + "type": "Bool", + "description": "Pass true to get a fake message instead of actually sending them" } ] }, { "name": "messageCopyOptions", - "description": "Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied", + "description": "Options to be used when a message content is copied without reference to the original sender. Service messages, and messages with messageInvoice or messagePremiumGiveaway content can't be copied", "class": "MessageCopyOptions", "properties": [ { @@ -8121,12 +10943,12 @@ { "name": "text", "type": "formattedText", - "description": "Formatted text to be sent; 1-GetOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" + "description": "Formatted text to be sent; 0-getOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" }, { - "name": "disable_web_page_preview", - "type": "Bool", - "description": "True, if rich web page previews for URLs in the message text must be disabled" + "name": "link_preview_options", + "type": "linkPreviewOptions", + "description": "Options to be used for generation of a link preview; pass null to use default link preview options" }, { "name": "clear_draft", @@ -8173,7 +10995,12 @@ { "name": "caption", "type": "formattedText", - "description": "Animation caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Animation caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" + }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the animation preview must be covered by a spoiler animation; not supported in secret chats" } ] }, @@ -8210,7 +11037,7 @@ { "name": "caption", "type": "formattedText", - "description": "Audio caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Audio caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" } ] }, @@ -8232,12 +11059,12 @@ { "name": "disable_content_type_detection", "type": "Bool", - "description": "If true, automatic file type detection will be disabled and the document will be always sent as file. Always true for files sent to secret chats" + "description": "If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats" }, { "name": "caption", "type": "formattedText", - "description": "Document caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Document caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" } ] }, @@ -8249,7 +11076,7 @@ { "name": "photo", "type": "InputFile", - "description": "Photo to send" + "description": "Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20" }, { "name": "thumbnail", @@ -8274,12 +11101,17 @@ { "name": "caption", "type": "formattedText", - "description": "Photo caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Photo caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" }, { - "name": "ttl", - "type": "int32", - "description": "Photo TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats" + "name": "self_destruct_type", + "type": "MessageSelfDestructType", + "description": "Photo self-destruct type; pass null if none; private chats only" + }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the photo preview must be covered by a spoiler animation; not supported in secret chats" } ] }, @@ -8358,12 +11190,17 @@ { "name": "caption", "type": "formattedText", - "description": "Video caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Video caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" }, { - "name": "ttl", - "type": "int32", - "description": "Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats" + "name": "self_destruct_type", + "type": "MessageSelfDestructType", + "description": "Video self-destruct type; pass null if none; private chats only" + }, + { + "name": "has_spoiler", + "type": "Bool", + "description": "True, if the video preview must be covered by a spoiler animation; not supported in secret chats" } ] }, @@ -8412,12 +11249,12 @@ { "name": "waveform", "type": "bytes", - "description": "Waveform representation of the voice note, in 5-bit format" + "description": "Waveform representation of the voice note in 5-bit format" }, { "name": "caption", "type": "formattedText", - "description": "Voice note caption; pass null to use an empty caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "Voice note caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" } ] }, @@ -8565,6 +11402,11 @@ "name": "start_parameter", "type": "string", "description": "Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message" + }, + { + "name": "extended_media_content", + "type": "InputMessageContent", + "description": "The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo" } ] }, @@ -8610,6 +11452,23 @@ } ] }, + { + "name": "inputMessageStory", + "description": "A message with a forwarded story. Stories can't be sent to secret chats. A story can be forwarded only if story.can_be_forwarded", + "class": "InputMessageContent", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + } + ] + }, { "name": "inputMessageForwarded", "description": "A forwarded message", @@ -8623,7 +11482,7 @@ { "name": "message_id", "type": "int53", - "description": "Identifier of the message to forward" + "description": "Identifier of the message to forward. A message can be forwarded only if message.can_be_forwarded" }, { "name": "in_game_share", @@ -8721,6 +11580,12 @@ "class": "SearchMessagesFilter", "properties": [] }, + { + "name": "searchMessagesFilterUnreadReaction", + "description": "Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user", + "class": "SearchMessagesFilter", + "properties": [] + }, { "name": "searchMessagesFilterFailedToSend", "description": "Returns only failed to send messages. This filter can be used only if the message database is used", @@ -8954,7 +11819,7 @@ { "name": "thumbnail", "type": "thumbnail", - "description": "Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed" + "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed" }, { "name": "thumbnail_outline", @@ -8977,14 +11842,19 @@ "description": "True, if the sticker set is official" }, { - "name": "is_animated", - "type": "Bool", - "description": "True, is the stickers in the set are animated" + "name": "sticker_format", + "type": "StickerFormat", + "description": "Format of the stickers in the set" }, { - "name": "is_masks", + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers in the set" + }, + { + "name": "needs_repainting", "type": "Bool", - "description": "True, if the stickers in the set are masks" + "description": "True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only" }, { "name": "is_viewed", @@ -9026,7 +11896,7 @@ { "name": "thumbnail", "type": "thumbnail", - "description": "Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null" + "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null" }, { "name": "thumbnail_outline", @@ -9049,14 +11919,19 @@ "description": "True, if the sticker set is official" }, { - "name": "is_animated", - "type": "Bool", - "description": "True, is the stickers in the set are animated" + "name": "sticker_format", + "type": "StickerFormat", + "description": "Format of the stickers in the set" }, { - "name": "is_masks", + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers in the set" + }, + { + "name": "needs_repainting", "type": "Bool", - "description": "True, if the stickers in the set are masks" + "description": "True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only" }, { "name": "is_viewed", @@ -9092,6 +11967,922 @@ } ] }, + { + "name": "trendingStickerSets", + "description": "Represents a list of trending sticker sets", + "class": "TrendingStickerSets", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of trending sticker sets" + }, + { + "name": "sets", + "type": "vector\u003cstickerSetInfo\u003e", + "description": "List of trending sticker sets" + }, + { + "name": "is_premium", + "type": "Bool", + "description": "True, if the list contains sticker sets with premium stickers" + } + ] + }, + { + "name": "emojiCategory", + "description": "Contains a list of similar emoji to search for in getStickers and searchStickers", + "class": "EmojiCategory", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Name of the category" + }, + { + "name": "icon", + "type": "sticker", + "description": "Custom emoji sticker, which represents icon of the category" + }, + { + "name": "emojis", + "type": "vector\u003cstring\u003e", + "description": "List of emojis in the category" + } + ] + }, + { + "name": "emojiCategories", + "description": "Represents a list of emoji categories", + "class": "EmojiCategories", + "properties": [ + { + "name": "categories", + "type": "vector\u003cemojiCategory\u003e", + "description": "List of categories" + } + ] + }, + { + "name": "emojiCategoryTypeDefault", + "description": "The category must be used by default", + "class": "EmojiCategoryType", + "properties": [] + }, + { + "name": "emojiCategoryTypeEmojiStatus", + "description": "The category must be used for emoji status selection", + "class": "EmojiCategoryType", + "properties": [] + }, + { + "name": "emojiCategoryTypeChatPhoto", + "description": "The category must be used for chat photo emoji selection", + "class": "EmojiCategoryType", + "properties": [] + }, + { + "name": "storyViewer", + "description": "Represents a viewer of a story", + "class": "StoryViewer", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier of the viewer" + }, + { + "name": "view_date", + "type": "int32", + "description": "Approximate point in time (Unix timestamp) when the story was viewed" + }, + { + "name": "block_list", + "type": "BlockList", + "description": "Block list to which the user is added; may be null if none" + }, + { + "name": "chosen_reaction_type", + "type": "ReactionType", + "description": "Type of the reaction that was chosen by the user; may be null if none" + } + ] + }, + { + "name": "storyViewers", + "description": "Represents a list of story viewers", + "class": "StoryViewers", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of story viewers found" + }, + { + "name": "total_reaction_count", + "type": "int32", + "description": "Approximate total number of reactions set by found story viewers" + }, + { + "name": "viewers", + "type": "vector\u003cstoryViewer\u003e", + "description": "List of story viewers" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, there are no more results" + } + ] + }, + { + "name": "storyAreaPosition", + "description": "Describes position of a clickable rectangle area on a story media", + "class": "StoryAreaPosition", + "properties": [ + { + "name": "x_percentage", + "type": "double", + "description": "The abscissa of the rectangle's center, as a percentage of the media width" + }, + { + "name": "y_percentage", + "type": "double", + "description": "The ordinate of the rectangle's center, as a percentage of the media height" + }, + { + "name": "width_percentage", + "type": "double", + "description": "The width of the rectangle, as a percentage of the media width" + }, + { + "name": "height_percentage", + "type": "double", + "description": "The height of the rectangle, as a percentage of the media height" + }, + { + "name": "rotation_angle", + "type": "double", + "description": "Clockwise rotation angle of the rectangle, in degrees; 0-360" + } + ] + }, + { + "name": "storyAreaTypeLocation", + "description": "An area pointing to a location", + "class": "StoryAreaType", + "properties": [ + { + "name": "location", + "type": "location", + "description": "The location" + } + ] + }, + { + "name": "storyAreaTypeVenue", + "description": "An area pointing to a venue", + "class": "StoryAreaType", + "properties": [ + { + "name": "venue", + "type": "venue", + "description": "Information about the venue" + } + ] + }, + { + "name": "storyAreaTypeSuggestedReaction", + "description": "An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked", + "class": "StoryAreaType", + "properties": [ + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "total_count", + "type": "int32", + "description": "Number of times the reaction was added" + }, + { + "name": "is_dark", + "type": "Bool", + "description": "True, if reaction has a dark background" + }, + { + "name": "is_flipped", + "type": "Bool", + "description": "True, if reaction corner is flipped" + } + ] + }, + { + "name": "storyArea", + "description": "Describes a clickable rectangle area on a story media", + "class": "StoryArea", + "properties": [ + { + "name": "position", + "type": "storyAreaPosition", + "description": "Position of the area" + }, + { + "name": "type", + "type": "StoryAreaType", + "description": "Type of the area" + } + ] + }, + { + "name": "inputStoryAreaTypeLocation", + "description": "An area pointing to a location", + "class": "InputStoryAreaType", + "properties": [ + { + "name": "location", + "type": "location", + "description": "The location" + } + ] + }, + { + "name": "inputStoryAreaTypeFoundVenue", + "description": "An area pointing to a venue found by the bot getOption(\"venue_search_bot_username\")", + "class": "InputStoryAreaType", + "properties": [ + { + "name": "query_id", + "type": "int64", + "description": "Identifier of the inline query, used to found the venue" + }, + { + "name": "result_id", + "type": "string", + "description": "Identifier of the inline query result" + } + ] + }, + { + "name": "inputStoryAreaTypePreviousVenue", + "description": "An area pointing to a venue already added to the story", + "class": "InputStoryAreaType", + "properties": [ + { + "name": "venue_provider", + "type": "string", + "description": "Provider of the venue" + }, + { + "name": "venue_id", + "type": "string", + "description": "Identifier of the venue in the provider database" + } + ] + }, + { + "name": "inputStoryAreaTypeSuggestedReaction", + "description": "An area pointing to a suggested reaction", + "class": "InputStoryAreaType", + "properties": [ + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "is_dark", + "type": "Bool", + "description": "True, if reaction has a dark background" + }, + { + "name": "is_flipped", + "type": "Bool", + "description": "True, if reaction corner is flipped" + } + ] + }, + { + "name": "inputStoryArea", + "description": "Describes a clickable rectangle area on a story media to be added", + "class": "InputStoryArea", + "properties": [ + { + "name": "position", + "type": "storyAreaPosition", + "description": "Position of the area" + }, + { + "name": "type", + "type": "InputStoryAreaType", + "description": "Type of the area" + } + ] + }, + { + "name": "inputStoryAreas", + "description": "Contains a list of story areas to be added", + "class": "InputStoryAreas", + "properties": [ + { + "name": "areas", + "type": "vector\u003cinputStoryArea\u003e", + "description": "List of 0-10 input story areas" + } + ] + }, + { + "name": "storyVideo", + "description": "Describes a video file sent in a story", + "class": "StoryVideo", + "properties": [ + { + "name": "duration", + "type": "double", + "description": "Duration of the video, in seconds" + }, + { + "name": "width", + "type": "int32", + "description": "Video width" + }, + { + "name": "height", + "type": "int32", + "description": "Video height" + }, + { + "name": "has_stickers", + "type": "Bool", + "description": "True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets" + }, + { + "name": "is_animation", + "type": "Bool", + "description": "True, if the video has no sound" + }, + { + "name": "minithumbnail", + "type": "minithumbnail", + "description": "Video minithumbnail; may be null" + }, + { + "name": "thumbnail", + "type": "thumbnail", + "description": "Video thumbnail in JPEG or MPEG4 format; may be null" + }, + { + "name": "preload_prefix_size", + "type": "int32", + "description": "Size of file prefix, which is supposed to be preloaded, in bytes" + }, + { + "name": "video", + "type": "file", + "description": "File containing the video" + } + ] + }, + { + "name": "storyContentPhoto", + "description": "A photo story", + "class": "StoryContent", + "properties": [ + { + "name": "photo", + "type": "photo", + "description": "The photo" + } + ] + }, + { + "name": "storyContentVideo", + "description": "A video story", + "class": "StoryContent", + "properties": [ + { + "name": "video", + "type": "storyVideo", + "description": "The video in MPEG4 format" + }, + { + "name": "alternative_video", + "type": "storyVideo", + "description": "Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null" + } + ] + }, + { + "name": "storyContentUnsupported", + "description": "A story content that is not supported in the current TDLib version", + "class": "StoryContent", + "properties": [] + }, + { + "name": "inputStoryContentPhoto", + "description": "A photo story", + "class": "InputStoryContent", + "properties": [ + { + "name": "photo", + "type": "InputFile", + "description": "Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920" + }, + { + "name": "added_sticker_file_ids", + "type": "vector\u003cint32\u003e", + "description": "File identifiers of the stickers added to the photo, if applicable" + } + ] + }, + { + "name": "inputStoryContentVideo", + "description": "A video story", + "class": "InputStoryContent", + "properties": [ + { + "name": "video", + "type": "InputFile", + "description": "Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second" + }, + { + "name": "added_sticker_file_ids", + "type": "vector\u003cint32\u003e", + "description": "File identifiers of the stickers added to the video, if applicable" + }, + { + "name": "duration", + "type": "double", + "description": "Precise duration of the video, in seconds; 0-60" + }, + { + "name": "is_animation", + "type": "Bool", + "description": "True, if the video has no sound" + } + ] + }, + { + "name": "storyListMain", + "description": "The list of stories, shown in the main chat list and folder chat lists", + "class": "StoryList", + "properties": [] + }, + { + "name": "storyListArchive", + "description": "The list of stories, shown in the Arvhive chat list", + "class": "StoryList", + "properties": [] + }, + { + "name": "storyInteractionInfo", + "description": "Contains information about interactions with a story", + "class": "StoryInteractionInfo", + "properties": [ + { + "name": "view_count", + "type": "int32", + "description": "Number of times the story was viewed" + }, + { + "name": "forward_count", + "type": "int32", + "description": "Number of times the story was forwarded; 0 if none or unknown" + }, + { + "name": "reaction_count", + "type": "int32", + "description": "Number of reactions added to the story; 0 if none or unknown" + }, + { + "name": "recent_viewer_user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of at most 3 recent viewers of the story" + } + ] + }, + { + "name": "story", + "description": "Represents a story", + "class": "Story", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Unique story identifier among stories of the given sender" + }, + { + "name": "sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the story was published" + }, + { + "name": "is_being_sent", + "type": "Bool", + "description": "True, if the story is being sent by the current user" + }, + { + "name": "is_being_edited", + "type": "Bool", + "description": "True, if the story is being edited by the current user" + }, + { + "name": "is_edited", + "type": "Bool", + "description": "True, if the story was edited" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the story is saved in the sender's profile and will be available there after expiration" + }, + { + "name": "is_visible_only_for_self", + "type": "Bool", + "description": "True, if the story is visible only for the current user" + }, + { + "name": "can_be_deleted", + "type": "Bool", + "description": "True, if the story can be deleted" + }, + { + "name": "can_be_edited", + "type": "Bool", + "description": "True, if the story can be edited" + }, + { + "name": "can_be_forwarded", + "type": "Bool", + "description": "True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden" + }, + { + "name": "can_be_replied", + "type": "Bool", + "description": "True, if the story can be replied in the chat with the story sender" + }, + { + "name": "can_toggle_is_pinned", + "type": "Bool", + "description": "True, if the story's is_pinned value can be changed" + }, + { + "name": "can_get_viewers", + "type": "Bool", + "description": "True, if users viewed the story can be received through getStoryViewers" + }, + { + "name": "has_expired_viewers", + "type": "Bool", + "description": "True, if users viewed the story can't be received, because the story has expired more than getOption(\"story_viewers_expiration_delay\") seconds ago" + }, + { + "name": "interaction_info", + "type": "storyInteractionInfo", + "description": "Information about interactions with the story; may be null if the story isn't owned or there were no interactions" + }, + { + "name": "chosen_reaction_type", + "type": "ReactionType", + "description": "Type of the chosen reaction; may be null if none" + }, + { + "name": "privacy_settings", + "type": "StoryPrivacySettings", + "description": "Privacy rules affecting story visibility; may be approximate for non-owned stories" + }, + { + "name": "content", + "type": "StoryContent", + "description": "Content of the story" + }, + { + "name": "areas", + "type": "vector\u003cstoryArea\u003e", + "description": "Clickable areas to be shown on the story content" + }, + { + "name": "caption", + "type": "formattedText", + "description": "Caption of the story" + } + ] + }, + { + "name": "stories", + "description": "Represents a list of stories", + "class": "Stories", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of stories found" + }, + { + "name": "stories", + "type": "vector\u003cstory\u003e", + "description": "The list of stories" + } + ] + }, + { + "name": "storyInfo", + "description": "Contains basic information about a story", + "class": "StoryInfo", + "properties": [ + { + "name": "story_id", + "type": "int32", + "description": "Unique story identifier among stories of the given sender" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the story was published" + }, + { + "name": "is_for_close_friends", + "type": "Bool", + "description": "True, if the story is available only to close friends" + } + ] + }, + { + "name": "chatActiveStories", + "description": "Describes active stories posted by a chat", + "class": "ChatActiveStories", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the stories" + }, + { + "name": "list", + "type": "StoryList", + "description": "Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list" + }, + { + "name": "order", + "type": "int53", + "description": "A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order" + }, + { + "name": "max_read_story_id", + "type": "int32", + "description": "Identifier of the last read active story" + }, + { + "name": "stories", + "type": "vector\u003cstoryInfo\u003e", + "description": "Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers)" + } + ] + }, + { + "name": "chatBoostSourceGiftCode", + "description": "The chat created a Telegram Premium gift code for a user", + "class": "ChatBoostSource", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of a user, for which the gift code was created" + }, + { + "name": "gift_code", + "type": "string", + "description": "The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed" + } + ] + }, + { + "name": "chatBoostSourceGiveaway", + "description": "The chat created a Telegram Premium giveaway", + "class": "ChatBoostSource", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of a user that won in the giveaway; 0 if none" + }, + { + "name": "gift_code", + "type": "string", + "description": "The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise" + }, + { + "name": "giveaway_message_id", + "type": "int53", + "description": "Identifier of the corresponding giveaway message; can be an identifier of a deleted message" + }, + { + "name": "is_unclaimed", + "type": "Bool", + "description": "True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, because there were not enough participants" + } + ] + }, + { + "name": "chatBoostSourcePremium", + "description": "A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat", + "class": "ChatBoostSource", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user" + } + ] + }, + { + "name": "prepaidPremiumGiveaway", + "description": "Describes a prepaid Telegram Premium giveaway", + "class": "PrepaidPremiumGiveaway", + "properties": [ + { + "name": "id", + "type": "int64", + "description": "Unique identifier of the prepaid giveaway" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Number of users which will receive Telegram Premium subscription gift codes" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active after code activation" + }, + { + "name": "payment_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the giveaway was paid" + } + ] + }, + { + "name": "chatBoostStatus", + "description": "Describes current boost status of a chat", + "class": "ChatBoostStatus", + "properties": [ + { + "name": "boost_url", + "type": "string", + "description": "An HTTP URL, which can be used to boost the chat" + }, + { + "name": "applied_slot_ids", + "type": "vector\u003cint32\u003e", + "description": "Identifiers of boost slots of the current user applied to the chat" + }, + { + "name": "level", + "type": "int32", + "description": "Current boost level of the chat" + }, + { + "name": "gift_code_boost_count", + "type": "int32", + "description": "The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn't an administrator in the chat" + }, + { + "name": "boost_count", + "type": "int32", + "description": "The number of boosts received by the chat" + }, + { + "name": "current_level_boost_count", + "type": "int32", + "description": "The number of boosts added to reach the current level" + }, + { + "name": "next_level_boost_count", + "type": "int32", + "description": "The number of boosts needed to reach the next level; 0 if the next level isn't available" + }, + { + "name": "premium_member_count", + "type": "int32", + "description": "Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat" + }, + { + "name": "premium_member_percentage", + "type": "double", + "description": "A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat" + }, + { + "name": "prepaid_giveaways", + "type": "vector\u003cprepaidPremiumGiveaway\u003e", + "description": "The list of prepaid giveaways available for the chat; only for chat administrators" + } + ] + }, + { + "name": "chatBoost", + "description": "Describes a boost applied to a chat", + "class": "ChatBoost", + "properties": [ + { + "name": "id", + "type": "string", + "description": "Unique identifier of the boost" + }, + { + "name": "count", + "type": "int32", + "description": "The number of identical boosts applied" + }, + { + "name": "source", + "type": "ChatBoostSource", + "description": "Source of the boost" + }, + { + "name": "start_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the chat was boosted" + }, + { + "name": "expiration_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the boost will expire" + } + ] + }, + { + "name": "foundChatBoosts", + "description": "Contains a list of boosts applied to a chat", + "class": "FoundChatBoosts", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Total number of boosts applied to the chat" + }, + { + "name": "boosts", + "type": "vector\u003cchatBoost\u003e", + "description": "List of boosts" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, there are no more results" + } + ] + }, + { + "name": "chatBoostSlot", + "description": "Describes a slot for chat boost", + "class": "ChatBoostSlot", + "properties": [ + { + "name": "slot_id", + "type": "int32", + "description": "Unique identifier of the slot" + }, + { + "name": "currently_boosted_chat_id", + "type": "int53", + "description": "Identifier of the currently boosted chat; 0 if none" + }, + { + "name": "start_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the chat was boosted; 0 if none" + }, + { + "name": "expiration_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the boost will expire" + }, + { + "name": "cooldown_until_date", + "type": "int32", + "description": "Point in time (Unix timestamp) after which the boost can be used for another chat" + } + ] + }, + { + "name": "chatBoostSlots", + "description": "Contains a list of chat boost slots", + "class": "ChatBoostSlots", + "properties": [ + { + "name": "slots", + "type": "vector\u003cchatBoostSlot\u003e", + "description": "List of boost slots" + } + ] + }, { "name": "callDiscardReasonEmpty", "description": "The call wasn't discarded, or the reason is unknown", @@ -9145,7 +12936,7 @@ { "name": "max_layer", "type": "int32", - "description": "The maximum supported API layer; use 65" + "description": "The maximum supported API layer; use 92" }, { "name": "library_versions", @@ -9163,6 +12954,11 @@ "name": "peer_tag", "type": "bytes", "description": "A peer tag to be used with the reflector" + }, + { + "name": "is_tcp", + "type": "Bool", + "description": "True, if the server uses TCP instead of UDP" } ] }, @@ -9323,7 +13119,7 @@ { "name": "reason", "type": "CallDiscardReason", - "description": "The reason, why the call has ended" + "description": "The reason why the call has ended" }, { "name": "need_rating", @@ -9334,6 +13130,11 @@ "name": "need_debug_information", "type": "Bool", "description": "True, if the call debug information must be sent to the server" + }, + { + "name": "need_log", + "type": "Bool", + "description": "True, if the call log must be sent to the server" } ] }, @@ -9367,6 +13168,57 @@ "class": "GroupCallVideoQuality", "properties": [] }, + { + "name": "groupCallStream", + "description": "Describes an available stream in a group call", + "class": "GroupCallStream", + "properties": [ + { + "name": "channel_id", + "type": "int32", + "description": "Identifier of an audio/video channel" + }, + { + "name": "scale", + "type": "int32", + "description": "Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds" + }, + { + "name": "time_offset", + "type": "int53", + "description": "Point in time when the stream currently ends; Unix timestamp in milliseconds" + } + ] + }, + { + "name": "groupCallStreams", + "description": "Represents a list of group call streams", + "class": "GroupCallStreams", + "properties": [ + { + "name": "streams", + "type": "vector\u003cgroupCallStream\u003e", + "description": "A list of group call streams" + } + ] + }, + { + "name": "rtmpUrl", + "description": "Represents an RTMP URL", + "class": "RtmpUrl", + "properties": [ + { + "name": "url", + "type": "string", + "description": "The URL" + }, + { + "name": "stream_key", + "type": "string", + "description": "Stream key" + } + ] + }, { "name": "groupCallRecentSpeaker", "description": "Describes a recently speaking participant in a group call", @@ -9414,6 +13266,11 @@ "type": "Bool", "description": "True, if the call is active" }, + { + "name": "is_rtmp_stream", + "type": "Bool", + "description": "True, if the chat is an RTMP stream instead of an ordinary video chat" + }, { "name": "is_joined", "type": "Bool", @@ -9434,6 +13291,11 @@ "type": "int32", "description": "Number of participants in the group call" }, + { + "name": "has_hidden_listeners", + "type": "Bool", + "description": "True, if group call participants, which are muted, aren't returned in participant list" + }, { "name": "loaded_all_participants", "type": "Bool", @@ -9521,7 +13383,7 @@ { "name": "is_paused", "type": "Bool", - "description": "True if the video is paused. This flag needs to be ignored, if new video frames are received" + "description": "True, if the video is paused. This flag needs to be ignored, if new video frames are received" } ] }, @@ -9708,6 +13570,29 @@ } ] }, + { + "name": "firebaseAuthenticationSettingsAndroid", + "description": "Settings for Firebase Authentication in the official Android application", + "class": "FirebaseAuthenticationSettings", + "properties": [] + }, + { + "name": "firebaseAuthenticationSettingsIos", + "description": "Settings for Firebase Authentication in the official iOS application", + "class": "FirebaseAuthenticationSettings", + "properties": [ + { + "name": "device_token", + "type": "string", + "description": "Device token from Apple Push Notification service" + }, + { + "name": "is_app_sandbox", + "type": "Bool", + "description": "True, if App Sandbox is enabled" + } + ] + }, { "name": "phoneNumberAuthenticationSettings", "description": "Contains settings for the authentication of the user's phone number", @@ -9733,6 +13618,11 @@ "type": "Bool", "description": "For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services \u003e= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details" }, + { + "name": "firebase_authentication_settings", + "type": "FirebaseAuthenticationSettings", + "description": "For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication" + }, { "name": "authentication_tokens", "type": "vector\u003cstring\u003e", @@ -9740,6 +13630,156 @@ } ] }, + { + "name": "addedReaction", + "description": "Represents a reaction applied to a message", + "class": "AddedReaction", + "properties": [ + { + "name": "type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the chat member, applied the reaction" + }, + { + "name": "is_outgoing", + "type": "Bool", + "description": "True, if the reaction was added by the current user" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the reaction was added" + } + ] + }, + { + "name": "addedReactions", + "description": "Represents a list of reactions added to a message", + "class": "AddedReactions", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "The total number of found reactions" + }, + { + "name": "reactions", + "type": "vector\u003caddedReaction\u003e", + "description": "The list of added reactions" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, there are no more results" + } + ] + }, + { + "name": "availableReaction", + "description": "Represents an available reaction", + "class": "AvailableReaction", + "properties": [ + { + "name": "type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "needs_premium", + "type": "Bool", + "description": "True, if Telegram Premium is needed to send the reaction" + } + ] + }, + { + "name": "availableReactions", + "description": "Represents a list of reactions that can be added to a message", + "class": "AvailableReactions", + "properties": [ + { + "name": "top_reactions", + "type": "vector\u003cavailableReaction\u003e", + "description": "List of reactions to be shown at the top" + }, + { + "name": "recent_reactions", + "type": "vector\u003cavailableReaction\u003e", + "description": "List of recently used reactions" + }, + { + "name": "popular_reactions", + "type": "vector\u003cavailableReaction\u003e", + "description": "List of popular reactions" + }, + { + "name": "allow_custom_emoji", + "type": "Bool", + "description": "True, if custom emoji reactions could be added by Telegram Premium subscribers" + } + ] + }, + { + "name": "emojiReaction", + "description": "Contains information about a emoji reaction", + "class": "EmojiReaction", + "properties": [ + { + "name": "emoji", + "type": "string", + "description": "Text representation of the reaction" + }, + { + "name": "title", + "type": "string", + "description": "Reaction title" + }, + { + "name": "is_active", + "type": "Bool", + "description": "True, if the reaction can be added to new messages and enabled in chats" + }, + { + "name": "static_icon", + "type": "sticker", + "description": "Static icon for the reaction" + }, + { + "name": "appear_animation", + "type": "sticker", + "description": "Appear animation for the reaction" + }, + { + "name": "select_animation", + "type": "sticker", + "description": "Select animation for the reaction" + }, + { + "name": "activate_animation", + "type": "sticker", + "description": "Activate animation for the reaction" + }, + { + "name": "effect_animation", + "type": "sticker", + "description": "Effect animation for the reaction" + }, + { + "name": "around_animation", + "type": "sticker", + "description": "Around animation for the reaction; may be null" + }, + { + "name": "center_animation", + "type": "sticker", + "description": "Center animation for the reaction; may be null" + } + ] + }, { "name": "animations", "description": "Represents a list of animations", @@ -9798,7 +13838,7 @@ }, { "name": "importedContacts", - "description": "Represents the result of an ImportContacts request", + "description": "Represents the result of an importContacts request", "class": "ImportedContacts", "properties": [ { @@ -9813,6 +13853,229 @@ } ] }, + { + "name": "speechRecognitionResultPending", + "description": "The speech recognition is ongoing", + "class": "SpeechRecognitionResult", + "properties": [ + { + "name": "partial_text", + "type": "string", + "description": "Partially recognized text" + } + ] + }, + { + "name": "speechRecognitionResultText", + "description": "The speech recognition successfully finished", + "class": "SpeechRecognitionResult", + "properties": [ + { + "name": "text", + "type": "string", + "description": "Recognized text" + } + ] + }, + { + "name": "speechRecognitionResultError", + "description": "The speech recognition failed", + "class": "SpeechRecognitionResult", + "properties": [ + { + "name": "error", + "type": "error", + "description": "Recognition error" + } + ] + }, + { + "name": "attachmentMenuBotColor", + "description": "Describes a color to highlight a bot added to attachment menu", + "class": "AttachmentMenuBotColor", + "properties": [ + { + "name": "light_color", + "type": "int32", + "description": "Color in the RGB24 format for light themes" + }, + { + "name": "dark_color", + "type": "int32", + "description": "Color in the RGB24 format for dark themes" + } + ] + }, + { + "name": "attachmentMenuBot", + "description": "Represents a bot, which can be added to attachment or side menu", + "class": "AttachmentMenuBot", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "User identifier of the bot" + }, + { + "name": "supports_self_chat", + "type": "Bool", + "description": "True, if the bot supports opening from attachment menu in the chat with the bot" + }, + { + "name": "supports_user_chats", + "type": "Bool", + "description": "True, if the bot supports opening from attachment menu in private chats with ordinary users" + }, + { + "name": "supports_bot_chats", + "type": "Bool", + "description": "True, if the bot supports opening from attachment menu in private chats with other bots" + }, + { + "name": "supports_group_chats", + "type": "Bool", + "description": "True, if the bot supports opening from attachment menu in basic group and supergroup chats" + }, + { + "name": "supports_channel_chats", + "type": "Bool", + "description": "True, if the bot supports opening from attachment menu in channel chats" + }, + { + "name": "request_write_access", + "type": "Bool", + "description": "True, if the user must be asked for the permission to send messages to the bot" + }, + { + "name": "is_added", + "type": "Bool", + "description": "True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed" + }, + { + "name": "show_in_attachment_menu", + "type": "Bool", + "description": "True, if the bot must be shown in the attachment menu" + }, + { + "name": "show_in_side_menu", + "type": "Bool", + "description": "True, if the bot must be shown in the side menu" + }, + { + "name": "show_disclaimer_in_side_menu", + "type": "Bool", + "description": "True, if a disclaimer, why the bot is shown in the side menu, is needed" + }, + { + "name": "name", + "type": "string", + "description": "Name for the bot in attachment menu" + }, + { + "name": "name_color", + "type": "attachmentMenuBotColor", + "description": "Color to highlight selected name of the bot if appropriate; may be null" + }, + { + "name": "default_icon", + "type": "file", + "description": "Default icon for the bot in SVG format; may be null" + }, + { + "name": "ios_static_icon", + "type": "file", + "description": "Icon for the bot in SVG format for the official iOS app; may be null" + }, + { + "name": "ios_animated_icon", + "type": "file", + "description": "Icon for the bot in TGS format for the official iOS app; may be null" + }, + { + "name": "ios_side_menu_icon", + "type": "file", + "description": "Icon for the bot in PNG format for the official iOS app side menu; may be null" + }, + { + "name": "android_icon", + "type": "file", + "description": "Icon for the bot in TGS format for the official Android app; may be null" + }, + { + "name": "android_side_menu_icon", + "type": "file", + "description": "Icon for the bot in SVG format for the official Android app side menu; may be null" + }, + { + "name": "macos_icon", + "type": "file", + "description": "Icon for the bot in TGS format for the official native macOS app; may be null" + }, + { + "name": "macos_side_menu_icon", + "type": "file", + "description": "Icon for the bot in PNG format for the official macOS app side menu; may be null" + }, + { + "name": "icon_color", + "type": "attachmentMenuBotColor", + "description": "Color to highlight selected icon of the bot if appropriate; may be null" + }, + { + "name": "web_app_placeholder", + "type": "file", + "description": "Default placeholder for opened Web Apps in SVG format; may be null" + } + ] + }, + { + "name": "sentWebAppMessage", + "description": "Information about the message sent by answerWebAppQuery", + "class": "SentWebAppMessage", + "properties": [ + { + "name": "inline_message_id", + "type": "string", + "description": "Identifier of the sent inline message, if known" + } + ] + }, + { + "name": "botWriteAccessAllowReasonConnectedWebsite", + "description": "The user connected a website by logging in using Telegram Login Widget on it", + "class": "BotWriteAccessAllowReason", + "properties": [ + { + "name": "domain_name", + "type": "string", + "description": "Domain name of the connected website" + } + ] + }, + { + "name": "botWriteAccessAllowReasonAddedToAttachmentMenu", + "description": "The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu", + "class": "BotWriteAccessAllowReason", + "properties": [] + }, + { + "name": "botWriteAccessAllowReasonLaunchedWebApp", + "description": "The user launched a Web App using getWebAppLinkUrl", + "class": "BotWriteAccessAllowReason", + "properties": [ + { + "name": "web_app", + "type": "webApp", + "description": "Information about the Web App" + } + ] + }, + { + "name": "botWriteAccessAllowReasonAcceptedRequest", + "description": "The user accepted bot's request to send messages with allowBotToSendMessages", + "class": "BotWriteAccessAllowReason", + "properties": [] + }, { "name": "httpUrl", "description": "Contains an HTTP URL", @@ -9825,6 +14088,23 @@ } ] }, + { + "name": "userLink", + "description": "Contains an HTTPS URL, which can be used to get information about a user", + "class": "UserLink", + "properties": [ + { + "name": "url", + "type": "string", + "description": "The URL" + }, + { + "name": "expires_in", + "type": "int32", + "description": "Left time for which the link is valid, in seconds; 0 if the link is a public username link" + } + ] + }, { "name": "inputInlineQueryResultAnimation", "description": "Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video", @@ -10213,7 +14493,7 @@ }, { "name": "inputInlineQueryResultSticker", - "description": "Represents a link to a WEBP or TGS sticker", + "description": "Represents a link to a WEBP, TGS, or WEBM sticker", "class": "InputInlineQueryResult", "properties": [ { @@ -10229,7 +14509,7 @@ { "name": "sticker_url", "type": "string", - "description": "The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB)" + "description": "The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB)" }, { "name": "sticker_width", @@ -10678,6 +14958,47 @@ } ] }, + { + "name": "inlineQueryResultsButtonTypeStartBot", + "description": "Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter", + "class": "InlineQueryResultsButtonType", + "properties": [ + { + "name": "parameter", + "type": "string", + "description": "The parameter for the bot start message" + } + ] + }, + { + "name": "inlineQueryResultsButtonTypeWebApp", + "description": "Describes the button that opens a Web App by calling getWebAppUrl", + "class": "InlineQueryResultsButtonType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "An HTTP URL to pass to getWebAppUrl" + } + ] + }, + { + "name": "inlineQueryResultsButton", + "description": "Represents a button to be shown above inline query results", + "class": "InlineQueryResultsButton", + "properties": [ + { + "name": "text", + "type": "string", + "description": "The text of the button" + }, + { + "name": "type", + "type": "InlineQueryResultsButtonType", + "description": "Type of the button" + } + ] + }, { "name": "inlineQueryResults", "description": "Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query", @@ -10689,9 +15010,9 @@ "description": "Unique identifier of the inline query" }, { - "name": "next_offset", - "type": "string", - "description": "The offset for the next request. If empty, there are no more results" + "name": "button", + "type": "inlineQueryResultsButton", + "description": "Button to be shown above inline query results; may be null" }, { "name": "results", @@ -10699,14 +15020,9 @@ "description": "Results of the query" }, { - "name": "switch_pm_text", + "name": "next_offset", "type": "string", - "description": "If non-empty, this text must be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter" - }, - { - "name": "switch_pm_parameter", - "type": "string", - "description": "Parameter for the bot start message" + "description": "The offset for the next request. If empty, there are no more results" } ] }, @@ -10730,7 +15046,7 @@ { "name": "password", "type": "string", - "description": "The password for the current user" + "description": "The 2-step verification password for the current user" }, { "name": "data", @@ -10845,18 +15161,11 @@ "name": "message", "type": "message", "description": "Deleted message" - } - ] - }, - { - "name": "chatEventPollStopped", - "description": "A poll in a message was stopped", - "class": "ChatEventAction", - "properties": [ + }, { - "name": "message", - "type": "message", - "description": "The message with the poll" + "name": "can_report_anti_spam_false_positive", + "type": "Bool", + "description": "True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive" } ] }, @@ -10884,6 +15193,18 @@ } ] }, + { + "name": "chatEventPollStopped", + "description": "A poll in a message was stopped", + "class": "ChatEventAction", + "properties": [ + { + "name": "message", + "type": "message", + "description": "The message with the poll" + } + ] + }, { "name": "chatEventMemberJoined", "description": "A new member joined the chat", @@ -10899,6 +15220,11 @@ "name": "invite_link", "type": "chatInviteLink", "description": "Invite link used to join the chat" + }, + { + "name": "via_chat_folder_invite_link", + "type": "Bool", + "description": "True, if the user has joined the chat using an invite link for a chat folder" } ] }, @@ -10919,12 +15245,6 @@ } ] }, - { - "name": "chatEventMemberLeft", - "description": "A member left the chat", - "class": "ChatEventAction", - "properties": [] - }, { "name": "chatEventMemberInvited", "description": "A new chat member was invited", @@ -10942,6 +15262,12 @@ } ] }, + { + "name": "chatEventMemberLeft", + "description": "A member left the chat", + "class": "ChatEventAction", + "properties": [] + }, { "name": "chatEventMemberPromoted", "description": "A chat member has gained/lost administrator status, or the list of their administrator privileges has changed", @@ -10987,36 +15313,19 @@ ] }, { - "name": "chatEventTitleChanged", - "description": "The chat title was changed", + "name": "chatEventAvailableReactionsChanged", + "description": "The chat available reactions were changed", "class": "ChatEventAction", "properties": [ { - "name": "old_title", - "type": "string", - "description": "Previous chat title" + "name": "old_available_reactions", + "type": "ChatAvailableReactions", + "description": "Previous chat available reactions" }, { - "name": "new_title", - "type": "string", - "description": "New chat title" - } - ] - }, - { - "name": "chatEventPermissionsChanged", - "description": "The chat permissions was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_permissions", - "type": "chatPermissions", - "description": "Previous chat permissions" - }, - { - "name": "new_permissions", - "type": "chatPermissions", - "description": "New chat permissions" + "name": "new_available_reactions", + "type": "ChatAvailableReactions", + "description": "New chat available reactions" } ] }, @@ -11037,52 +15346,6 @@ } ] }, - { - "name": "chatEventUsernameChanged", - "description": "The chat username was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_username", - "type": "string", - "description": "Previous chat username" - }, - { - "name": "new_username", - "type": "string", - "description": "New chat username" - } - ] - }, - { - "name": "chatEventPhotoChanged", - "description": "The chat photo was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_photo", - "type": "chatPhoto", - "description": "Previous chat photo value; may be null" - }, - { - "name": "new_photo", - "type": "chatPhoto", - "description": "New chat photo value; may be null" - } - ] - }, - { - "name": "chatEventInvitesToggled", - "description": "The can_invite_users permission of a supergroup chat was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "can_invite_users", - "type": "Bool", - "description": "New value of can_invite_users permission" - } - ] - }, { "name": "chatEventLinkedChatChanged", "description": "The linked chat of a supergroup was changed", @@ -11100,81 +15363,6 @@ } ] }, - { - "name": "chatEventSlowModeDelayChanged", - "description": "The slow_mode_delay setting of a supergroup was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_slow_mode_delay", - "type": "int32", - "description": "Previous value of slow_mode_delay, in seconds" - }, - { - "name": "new_slow_mode_delay", - "type": "int32", - "description": "New value of slow_mode_delay, in seconds" - } - ] - }, - { - "name": "chatEventMessageTtlChanged", - "description": "The message TTL was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_message_ttl", - "type": "int32", - "description": "Previous value of message_ttl" - }, - { - "name": "new_message_ttl", - "type": "int32", - "description": "New value of message_ttl" - } - ] - }, - { - "name": "chatEventSignMessagesToggled", - "description": "The sign_messages setting of a channel was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "sign_messages", - "type": "Bool", - "description": "New value of sign_messages" - } - ] - }, - { - "name": "chatEventHasProtectedContentToggled", - "description": "The has_protected_content setting of a channel was toggled", - "class": "ChatEventAction", - "properties": [ - { - "name": "has_protected_content", - "type": "Bool", - "description": "New value of has_protected_content" - } - ] - }, - { - "name": "chatEventStickerSetChanged", - "description": "The supergroup sticker set was changed", - "class": "ChatEventAction", - "properties": [ - { - "name": "old_sticker_set_id", - "type": "int64", - "description": "Previous identifier of the chat sticker set; 0 if none" - }, - { - "name": "new_sticker_set_id", - "type": "int64", - "description": "New identifier of the chat sticker set; 0 if none" - } - ] - }, { "name": "chatEventLocationChanged", "description": "The supergroup location was changed", @@ -11192,6 +15380,200 @@ } ] }, + { + "name": "chatEventMessageAutoDeleteTimeChanged", + "description": "The message auto-delete timer was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_message_auto_delete_time", + "type": "int32", + "description": "Previous value of message_auto_delete_time" + }, + { + "name": "new_message_auto_delete_time", + "type": "int32", + "description": "New value of message_auto_delete_time" + } + ] + }, + { + "name": "chatEventPermissionsChanged", + "description": "The chat permissions was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_permissions", + "type": "chatPermissions", + "description": "Previous chat permissions" + }, + { + "name": "new_permissions", + "type": "chatPermissions", + "description": "New chat permissions" + } + ] + }, + { + "name": "chatEventPhotoChanged", + "description": "The chat photo was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_photo", + "type": "chatPhoto", + "description": "Previous chat photo value; may be null" + }, + { + "name": "new_photo", + "type": "chatPhoto", + "description": "New chat photo value; may be null" + } + ] + }, + { + "name": "chatEventSlowModeDelayChanged", + "description": "The slow_mode_delay setting of a supergroup was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_slow_mode_delay", + "type": "int32", + "description": "Previous value of slow_mode_delay, in seconds" + }, + { + "name": "new_slow_mode_delay", + "type": "int32", + "description": "New value of slow_mode_delay, in seconds" + } + ] + }, + { + "name": "chatEventStickerSetChanged", + "description": "The supergroup sticker set was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_sticker_set_id", + "type": "int64", + "description": "Previous identifier of the chat sticker set; 0 if none" + }, + { + "name": "new_sticker_set_id", + "type": "int64", + "description": "New identifier of the chat sticker set; 0 if none" + } + ] + }, + { + "name": "chatEventTitleChanged", + "description": "The chat title was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_title", + "type": "string", + "description": "Previous chat title" + }, + { + "name": "new_title", + "type": "string", + "description": "New chat title" + } + ] + }, + { + "name": "chatEventUsernameChanged", + "description": "The chat editable username was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_username", + "type": "string", + "description": "Previous chat username" + }, + { + "name": "new_username", + "type": "string", + "description": "New chat username" + } + ] + }, + { + "name": "chatEventActiveUsernamesChanged", + "description": "The chat active usernames were changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_usernames", + "type": "vector\u003cstring\u003e", + "description": "Previous list of active usernames" + }, + { + "name": "new_usernames", + "type": "vector\u003cstring\u003e", + "description": "New list of active usernames" + } + ] + }, + { + "name": "chatEventAccentColorChanged", + "description": "The chat accent color was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_accent_color_id", + "type": "int32", + "description": "Previous identifier of chat accent color" + }, + { + "name": "new_accent_color_id", + "type": "int32", + "description": "New identifier of chat accent color" + } + ] + }, + { + "name": "chatEventBackgroundCustomEmojiChanged", + "description": "The chat's custom emoji for reply background was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_background_custom_emoji_id", + "type": "int64", + "description": "Previous identifier of the custom emoji; 0 if none" + }, + { + "name": "new_background_custom_emoji_id", + "type": "int64", + "description": "New identifier of the custom emoji; 0 if none" + } + ] + }, + { + "name": "chatEventHasProtectedContentToggled", + "description": "The has_protected_content setting of a channel was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "has_protected_content", + "type": "Bool", + "description": "New value of has_protected_content" + } + ] + }, + { + "name": "chatEventInvitesToggled", + "description": "The can_invite_users permission of a supergroup chat was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "can_invite_users", + "type": "Bool", + "description": "New value of can_invite_users permission" + } + ] + }, { "name": "chatEventIsAllHistoryAvailableToggled", "description": "The is_all_history_available setting of a supergroup was toggled", @@ -11204,6 +15586,30 @@ } ] }, + { + "name": "chatEventHasAggressiveAntiSpamEnabledToggled", + "description": "The has_aggressive_anti_spam_enabled setting of a supergroup was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "has_aggressive_anti_spam_enabled", + "type": "Bool", + "description": "New value of has_aggressive_anti_spam_enabled" + } + ] + }, + { + "name": "chatEventSignMessagesToggled", + "description": "The sign_messages setting of a channel was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "sign_messages", + "type": "Bool", + "description": "New value of sign_messages" + } + ] + }, { "name": "chatEventInviteLinkEdited", "description": "A chat invite link was edited", @@ -11269,6 +15675,18 @@ } ] }, + { + "name": "chatEventVideoChatMuteNewParticipantsToggled", + "description": "The mute_new_participants setting of a video chat was toggled", + "class": "ChatEventAction", + "properties": [ + { + "name": "mute_new_participants", + "type": "Bool", + "description": "New value of the mute_new_participants setting" + } + ] + }, { "name": "chatEventVideoChatParticipantIsMutedToggled", "description": "A video chat participant was muted or unmuted", @@ -11304,14 +15722,96 @@ ] }, { - "name": "chatEventVideoChatMuteNewParticipantsToggled", - "description": "The mute_new_participants setting of a video chat was toggled", + "name": "chatEventIsForumToggled", + "description": "The is_forum setting of a channel was toggled", "class": "ChatEventAction", "properties": [ { - "name": "mute_new_participants", + "name": "is_forum", "type": "Bool", - "description": "New value of the mute_new_participants setting" + "description": "New value of is_forum" + } + ] + }, + { + "name": "chatEventForumTopicCreated", + "description": "A new forum topic was created", + "class": "ChatEventAction", + "properties": [ + { + "name": "topic_info", + "type": "forumTopicInfo", + "description": "Information about the topic" + } + ] + }, + { + "name": "chatEventForumTopicEdited", + "description": "A forum topic was edited", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_topic_info", + "type": "forumTopicInfo", + "description": "Old information about the topic" + }, + { + "name": "new_topic_info", + "type": "forumTopicInfo", + "description": "New information about the topic" + } + ] + }, + { + "name": "chatEventForumTopicToggleIsClosed", + "description": "A forum topic was closed or reopened", + "class": "ChatEventAction", + "properties": [ + { + "name": "topic_info", + "type": "forumTopicInfo", + "description": "New information about the topic" + } + ] + }, + { + "name": "chatEventForumTopicToggleIsHidden", + "description": "The General forum topic was hidden or unhidden", + "class": "ChatEventAction", + "properties": [ + { + "name": "topic_info", + "type": "forumTopicInfo", + "description": "New information about the topic" + } + ] + }, + { + "name": "chatEventForumTopicDeleted", + "description": "A forum topic was deleted", + "class": "ChatEventAction", + "properties": [ + { + "name": "topic_info", + "type": "forumTopicInfo", + "description": "Information about the topic" + } + ] + }, + { + "name": "chatEventForumTopicPinned", + "description": "A pinned forum topic was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_topic_info", + "type": "forumTopicInfo", + "description": "Information about the old pinned topic; may be null" + }, + { + "name": "new_topic_info", + "type": "forumTopicInfo", + "description": "Information about the new pinned topic; may be null" } ] }, @@ -11418,6 +15918,11 @@ "name": "video_chat_changes", "type": "Bool", "description": "True, if video chat actions need to be returned" + }, + { + "name": "forum_changes", + "type": "Bool", + "description": "True, if forum-related actions need to be returned" } ] }, @@ -11435,7 +15940,7 @@ }, { "name": "languagePackStringValuePluralized", - "description": "A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info", + "description": "A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information", "class": "LanguagePackStringValue", "properties": [ { @@ -11533,7 +16038,7 @@ { "name": "plural_code", "type": "string", - "description": "A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info" + "description": "A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information" }, { "name": "is_official", @@ -11589,6 +16094,541 @@ } ] }, + { + "name": "premiumLimitTypeSupergroupCount", + "description": "The maximum number of joined supergroups and channels", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypePinnedChatCount", + "description": "The maximum number of pinned chats in the main chat list", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeCreatedPublicChatCount", + "description": "The maximum number of created public chats", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeSavedAnimationCount", + "description": "The maximum number of saved animations", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeFavoriteStickerCount", + "description": "The maximum number of favorite stickers", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeChatFolderCount", + "description": "The maximum number of chat folders", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeChatFolderChosenChatCount", + "description": "The maximum number of pinned and always included, or always excluded chats in a chat folder", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypePinnedArchivedChatCount", + "description": "The maximum number of pinned chats in the archive chat list", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeCaptionLength", + "description": "The maximum length of sent media caption", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeBioLength", + "description": "The maximum length of the user's bio", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeChatFolderInviteLinkCount", + "description": "The maximum number of invite links for a chat folder", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeShareableChatFolderCount", + "description": "The maximum number of added shareable chat folders", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeActiveStoryCount", + "description": "The maximum number of active stories", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeWeeklySentStoryCount", + "description": "The maximum number of stories sent per week", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeMonthlySentStoryCount", + "description": "The maximum number of stories sent per month", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeStoryCaptionLength", + "description": "The maximum length of captions of sent stories", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeStorySuggestedReactionAreaCount", + "description": "The maximum number of suggested reaction areas on a story", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumFeatureIncreasedLimits", + "description": "Increased limits", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureIncreasedUploadFileSize", + "description": "Increased maximum upload file size", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureImprovedDownloadSpeed", + "description": "Improved download speed", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureVoiceRecognition", + "description": "The ability to convert voice notes to text", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureDisabledAds", + "description": "Disabled ads", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureUniqueReactions", + "description": "Allowed to use more reactions", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureUniqueStickers", + "description": "Allowed to use premium stickers with unique effects", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureCustomEmoji", + "description": "Allowed to use custom emoji stickers in message texts and captions", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureAdvancedChatManagement", + "description": "Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureProfileBadge", + "description": "A badge in the user's profile", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureEmojiStatus", + "description": "An emoji status shown along with the user's name", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureAnimatedProfilePhoto", + "description": "Profile photo animation on message and chat screens", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureForumTopicIcon", + "description": "The ability to set a custom emoji as a forum topic icon", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureAppIcons", + "description": "Allowed to set a premium application icons", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureRealTimeChatTranslation", + "description": "Allowed to translate chat messages real-time", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureUpgradedStories", + "description": "Allowed to use many additional features for stories", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureChatBoost", + "description": "The ability to boost chats", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureAccentColor", + "description": "The ability to choose accent color", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumStoryFeaturePriorityOrder", + "description": "User stories are displayed before stories of non-premium contacts and channels", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeatureStealthMode", + "description": "The ability to hide the fact that the user viewed other's stories", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeaturePermanentViewsHistory", + "description": "The ability to check who opened the current user's stories after they expire", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeatureCustomExpirationDuration", + "description": "The ability to set custom expiration duration for stories", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeatureSaveStories", + "description": "The ability to save other's unprotected stories", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeatureLinksAndFormatting", + "description": "The ability to use links and formatting in story caption", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumLimit", + "description": "Contains information about a limit, increased for Premium users", + "class": "PremiumLimit", + "properties": [ + { + "name": "type", + "type": "PremiumLimitType", + "description": "The type of the limit" + }, + { + "name": "default_value", + "type": "int32", + "description": "Default value of the limit" + }, + { + "name": "premium_value", + "type": "int32", + "description": "Value of the limit for Premium users" + } + ] + }, + { + "name": "premiumFeatures", + "description": "Contains information about features, available to Premium users", + "class": "PremiumFeatures", + "properties": [ + { + "name": "features", + "type": "vector\u003cPremiumFeature\u003e", + "description": "The list of available features" + }, + { + "name": "limits", + "type": "vector\u003cpremiumLimit\u003e", + "description": "The list of limits, increased for Premium users" + }, + { + "name": "payment_link", + "type": "InternalLinkType", + "description": "An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available" + } + ] + }, + { + "name": "premiumSourceLimitExceeded", + "description": "A limit was exceeded", + "class": "PremiumSource", + "properties": [ + { + "name": "limit_type", + "type": "PremiumLimitType", + "description": "Type of the exceeded limit" + } + ] + }, + { + "name": "premiumSourceFeature", + "description": "A user tried to use a Premium feature", + "class": "PremiumSource", + "properties": [ + { + "name": "feature", + "type": "PremiumFeature", + "description": "The used feature" + } + ] + }, + { + "name": "premiumSourceStoryFeature", + "description": "A user tried to use a Premium story feature", + "class": "PremiumSource", + "properties": [ + { + "name": "feature", + "type": "PremiumStoryFeature", + "description": "The used feature" + } + ] + }, + { + "name": "premiumSourceLink", + "description": "A user opened an internal link of the type internalLinkTypePremiumFeatures", + "class": "PremiumSource", + "properties": [ + { + "name": "referrer", + "type": "string", + "description": "The referrer from the link" + } + ] + }, + { + "name": "premiumSourceSettings", + "description": "A user opened the Premium features screen from settings", + "class": "PremiumSource", + "properties": [] + }, + { + "name": "premiumFeaturePromotionAnimation", + "description": "Describes a promotion animation for a Premium feature", + "class": "PremiumFeaturePromotionAnimation", + "properties": [ + { + "name": "feature", + "type": "PremiumFeature", + "description": "Premium feature" + }, + { + "name": "animation", + "type": "animation", + "description": "Promotion animation for the feature" + } + ] + }, + { + "name": "premiumState", + "description": "Contains state of Telegram Premium subscription and promotion videos for Premium features", + "class": "PremiumState", + "properties": [ + { + "name": "state", + "type": "formattedText", + "description": "Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription" + }, + { + "name": "payment_options", + "type": "vector\u003cpremiumStatePaymentOption\u003e", + "description": "The list of available options for buying Telegram Premium" + }, + { + "name": "animations", + "type": "vector\u003cpremiumFeaturePromotionAnimation\u003e", + "description": "The list of available promotion animations for Premium features" + } + ] + }, + { + "name": "storePaymentPurposePremiumSubscription", + "description": "The user subscribing to Telegram Premium", + "class": "StorePaymentPurpose", + "properties": [ + { + "name": "is_restore", + "type": "Bool", + "description": "Pass true if this is a restore of a Telegram Premium purchase; only for App Store" + }, + { + "name": "is_upgrade", + "type": "Bool", + "description": "Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store" + } + ] + }, + { + "name": "storePaymentPurposeGiftedPremium", + "description": "The user gifting Telegram Premium to another user", + "class": "StorePaymentPurpose", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user to which Premium was gifted" + }, + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code of the payment currency" + }, + { + "name": "amount", + "type": "int53", + "description": "Paid amount, in the smallest units of the currency" + } + ] + }, + { + "name": "storePaymentPurposePremiumGiftCodes", + "description": "The user creating Telegram Premium gift codes for other users", + "class": "StorePaymentPurpose", + "properties": [ + { + "name": "boosted_chat_id", + "type": "int53", + "description": "Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none" + }, + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code of the payment currency" + }, + { + "name": "amount", + "type": "int53", + "description": "Paid amount, in the smallest units of the currency" + }, + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the users which can activate the gift codes" + } + ] + }, + { + "name": "storePaymentPurposePremiumGiveaway", + "description": "The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels", + "class": "StorePaymentPurpose", + "properties": [ + { + "name": "parameters", + "type": "premiumGiveawayParameters", + "description": "Giveaway parameters" + }, + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code of the payment currency" + }, + { + "name": "amount", + "type": "int53", + "description": "Paid amount, in the smallest units of the currency" + } + ] + }, + { + "name": "telegramPaymentPurposePremiumGiftCodes", + "description": "The user creating Telegram Premium gift codes for other users", + "class": "TelegramPaymentPurpose", + "properties": [ + { + "name": "boosted_chat_id", + "type": "int53", + "description": "Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none" + }, + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code of the payment currency" + }, + { + "name": "amount", + "type": "int53", + "description": "Paid amount, in the smallest units of the currency" + }, + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the users which can activate the gift codes" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active for the users" + } + ] + }, + { + "name": "telegramPaymentPurposePremiumGiveaway", + "description": "The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels", + "class": "TelegramPaymentPurpose", + "properties": [ + { + "name": "parameters", + "type": "premiumGiveawayParameters", + "description": "Giveaway parameters" + }, + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code of the payment currency" + }, + { + "name": "amount", + "type": "int53", + "description": "Paid amount, in the smallest units of the currency" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Number of users which will be able to activate the gift codes" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active for the users" + } + ] + }, { "name": "deviceTokenFirebaseCloudMessaging", "description": "A token for Firebase Cloud Messaging", @@ -11751,6 +16791,23 @@ } ] }, + { + "name": "deviceTokenHuaweiPush", + "description": "A token for HUAWEI Push Service", + "class": "DeviceToken", + "properties": [ + { + "name": "token", + "type": "string", + "description": "Device registration token; may be empty to deregister a device" + }, + { + "name": "encrypt", + "type": "Bool", + "description": "True, if push notifications must be additionally encrypted" + } + ] + }, { "name": "pushReceiverId", "description": "Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification", @@ -11793,7 +16850,7 @@ { "name": "rotation_angle", "type": "int32", - "description": "Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45" + "description": "Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45" } ] }, @@ -11865,55 +16922,6 @@ } ] }, - { - "name": "background", - "description": "Describes a chat background", - "class": "Background", - "properties": [ - { - "name": "id", - "type": "int64", - "description": "Unique background identifier" - }, - { - "name": "is_default", - "type": "Bool", - "description": "True, if this is one of default backgrounds" - }, - { - "name": "is_dark", - "type": "Bool", - "description": "True, if the background is dark and is recommended to be used with dark theme" - }, - { - "name": "name", - "type": "string", - "description": "Unique background name" - }, - { - "name": "document", - "type": "document", - "description": "Document with the background; may be null. Null only for filled backgrounds" - }, - { - "name": "type", - "type": "BackgroundType", - "description": "Type of the background" - } - ] - }, - { - "name": "backgrounds", - "description": "Contains a list of backgrounds", - "class": "Backgrounds", - "properties": [ - { - "name": "backgrounds", - "type": "vector\u003cbackground\u003e", - "description": "A list of backgrounds" - } - ] - }, { "name": "inputBackgroundLocal", "description": "A background from a local file", @@ -11938,6 +16946,18 @@ } ] }, + { + "name": "inputBackgroundPrevious", + "description": "A background previously set in the chat; for chat backgrounds only", + "class": "InputBackground", + "properties": [ + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message with the background" + } + ] + }, { "name": "themeSettings", "description": "Describes theme settings", @@ -12004,6 +17024,54 @@ } ] }, + { + "name": "canSendStoryResultOk", + "description": "A story can be sent", + "class": "CanSendStoryResult", + "properties": [] + }, + { + "name": "canSendStoryResultPremiumNeeded", + "description": "The user must subscribe to Telegram Premium to be able to post stories", + "class": "CanSendStoryResult", + "properties": [] + }, + { + "name": "canSendStoryResultBoostNeeded", + "description": "The channel chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat", + "class": "CanSendStoryResult", + "properties": [] + }, + { + "name": "canSendStoryResultActiveStoryLimitExceeded", + "description": "The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire", + "class": "CanSendStoryResult", + "properties": [] + }, + { + "name": "canSendStoryResultWeeklyLimitExceeded", + "description": "The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time", + "class": "CanSendStoryResult", + "properties": [ + { + "name": "retry_after", + "type": "int32", + "description": "Time left before the user can send the next story" + } + ] + }, + { + "name": "canSendStoryResultMonthlyLimitExceeded", + "description": "The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time", + "class": "CanSendStoryResult", + "properties": [ + { + "name": "retry_after", + "type": "int32", + "description": "Time left before the user can send the next story" + } + ] + }, { "name": "canTransferOwnershipResultOk", "description": "The session can be used", @@ -12059,8 +17127,14 @@ "properties": [] }, { - "name": "checkChatUsernameResultPublicChatsTooMuch", - "description": "The user has too much chats with username, one of them must be made private first", + "name": "checkChatUsernameResultUsernamePurchasable", + "description": "The username can be purchased at fragment.com", + "class": "CheckChatUsernameResult", + "properties": [] + }, + { + "name": "checkChatUsernameResultPublicChatsTooMany", + "description": "The user has too many chats with username, one of them must be made private first", "class": "CheckChatUsernameResult", "properties": [] }, @@ -12361,6 +17435,40 @@ } ] }, + { + "name": "pushMessageContentPremiumGiftCode", + "description": "A message with a Telegram Premium gift code created for the user", + "class": "PushMessageContent", + "properties": [ + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active after code activation" + } + ] + }, + { + "name": "pushMessageContentPremiumGiveaway", + "description": "A message with a Telegram Premium giveaway", + "class": "PushMessageContent", + "properties": [ + { + "name": "winner_count", + "type": "int32", + "description": "Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of month the Telegram Premium subscription will be active after code activation; 0 for pinned message" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the message is a pinned message with the specified content" + } + ] + }, { "name": "pushMessageContentScreenshotTaken", "description": "A screenshot of a message in the chat has been taken", @@ -12389,6 +17497,18 @@ } ] }, + { + "name": "pushMessageContentStory", + "description": "A message with a story", + "class": "PushMessageContent", + "properties": [ + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the message is a pinned message with the specified content" + } + ] + }, { "name": "pushMessageContentText", "description": "A text message", @@ -12513,6 +17633,18 @@ } ] }, + { + "name": "pushMessageContentChatSetBackground", + "description": "A chat background was edited", + "class": "PushMessageContent", + "properties": [ + { + "name": "is_same", + "type": "Bool", + "description": "True, if the set background is the same as the background of the current user" + } + ] + }, { "name": "pushMessageContentChatSetTheme", "description": "A chat theme was edited", @@ -12521,7 +17653,7 @@ { "name": "theme_name", "type": "string", - "description": "If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one" + "description": "If non-empty, name of a new theme, set for the chat. Otherwise, the chat theme was reset to the default one" } ] }, @@ -12559,6 +17691,24 @@ "class": "PushMessageContent", "properties": [] }, + { + "name": "pushMessageContentRecurringPayment", + "description": "A new recurring payment was made by the current user", + "class": "PushMessageContent", + "properties": [ + { + "name": "amount", + "type": "string", + "description": "The paid amount" + } + ] + }, + { + "name": "pushMessageContentSuggestProfilePhoto", + "description": "A profile photo was suggested to the user", + "class": "PushMessageContent", + "properties": [] + }, { "name": "pushMessageContentMessageForwards", "description": "A forwarded messages", @@ -12589,7 +17739,7 @@ { "name": "has_videos", "type": "Bool", - "description": "True, if the album has at least one video" + "description": "True, if the album has at least one video file" }, { "name": "has_audios", @@ -12612,6 +17762,11 @@ "name": "message", "type": "message", "description": "The message" + }, + { + "name": "show_preview", + "type": "Bool", + "description": "True, if message content must be displayed in notifications" } ] }, @@ -12641,7 +17796,7 @@ { "name": "message_id", "type": "int53", - "description": "The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id" + "description": "The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat" }, { "name": "sender_id", @@ -12689,6 +17844,55 @@ "class": "NotificationGroupType", "properties": [] }, + { + "name": "notificationSound", + "description": "Describes a notification sound in MP3 format", + "class": "NotificationSound", + "properties": [ + { + "name": "id", + "type": "int64", + "description": "Unique identifier of the notification sound" + }, + { + "name": "duration", + "type": "int32", + "description": "Duration of the sound, in seconds" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the sound was created" + }, + { + "name": "title", + "type": "string", + "description": "Title of the notification sound" + }, + { + "name": "data", + "type": "string", + "description": "Arbitrary data, defined while the sound was uploaded" + }, + { + "name": "sound", + "type": "file", + "description": "File containing the sound" + } + ] + }, + { + "name": "notificationSounds", + "description": "Contains a list of notification sounds", + "class": "NotificationSounds", + "properties": [ + { + "name": "notification_sounds", + "type": "vector\u003cnotificationSound\u003e", + "description": "A list of notification sounds" + } + ] + }, { "name": "notification", "description": "Contains information about a notification", @@ -12707,7 +17911,7 @@ { "name": "is_silent", "type": "Bool", - "description": "True, if the notification was initially silent" + "description": "True, if the notification was explicitly sent without sound" }, { "name": "type", @@ -12873,6 +18077,48 @@ } ] }, + { + "name": "storyPrivacySettingsEveryone", + "description": "The story can be viewed by everyone", + "class": "StoryPrivacySettings", + "properties": [ + { + "name": "except_user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the users that can't see the story; always unknown and empty for non-owned stories" + } + ] + }, + { + "name": "storyPrivacySettingsContacts", + "description": "The story can be viewed by all contacts except chosen users", + "class": "StoryPrivacySettings", + "properties": [ + { + "name": "except_user_ids", + "type": "vector\u003cint53\u003e", + "description": "User identifiers of the contacts that can't see the story; always unknown and empty for non-owned stories" + } + ] + }, + { + "name": "storyPrivacySettingsCloseFriends", + "description": "The story can be viewed by all close friends", + "class": "StoryPrivacySettings", + "properties": [] + }, + { + "name": "storyPrivacySettingsSelectedUsers", + "description": "The story can be viewed by certain specified users", + "class": "StoryPrivacySettings", + "properties": [ + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the users; always unknown and empty for non-owned stories" + } + ] + }, { "name": "userPrivacySettingRuleAllowAll", "description": "A rule to allow all users to do something", @@ -12881,7 +18127,7 @@ }, { "name": "userPrivacySettingRuleAllowContacts", - "description": "A rule to allow all of a user's contacts to do something", + "description": "A rule to allow all contacts of the user to do something", "class": "UserPrivacySettingRule", "properties": [] }, @@ -12917,7 +18163,7 @@ }, { "name": "userPrivacySettingRuleRestrictContacts", - "description": "A rule to restrict all contacts of a user from doing something", + "description": "A rule to restrict all contacts of the user from doing something", "class": "UserPrivacySettingRule", "properties": [] }, @@ -12981,6 +18227,12 @@ "class": "UserPrivacySetting", "properties": [] }, + { + "name": "userPrivacySettingShowBio", + "description": "A privacy setting for managing whether the user's bio is visible", + "class": "UserPrivacySetting", + "properties": [] + }, { "name": "userPrivacySettingAllowChatInvites", "description": "A privacy setting for managing whether the user can be invited to chats", @@ -13005,6 +18257,12 @@ "class": "UserPrivacySetting", "properties": [] }, + { + "name": "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages", + "description": "A privacy setting for managing whether the user can receive voice and video messages in private chats", + "class": "UserPrivacySetting", + "properties": [] + }, { "name": "accountTtl", "description": "Contains information about the period of inactivity after which the current user's account will automatically be deleted", @@ -13017,6 +18275,120 @@ } ] }, + { + "name": "messageAutoDeleteTime", + "description": "Contains default auto-delete timer setting for new chats", + "class": "MessageAutoDeleteTime", + "properties": [ + { + "name": "time", + "type": "int32", + "description": "Message auto-delete time, in seconds. If 0, then messages aren't deleted automatically" + } + ] + }, + { + "name": "sessionTypeAndroid", + "description": "The session is running on an Android device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeApple", + "description": "The session is running on a generic Apple device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeBrave", + "description": "The session is running on the Brave browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeChrome", + "description": "The session is running on the Chrome browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeEdge", + "description": "The session is running on the Edge browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeFirefox", + "description": "The session is running on the Firefox browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeIpad", + "description": "The session is running on an iPad device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeIphone", + "description": "The session is running on an iPhone device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeLinux", + "description": "The session is running on a Linux device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeMac", + "description": "The session is running on a Mac device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeOpera", + "description": "The session is running on the Opera browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeSafari", + "description": "The session is running on the Safari browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeUbuntu", + "description": "The session is running on an Ubuntu device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeUnknown", + "description": "The session is running on an unknown type of device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeVivaldi", + "description": "The session is running on the Vivaldi browser", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeWindows", + "description": "The session is running on a Windows device", + "class": "SessionType", + "properties": [] + }, + { + "name": "sessionTypeXbox", + "description": "The session is running on an Xbox console", + "class": "SessionType", + "properties": [] + }, { "name": "session", "description": "Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order", @@ -13035,7 +18407,12 @@ { "name": "is_password_pending", "type": "Bool", - "description": "True, if a password is needed to complete authorization of the session" + "description": "True, if a 2-step verification password is needed to complete authorization of the session" + }, + { + "name": "is_unconfirmed", + "type": "Bool", + "description": "True, if the session wasn't confirmed from another session" }, { "name": "can_accept_secret_chats", @@ -13047,6 +18424,11 @@ "type": "Bool", "description": "True, if incoming calls can be accepted by the session" }, + { + "name": "type", + "type": "SessionType", + "description": "Session type based on the system and application version, which can be used to display a corresponding icon" + }, { "name": "api_id", "type": "int32", @@ -13093,19 +18475,14 @@ "description": "Point in time (Unix timestamp) when the session was last used" }, { - "name": "ip", + "name": "ip_address", "type": "string", "description": "IP address from which the session was created, in human-readable format" }, { - "name": "country", + "name": "location", "type": "string", - "description": "A two-letter country code for the country from which the session was created, based on the IP address" - }, - { - "name": "region", - "type": "string", - "description": "Region code from which the session was created, based on the IP address" + "description": "A human-readable description of the location from which the session was created, based on the IP address" } ] }, @@ -13126,6 +18503,33 @@ } ] }, + { + "name": "unconfirmedSession", + "description": "Contains information about an unconfirmed session", + "class": "UnconfirmedSession", + "properties": [ + { + "name": "id", + "type": "int64", + "description": "Session identifier" + }, + { + "name": "log_in_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the user has logged in" + }, + { + "name": "device_model", + "type": "string", + "description": "Model of the device that was used for the session creation, as provided by the application" + }, + { + "name": "location", + "type": "string", + "description": "A human-readable description of the location from which the session was created, based on the IP address" + } + ] + }, { "name": "connectedWebsite", "description": "Contains information about one website the current user is logged in with Telegram", @@ -13167,14 +18571,14 @@ "description": "Point in time (Unix timestamp) when obtained authorization was last used" }, { - "name": "ip", + "name": "ip_address", "type": "string", "description": "IP address from which the user was logged in, in human-readable format" }, { "name": "location", "type": "string", - "description": "Human-readable description of a country and a region, from which the user was logged in, based on the IP address" + "description": "Human-readable description of a country and a region from which the user was logged in, based on the IP address" } ] }, @@ -13191,59 +18595,138 @@ ] }, { - "name": "chatReportReasonSpam", + "name": "reportReasonSpam", "description": "The chat contains spam messages", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonViolence", + "name": "reportReasonViolence", "description": "The chat promotes violence", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonPornography", + "name": "reportReasonPornography", "description": "The chat contains pornographic messages", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonChildAbuse", + "name": "reportReasonChildAbuse", "description": "The chat has child abuse related content", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonCopyright", + "name": "reportReasonCopyright", "description": "The chat contains copyrighted content", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonUnrelatedLocation", + "name": "reportReasonUnrelatedLocation", "description": "The location-based chat is unrelated to its stated location", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonFake", + "name": "reportReasonFake", "description": "The chat represents a fake account", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonCustom", - "description": "A custom reason provided by the user", - "class": "ChatReportReason", + "name": "reportReasonIllegalDrugs", + "description": "The chat has illegal drugs related content", + "class": "ReportReason", "properties": [] }, + { + "name": "reportReasonPersonalDetails", + "description": "The chat contains messages with personal details", + "class": "ReportReason", + "properties": [] + }, + { + "name": "reportReasonCustom", + "description": "A custom reason provided by the user", + "class": "ReportReason", + "properties": [] + }, + { + "name": "targetChatCurrent", + "description": "The currently opened chat needs to be kept", + "class": "TargetChat", + "properties": [] + }, + { + "name": "targetChatChosen", + "description": "The chat needs to be chosen by the user among chats of the specified types", + "class": "TargetChat", + "properties": [ + { + "name": "allow_user_chats", + "type": "Bool", + "description": "True, if private chats with ordinary users are allowed" + }, + { + "name": "allow_bot_chats", + "type": "Bool", + "description": "True, if private chats with other bots are allowed" + }, + { + "name": "allow_group_chats", + "type": "Bool", + "description": "True, if basic group and supergroup chats are allowed" + }, + { + "name": "allow_channel_chats", + "type": "Bool", + "description": "True, if channel chats are allowed" + } + ] + }, + { + "name": "targetChatInternalLink", + "description": "The chat needs to be open with the provided internal link", + "class": "TargetChat", + "properties": [ + { + "name": "link", + "type": "InternalLinkType", + "description": "An internal link pointing to the chat" + } + ] + }, { "name": "internalLinkTypeActiveSessions", - "description": "The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link", + "description": "The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link", "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeAttachmentMenuBot", + "description": "The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL", + "class": "InternalLinkType", + "properties": [ + { + "name": "target_chat", + "type": "TargetChat", + "description": "Target chat to be opened" + }, + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "url", + "type": "string", + "description": "URL to be passed to openWebApp" + } + ] + }, { "name": "internalLinkTypeAuthenticationCode", "description": "The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode", @@ -13268,6 +18751,23 @@ } ] }, + { + "name": "internalLinkTypeBotAddToChannel", + "description": "The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected administrator rights for the bot" + } + ] + }, { "name": "internalLinkTypeBotStart", "description": "The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed", @@ -13282,12 +18782,17 @@ "name": "start_parameter", "type": "string", "description": "The parameter to be passed to sendBotStartMessage" + }, + { + "name": "autostart", + "type": "Bool", + "description": "True, if sendBotStartMessage must be called automatically without showing the START button" } ] }, { "name": "internalLinkTypeBotStartInGroup", - "description": "The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group", + "description": "The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot's username added to the chat.", "class": "InternalLinkType", "properties": [ { @@ -13299,6 +18804,11 @@ "name": "start_parameter", "type": "string", "description": "The parameter to be passed to sendBotStartMessage" + }, + { + "name": "administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected administrator rights for the bot; may be null" } ] }, @@ -13308,6 +18818,36 @@ "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeChatBoost", + "description": "The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. If the user wants to boost the chat and the chat can be boosted, then call boostChat", + "class": "InternalLinkType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "URL to be passed to getChatBoostLinkInfo" + } + ] + }, + { + "name": "internalLinkTypeChatFolderInvite", + "description": "The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "invite_link", + "type": "string", + "description": "Internal representation of the invite link" + } + ] + }, + { + "name": "internalLinkTypeChatFolderSettings", + "description": "The link is a link to the folder section of the app settings", + "class": "InternalLinkType", + "properties": [] + }, { "name": "internalLinkTypeChatInvite", "description": "The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link", @@ -13321,8 +18861,14 @@ ] }, { - "name": "internalLinkTypeFilterSettings", - "description": "The link is a link to the filter settings section of the app", + "name": "internalLinkTypeDefaultMessageAutoDeleteTimerSettings", + "description": "The link is a link to the default message auto-delete timer settings section of the app settings", + "class": "InternalLinkType", + "properties": [] + }, + { + "name": "internalLinkTypeEditProfileSettings", + "description": "The link is a link to the edit profile section of the app settings", "class": "InternalLinkType", "properties": [] }, @@ -13343,6 +18889,35 @@ } ] }, + { + "name": "internalLinkTypeInstantView", + "description": "The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "URL to be passed to getWebPageInstantView" + }, + { + "name": "fallback_url", + "type": "string", + "description": "An URL to open if getWebPageInstantView fails" + } + ] + }, + { + "name": "internalLinkTypeInvoice", + "description": "The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "invoice_name", + "type": "string", + "description": "Name of the invoice" + } + ] + }, { "name": "internalLinkTypeLanguagePack", "description": "The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link", @@ -13355,9 +18930,15 @@ } ] }, + { + "name": "internalLinkTypeLanguageSettings", + "description": "The link is a link to the language section of the app settings", + "class": "InternalLinkType", + "properties": [] + }, { "name": "internalLinkTypeMessage", - "description": "The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link", + "description": "The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link", "class": "InternalLinkType", "properties": [ { @@ -13386,7 +18967,7 @@ }, { "name": "internalLinkTypePassportDataRequest", - "description": "The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the app, otherwise ignore it", + "description": "The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it", "class": "InternalLinkType", "properties": [ { @@ -13412,7 +18993,7 @@ { "name": "callback_url", "type": "string", - "description": "An HTTP URL to open once the request is finished or canceled with the parameter tg_passport=success or tg_passport=cancel respectively. If empty, then the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel needs to be opened instead" + "description": "An HTTP URL to open once the request is finished, canceled, or failed with the parameters tg_passport=success, tg_passport=cancel, or tg_passport=error\u0026error=... respectively. If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise" } ] }, @@ -13433,6 +19014,36 @@ } ] }, + { + "name": "internalLinkTypePremiumFeatures", + "description": "The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "referrer", + "type": "string", + "description": "Referrer specified in the link" + } + ] + }, + { + "name": "internalLinkTypePremiumGiftCode", + "description": "The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode", + "class": "InternalLinkType", + "properties": [ + { + "name": "code", + "type": "string", + "description": "The Telegram Premium gift code" + } + ] + }, + { + "name": "internalLinkTypePrivacyAndSecuritySettings", + "description": "The link is a link to the privacy and security section of the app settings", + "class": "InternalLinkType", + "properties": [] + }, { "name": "internalLinkTypeProxy", "description": "The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy", @@ -13441,7 +19052,7 @@ { "name": "server", "type": "string", - "description": "Proxy server IP address" + "description": "Proxy server domain or IP address" }, { "name": "port", @@ -13474,11 +19085,34 @@ "properties": [] }, { - "name": "internalLinkTypeSettings", - "description": "The link is a link to app settings", + "name": "internalLinkTypeRestorePurchases", + "description": "The link forces restore of App Store purchases when opened. For official iOS application only", "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeSettings", + "description": "The link is a link to application settings", + "class": "InternalLinkType", + "properties": [] + }, + { + "name": "internalLinkTypeSideMenuBot", + "description": "The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the bot is added to side menu, then use getWebAppUrl with the given URL", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "url", + "type": "string", + "description": "URL to be passed to getWebAppUrl" + } + ] + }, { "name": "internalLinkTypeStickerSet", "description": "The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set", @@ -13488,6 +19122,28 @@ "name": "sticker_set_name", "type": "string", "description": "Name of the sticker set" + }, + { + "name": "expect_custom_emoji", + "type": "Bool", + "description": "True, if the sticker set is expected to contain custom emoji" + } + ] + }, + { + "name": "internalLinkTypeStory", + "description": "The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier", + "class": "InternalLinkType", + "properties": [ + { + "name": "story_sender_username", + "type": "string", + "description": "Username of the sender of the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" } ] }, @@ -13505,7 +19161,7 @@ }, { "name": "internalLinkTypeThemeSettings", - "description": "The link is a link to the theme settings section of the app", + "description": "The link is a link to the theme section of the app settings", "class": "InternalLinkType", "properties": [] }, @@ -13527,9 +19183,33 @@ "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeUserPhoneNumber", + "description": "The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "phone_number", + "type": "string", + "description": "Phone number of the user" + } + ] + }, + { + "name": "internalLinkTypeUserToken", + "description": "The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link", + "class": "InternalLinkType", + "properties": [ + { + "name": "token", + "type": "string", + "description": "The token" + } + ] + }, { "name": "internalLinkTypeVideoChat", - "description": "The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link", + "description": "The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link", "class": "InternalLinkType", "properties": [ { @@ -13549,15 +19229,37 @@ } ] }, + { + "name": "internalLinkTypeWebApp", + "description": "The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being a third-party apps instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot that owns the Web App" + }, + { + "name": "web_app_short_name", + "type": "string", + "description": "Short name of the Web App" + }, + { + "name": "start_parameter", + "type": "string", + "description": "Start parameter to be passed to getWebAppLinkUrl" + } + ] + }, { "name": "messageLink", - "description": "Contains an HTTPS link to a message in a supergroup or channel", + "description": "Contains an HTTPS link to a message in a supergroup or channel, or a forum topic", "class": "MessageLink", "properties": [ { "name": "link", "type": "string", - "description": "Message link" + "description": "The link" }, { "name": "is_public", @@ -13568,18 +19270,23 @@ }, { "name": "messageLinkInfo", - "description": "Contains information about a link to a message in a chat", + "description": "Contains information about a link to a message or a forum topic in a chat", "class": "MessageLinkInfo", "properties": [ { "name": "is_public", "type": "Bool", - "description": "True, if the link is a public link for a message in a chat" + "description": "True, if the link is a public link for a message or a forum topic in a chat" }, { "name": "chat_id", "type": "int53", - "description": "If found, identifier of the chat to which the message belongs, 0 otherwise" + "description": "If found, identifier of the chat to which the link points, 0 otherwise" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing" }, { "name": "message", @@ -13589,20 +19296,61 @@ { "name": "media_timestamp", "type": "int32", - "description": "Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview" + "description": "Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview" }, { "name": "for_album", "type": "Bool", "description": "True, if the whole media album to which the message belongs is linked" - }, - { - "name": "for_comment", - "type": "Bool", - "description": "True, if the message is linked as a channel post comment or from a message thread" } ] }, + { + "name": "chatBoostLink", + "description": "Contains an HTTPS link to boost a chat", + "class": "ChatBoostLink", + "properties": [ + { + "name": "link", + "type": "string", + "description": "The link" + }, + { + "name": "is_public", + "type": "Bool", + "description": "True, if the link will work for non-members of the chat" + } + ] + }, + { + "name": "chatBoostLinkInfo", + "description": "Contains information about a link to boost a chat", + "class": "ChatBoostLinkInfo", + "properties": [ + { + "name": "is_public", + "type": "Bool", + "description": "True, if the link will work for non-members of the chat" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the link points; 0 if the chat isn't found" + } + ] + }, + { + "name": "blockListMain", + "description": "The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions", + "class": "BlockList", + "properties": [] + }, + { + "name": "blockListStories", + "description": "The block list that disallows viewing of stories of the current user", + "class": "BlockList", + "properties": [] + }, { "name": "filePart", "description": "Contains a part of a file", @@ -13639,12 +19387,24 @@ "class": "FileType", "properties": [] }, + { + "name": "fileTypeNotificationSound", + "description": "The file is a notification sound", + "class": "FileType", + "properties": [] + }, { "name": "fileTypePhoto", "description": "The file is a photo", "class": "FileType", "properties": [] }, + { + "name": "fileTypePhotoStory", + "description": "The file is a photo published as a story", + "class": "FileType", + "properties": [] + }, { "name": "fileTypeProfilePhoto", "description": "The file is a profile photo", @@ -13699,6 +19459,12 @@ "class": "FileType", "properties": [] }, + { + "name": "fileTypeVideoStory", + "description": "The file is a video published as a story", + "class": "FileType", + "properties": [] + }, { "name": "fileTypeVoiceNote", "description": "The file is a voice note", @@ -13944,12 +19710,12 @@ }, { "name": "max_video_file_size", - "type": "int32", + "type": "int53", "description": "The maximum size of a video file to be auto-downloaded, in bytes" }, { "name": "max_other_file_size", - "type": "int32", + "type": "int53", "description": "The maximum size of other file types to be auto-downloaded, in bytes" }, { @@ -13967,6 +19733,11 @@ "type": "Bool", "description": "True, if the next audio track needs to be preloaded while the user is listening to an audio file" }, + { + "name": "preload_stories", + "type": "Bool", + "description": "True, if stories needs to be preloaded" + }, { "name": "use_less_data_for_calls", "type": "Bool", @@ -13996,6 +19767,102 @@ } ] }, + { + "name": "autosaveSettingsScopePrivateChats", + "description": "Autosave settings applied to all private chats without chat-specific settings", + "class": "AutosaveSettingsScope", + "properties": [] + }, + { + "name": "autosaveSettingsScopeGroupChats", + "description": "Autosave settings applied to all basic group and supergroup chats without chat-specific settings", + "class": "AutosaveSettingsScope", + "properties": [] + }, + { + "name": "autosaveSettingsScopeChannelChats", + "description": "Autosave settings applied to all channel chats without chat-specific settings", + "class": "AutosaveSettingsScope", + "properties": [] + }, + { + "name": "autosaveSettingsScopeChat", + "description": "Autosave settings applied to a chat", + "class": "AutosaveSettingsScope", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ] + }, + { + "name": "scopeAutosaveSettings", + "description": "Contains autosave settings for an autosave settings scope", + "class": "ScopeAutosaveSettings", + "properties": [ + { + "name": "autosave_photos", + "type": "Bool", + "description": "True, if photo autosave is enabled" + }, + { + "name": "autosave_videos", + "type": "Bool", + "description": "True, if video autosave is enabled" + }, + { + "name": "max_video_file_size", + "type": "int53", + "description": "The maximum size of a video file to be autosaved, in bytes; 512 KB - 4000 MB" + } + ] + }, + { + "name": "autosaveSettingsException", + "description": "Contains autosave settings for a chat, which overrides default settings for the corresponding scope", + "class": "AutosaveSettingsException", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "settings", + "type": "scopeAutosaveSettings", + "description": "Autosave settings for the chat" + } + ] + }, + { + "name": "autosaveSettings", + "description": "Describes autosave settings", + "class": "AutosaveSettings", + "properties": [ + { + "name": "private_chat_settings", + "type": "scopeAutosaveSettings", + "description": "Default autosave settings for private chats" + }, + { + "name": "group_settings", + "type": "scopeAutosaveSettings", + "description": "Default autosave settings for basic group and supergroup chats" + }, + { + "name": "channel_settings", + "type": "scopeAutosaveSettings", + "description": "Default autosave settings for channel chats" + }, + { + "name": "exceptions", + "type": "vector\u003cautosaveSettingsException\u003e", + "description": "Autosave settings for specific chats" + } + ] + }, { "name": "connectionStateWaitingForNetwork", "description": "Currently waiting for the network to become available. Use setNetworkType to change the available network type", @@ -14068,6 +19935,35 @@ "class": "TopChatCategory", "properties": [] }, + { + "name": "foundPosition", + "description": "Contains 0-based match position", + "class": "FoundPosition", + "properties": [ + { + "name": "position", + "type": "int32", + "description": "The position of the match" + } + ] + }, + { + "name": "foundPositions", + "description": "Contains 0-based positions of matched objects", + "class": "FoundPositions", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Total number of matched objects" + }, + { + "name": "positions", + "type": "vector\u003cint32\u003e", + "description": "The positions of the matched objects" + } + ] + }, { "name": "tMeUrlTypeUser", "description": "A URL linking to a user", @@ -14100,7 +19996,7 @@ { "name": "info", "type": "chatInviteLinkInfo", - "description": "Chat invite link info" + "description": "Information about the chat invite link" } ] }, @@ -14147,7 +20043,7 @@ }, { "name": "suggestedActionEnableArchiveAndMuteNewChats", - "description": "Suggests the user to enable \"archive_and_mute_new_chats_from_unknown_users\" option", + "description": "Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings", "class": "SuggestedAction", "properties": [] }, @@ -14189,10 +20085,28 @@ { "name": "authorization_delay", "type": "int32", - "description": "The number of days to pass between consecutive authorizations if the user declines to set password" + "description": "The number of days to pass between consecutive authorizations if the user declines to set password; if 0, then the user is advised to set the password for security reasons" } ] }, + { + "name": "suggestedActionUpgradePremium", + "description": "Suggests the user to upgrade the Premium subscription from monthly payments to annual payments", + "class": "SuggestedAction", + "properties": [] + }, + { + "name": "suggestedActionRestorePremium", + "description": "Suggests the user to restore a recently expired Premium subscription", + "class": "SuggestedAction", + "properties": [] + }, + { + "name": "suggestedActionSubscribeToAnnualPremium", + "description": "Suggests the user to subscribe to the Premium subscription with annual payments", + "class": "SuggestedAction", + "properties": [] + }, { "name": "count", "description": "Contains a counter", @@ -14229,6 +20143,18 @@ } ] }, + { + "name": "fileDownloadedPrefixSize", + "description": "Contains size of downloaded prefix of a file", + "class": "FileDownloadedPrefixSize", + "properties": [ + { + "name": "size", + "type": "int53", + "description": "The prefix size, in bytes" + } + ] + }, { "name": "deepLinkInfo", "description": "Contains information about a tg: deep link", @@ -14328,7 +20254,7 @@ { "name": "server", "type": "string", - "description": "Proxy server IP address" + "description": "Proxy server domain or IP address" }, { "name": "port", @@ -14365,41 +20291,29 @@ ] }, { - "name": "inputStickerStatic", - "description": "A static sticker in PNG format, which will be converted to WEBP server-side", + "name": "inputSticker", + "description": "A sticker to be added to a sticker set", "class": "InputSticker", "properties": [ { "name": "sticker", "type": "InputFile", - "description": "PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square" + "description": "File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" }, { "name": "emojis", "type": "string", - "description": "Emojis corresponding to the sticker" + "description": "String with 1-20 emoji corresponding to the sticker" }, { "name": "mask_position", "type": "maskPosition", - "description": "For masks, position where the mask is placed; pass null if unspecified" - } - ] - }, - { - "name": "inputStickerAnimated", - "description": "An animated sticker in TGS format", - "class": "InputSticker", - "properties": [ - { - "name": "sticker", - "type": "InputFile", - "description": "File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" + "description": "Position where the mask is placed; pass null if not specified" }, { - "name": "emojis", - "type": "string", - "description": "Emojis corresponding to the sticker" + "name": "keywords", + "type": "vector\u003cstring\u003e", + "description": "List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker" } ] }, @@ -14686,7 +20600,7 @@ { "name": "enabled_notifications_percentage", "type": "double", - "description": "A percentage of users with enabled notifications for the chat" + "description": "A percentage of users with enabled notifications for the chat; 0-100" }, { "name": "member_count_graph", @@ -14942,14 +20856,9 @@ "description": "The previous temporary message identifier" }, { - "name": "error_code", - "type": "int32", - "description": "An error code" - }, - { - "name": "error_message", - "type": "string", - "description": "Error message" + "name": "error", + "type": "error", + "description": "The cause of the message sending failure" } ] }, @@ -15048,7 +20957,7 @@ }, { "name": "updateMessageContentOpened", - "description": "The message content was opened. Updates voice note messages to \"listened\", video note messages to \"viewed\" and starts the TTL timer for self-destructing messages", + "description": "The message content was opened. Updates voice note messages to \"listened\", video note messages to \"viewed\" and starts the self-destruct timer", "class": "Update", "properties": [ { @@ -15085,6 +20994,33 @@ } ] }, + { + "name": "updateMessageUnreadReactions", + "description": "The list of unread reactions added to a message was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "unread_reactions", + "type": "vector\u003cunreadReaction\u003e", + "description": "The new list of unread reactions" + }, + { + "name": "unread_reaction_count", + "type": "int32", + "description": "The new number of messages with unread reactions left in the chat" + } + ] + }, { "name": "updateMessageLiveLocationViewed", "description": "A message with a live location was viewed. When the update is received, the application is supposed to update the live location", @@ -15148,6 +21084,40 @@ } ] }, + { + "name": "updateChatAccentColor", + "description": "A chat accent color has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "accent_color_id", + "type": "int32", + "description": "The new chat accent color identifier" + } + ] + }, + { + "name": "updateChatBackgroundCustomEmoji", + "description": "A chat's custom emoji for reply background has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "background_custom_emoji_id", + "type": "int64", + "description": "The new tdentifier of a custom emoji to be shown on the reply header background" + } + ] + }, { "name": "updateChatPermissions", "description": "Chat permissions was changed", @@ -15167,7 +21137,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", "class": "Update", "properties": [ { @@ -15178,7 +21148,7 @@ { "name": "last_message", "type": "message", - "description": "The new last message in the chat; may be null" + "description": "The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update" }, { "name": "positions", @@ -15189,7 +21159,7 @@ }, { "name": "updateChatPosition", - "description": "The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent", + "description": "The position of a chat in a chat list has changed. An updateChatLastMessage or updateChatDraftMessage update might be sent instead of the update", "class": "Update", "properties": [ { @@ -15260,6 +21230,23 @@ } ] }, + { + "name": "updateChatAvailableReactions", + "description": "The chat available reactions were changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "available_reactions", + "type": "ChatAvailableReactions", + "description": "The new reactions, available in the chat" + } + ] + }, { "name": "updateChatDraftMessage", "description": "A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied", @@ -15300,8 +21287,8 @@ ] }, { - "name": "updateChatMessageTtl", - "description": "The message Time To Live setting for a chat was changed", + "name": "updateChatMessageAutoDeleteTime", + "description": "The message auto-delete or self-destruct timer setting for a chat was changed", "class": "Update", "properties": [ { @@ -15310,9 +21297,9 @@ "description": "Chat identifier" }, { - "name": "message_ttl", + "name": "message_auto_delete_time", "type": "int32", - "description": "New value of message_ttl" + "description": "New value of message_auto_delete_time" } ] }, @@ -15367,6 +21354,23 @@ } ] }, + { + "name": "updateChatBackground", + "description": "The chat background was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "background", + "type": "chatBackground", + "description": "The new chat background; may be null if background was reset to default" + } + ] + }, { "name": "updateChatTheme", "description": "The chat theme was changed", @@ -15401,6 +21405,23 @@ } ] }, + { + "name": "updateChatUnreadReactionCount", + "description": "The chat unread_reaction_count has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "unread_reaction_count", + "type": "int32", + "description": "The number of messages with unread reactions left in the chat" + } + ] + }, { "name": "updateChatVideoChat", "description": "A chat video chat state has changed", @@ -15453,8 +21474,8 @@ ] }, { - "name": "updateChatHasScheduledMessages", - "description": "A chat's has_scheduled_messages field has changed", + "name": "updateChatIsTranslatable", + "description": "Translation of chat messages was enabled or disabled", "class": "Update", "properties": [ { @@ -15463,26 +21484,9 @@ "description": "Chat identifier" }, { - "name": "has_scheduled_messages", + "name": "is_translatable", "type": "Bool", - "description": "New value of has_scheduled_messages" - } - ] - }, - { - "name": "updateChatIsBlocked", - "description": "A chat was blocked or unblocked", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "is_blocked", - "type": "Bool", - "description": "New value of is_blocked" + "description": "New value of is_translatable" } ] }, @@ -15504,20 +21508,59 @@ ] }, { - "name": "updateChatFilters", - "description": "The list of chat filters or a chat filter has changed", + "name": "updateChatBlockList", + "description": "A chat was blocked or unblocked", "class": "Update", "properties": [ { - "name": "chat_filters", - "type": "vector\u003cchatFilterInfo\u003e", - "description": "The new list of chat filters" + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "block_list", + "type": "BlockList", + "description": "Block list to which the chat is added; may be null if none" + } + ] + }, + { + "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": "updateChatFolders", + "description": "The list of chat folders or a chat folder has changed", + "class": "Update", + "properties": [ + { + "name": "chat_folders", + "type": "vector\u003cchatFolderInfo\u003e", + "description": "The new list of chat folders" + }, + { + "name": "main_chat_list_position", + "type": "int32", + "description": "Position of the main chat list among chat folders, 0-based" } ] }, { "name": "updateChatOnlineMemberCount", - "description": "The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed", + "description": "The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed", "class": "Update", "properties": [ { @@ -15532,6 +21575,23 @@ } ] }, + { + "name": "updateForumTopicInfo", + "description": "Basic information about a topic in a forum chat was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "info", + "type": "forumTopicInfo", + "description": "New information about the topic" + } + ] + }, { "name": "updateScopeNotificationSettings", "description": "Notification settings for some type of chats were updated", @@ -15592,9 +21652,9 @@ "description": "Chat identifier, which notification settings must be applied to the added notifications" }, { - "name": "is_silent", - "type": "Bool", - "description": "True, if the notifications must be shown without sound" + "name": "notification_sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played; 0 if sound is disabled" }, { "name": "total_count", @@ -15604,12 +21664,12 @@ { "name": "added_notifications", "type": "vector\u003cnotification\u003e", - "description": "List of added group notifications, sorted by notification ID" + "description": "List of added group notifications, sorted by notification identifier" }, { "name": "removed_notification_ids", "type": "vector\u003cint32\u003e", - "description": "Identifiers of removed group notifications, sorted by notification ID" + "description": "Identifiers of removed group notifications, sorted by notification identifier" } ] }, @@ -15880,6 +21940,89 @@ } ] }, + { + "name": "updateFileDownloads", + "description": "The state of the file download list has changed", + "class": "Update", + "properties": [ + { + "name": "total_size", + "type": "int53", + "description": "Total size of files in the file download list, in bytes" + }, + { + "name": "total_count", + "type": "int32", + "description": "Total number of files in the file download list" + }, + { + "name": "downloaded_size", + "type": "int53", + "description": "Total downloaded size of files in the file download list, in bytes" + } + ] + }, + { + "name": "updateFileAddedToDownloads", + "description": "A file was added to the file download list. This update is sent only after file download list is loaded for the first time", + "class": "Update", + "properties": [ + { + "name": "file_download", + "type": "fileDownload", + "description": "The added file download" + }, + { + "name": "counts", + "type": "downloadedFileCounts", + "description": "New number of being downloaded and recently downloaded files found" + } + ] + }, + { + "name": "updateFileDownload", + "description": "A file download was changed. This update is sent only after file download list is loaded for the first time", + "class": "Update", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "File identifier" + }, + { + "name": "complete_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "True, if downloading of the file is paused" + }, + { + "name": "counts", + "type": "downloadedFileCounts", + "description": "New number of being downloaded and recently downloaded files found" + } + ] + }, + { + "name": "updateFileRemovedFromDownloads", + "description": "A file was removed from the file download list. This update is sent only after file download list is loaded for the first time", + "class": "Update", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "File identifier" + }, + { + "name": "counts", + "type": "downloadedFileCounts", + "description": "New number of being downloaded and recently downloaded files found" + } + ] + }, { "name": "updateCall", "description": "New call was created or information about a call was updated", @@ -16014,6 +22157,120 @@ } ] }, + { + "name": "updateStory", + "description": "A story was changed", + "class": "Update", + "properties": [ + { + "name": "story", + "type": "story", + "description": "The new information about the story" + } + ] + }, + { + "name": "updateStoryDeleted", + "description": "A story became inaccessible", + "class": "Update", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + } + ] + }, + { + "name": "updateStorySendSucceeded", + "description": "A story has been successfully sent", + "class": "Update", + "properties": [ + { + "name": "story", + "type": "story", + "description": "The sent story" + }, + { + "name": "old_story_id", + "type": "int32", + "description": "The previous temporary story identifier" + } + ] + }, + { + "name": "updateStorySendFailed", + "description": "A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update", + "class": "Update", + "properties": [ + { + "name": "story", + "type": "story", + "description": "The failed to send story" + }, + { + "name": "error", + "type": "error", + "description": "The cause of the story sending failure" + }, + { + "name": "error_type", + "type": "CanSendStoryResult", + "description": "Type of the error; may be null if unknown" + } + ] + }, + { + "name": "updateChatActiveStories", + "description": "The list of active stories posted by a specific chat has changed", + "class": "Update", + "properties": [ + { + "name": "active_stories", + "type": "chatActiveStories", + "description": "The new list of active stories" + } + ] + }, + { + "name": "updateStoryListChatCount", + "description": "Number of chats in a story list has changed", + "class": "Update", + "properties": [ + { + "name": "story_list", + "type": "StoryList", + "description": "The story list" + }, + { + "name": "chat_count", + "type": "int32", + "description": "Approximate total number of chats with active stories in the list" + } + ] + }, + { + "name": "updateStoryStealthMode", + "description": "Story stealth mode settings have changed", + "class": "Update", + "properties": [ + { + "name": "active_until_date", + "type": "int32", + "description": "Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled" + }, + { + "name": "cooldown_until_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown" + } + ] + }, { "name": "updateOption", "description": "An option changed its value", @@ -16049,9 +22306,9 @@ "class": "Update", "properties": [ { - "name": "is_masks", - "type": "Bool", - "description": "True, if the list of installed mask sticker sets was updated" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the affected stickers" }, { "name": "sticker_set_ids", @@ -16065,9 +22322,14 @@ "description": "The list of trending sticker sets was updated or some of them were viewed", "class": "Update", "properties": [ + { + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the affected stickers" + }, { "name": "sticker_sets", - "type": "stickerSets", + "type": "trendingStickerSets", "description": "The prefix of the list of trending sticker sets with the newest trending sticker sets" } ] @@ -16080,7 +22342,7 @@ { "name": "is_attached", "type": "Bool", - "description": "True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated" + "description": "True, if the list of stickers attached to photo or video files was updated; otherwise, the list of sent stickers is updated" }, { "name": "sticker_ids", @@ -16113,6 +22375,18 @@ } ] }, + { + "name": "updateSavedNotificationSounds", + "description": "The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time", + "class": "Update", + "properties": [ + { + "name": "notification_sound_ids", + "type": "vector\u003cint64\u003e", + "description": "The new list of identifiers of saved notification sounds" + } + ] + }, { "name": "updateSelectedBackground", "description": "The selected background has changed", @@ -16142,6 +22416,23 @@ } ] }, + { + "name": "updateAccentColors", + "description": "The list of supported accent colors has changed", + "class": "Update", + "properties": [ + { + "name": "colors", + "type": "vector\u003caccentColor\u003e", + "description": "Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme" + }, + { + "name": "available_accent_color_ids", + "type": "vector\u003cint32\u003e", + "description": "The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order" + } + ] + }, { "name": "updateLanguagePackStrings", "description": "Some language pack strings have been updated", @@ -16160,7 +22451,7 @@ { "name": "strings", "type": "vector\u003clanguagePackString\u003e", - "description": "List of changed language pack strings" + "description": "List of changed language pack strings; empty if all strings have changed" } ] }, @@ -16205,6 +22496,66 @@ } ] }, + { + "name": "updateUnconfirmedSession", + "description": "The first unconfirmed session has changed", + "class": "Update", + "properties": [ + { + "name": "session", + "type": "unconfirmedSession", + "description": "The unconfirmed session; may be null if none" + } + ] + }, + { + "name": "updateAttachmentMenuBots", + "description": "The list of bots added to attachment or side menu has changed", + "class": "Update", + "properties": [ + { + "name": "bots", + "type": "vector\u003cattachmentMenuBot\u003e", + "description": "The new list of bots. The bots must not be shown on scheduled messages screen" + } + ] + }, + { + "name": "updateWebAppMessageSent", + "description": "A message was sent by an opened Web App, so the Web App needs to be closed", + "class": "Update", + "properties": [ + { + "name": "web_app_launch_id", + "type": "int64", + "description": "Identifier of Web App launch" + } + ] + }, + { + "name": "updateActiveEmojiReactions", + "description": "The list of active emoji reactions has changed", + "class": "Update", + "properties": [ + { + "name": "emojis", + "type": "vector\u003cstring\u003e", + "description": "The new list of active emoji reactions" + } + ] + }, + { + "name": "updateDefaultReactionType", + "description": "The type of default reaction has changed", + "class": "Update", + "properties": [ + { + "name": "reaction_type", + "type": "ReactionType", + "description": "The new type of the default reaction" + } + ] + }, { "name": "updateDiceEmojis", "description": "The list of supported dice emojis has changed", @@ -16241,7 +22592,7 @@ }, { "name": "updateAnimationSearchParameters", - "description": "The parameters of animation search through GetOption(\"animation_search_bot_username\") bot has changed", + "description": "The parameters of animation search through getOption(\"animation_search_bot_username\") bot has changed", "class": "Update", "properties": [ { @@ -16273,6 +22624,40 @@ } ] }, + { + "name": "updateAddChatMembersPrivacyForbidden", + "description": "Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of users, which weren't added because of their privacy settings" + } + ] + }, + { + "name": "updateAutosaveSettings", + "description": "Autosave settings for some type of chats were updated", + "class": "Update", + "properties": [ + { + "name": "scope", + "type": "AutosaveSettingsScope", + "description": "Type of chats for which autosave settings were updated" + }, + { + "name": "settings", + "type": "scopeAutosaveSettings", + "description": "The new autosave settings; may be null if the settings are reset to default" + } + ] + }, { "name": "updateNewInlineQuery", "description": "A new incoming inline query; for bots only", @@ -16296,7 +22681,7 @@ { "name": "chat_type", "type": "ChatType", - "description": "The type of the chat, from which the query originated; may be null if unknown" + "description": "The type of the chat from which the query originated; may be null if unknown" }, { "name": "query", @@ -16365,7 +22750,7 @@ { "name": "message_id", "type": "int53", - "description": "Identifier of the message, from which the query originated" + "description": "Identifier of the message from which the query originated" }, { "name": "chat_instance", @@ -16397,7 +22782,7 @@ { "name": "inline_message_id", "type": "string", - "description": "Identifier of the inline message, from which the query originated" + "description": "Identifier of the inline message from which the query originated" }, { "name": "chat_instance", @@ -16537,9 +22922,9 @@ "description": "Unique poll identifier" }, { - "name": "user_id", - "type": "int53", - "description": "The user, who changed the answer to the poll" + "name": "voter_id", + "type": "MessageSender", + "description": "Identifier of the message sender that changed the answer to the poll" }, { "name": "option_ids", @@ -16573,6 +22958,11 @@ "type": "chatInviteLink", "description": "If user has joined the chat using an invite link, the invite link; may be null" }, + { + "name": "via_chat_folder_invite_link", + "type": "Bool", + "description": "True, if the user has joined the chat using an invite link for a chat folder" + }, { "name": "old_chat_member", "type": "chatMember", @@ -16600,6 +22990,11 @@ "type": "chatJoinRequest", "description": "Join request" }, + { + "name": "user_chat_id", + "type": "int53", + "description": "Chat identifier of the private chat with the user" + }, { "name": "invite_link", "type": "chatInviteLink", @@ -16607,6 +23002,23 @@ } ] }, + { + "name": "updateChatBoost", + "description": "A chat boost has changed; for bots only", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "boost", + "type": "chatBoost", + "description": "New information about the boost" + } + ] + }, { "name": "updates", "description": "Contains a list of updates", @@ -16677,6 +23089,28 @@ } ] }, + { + "name": "userSupportInfo", + "description": "Contains custom information about the user", + "class": "UserSupportInfo", + "properties": [ + { + "name": "message", + "type": "formattedText", + "description": "Information message" + }, + { + "name": "author", + "type": "string", + "description": "Information author" + }, + { + "name": "date", + "type": "int32", + "description": "Information change date" + } + ] + }, { "name": "testInt", "description": "A simple object containing a number; for testing only", @@ -16767,6 +23201,14 @@ "name": "AuthenticationCodeType", "description": "Provides information about the method by which an authentication code is delivered to the user" }, + { + "name": "EmailAddressAuthentication", + "description": "Contains authentication data for a email address" + }, + { + "name": "EmailAddressResetState", + "description": "Describes reset state of a email address" + }, { "name": "AuthorizationState", "description": "Represents the current authorization state of the TDLib client" @@ -16777,12 +23219,24 @@ }, { "name": "ThumbnailFormat", - "description": "Describes format of the thumbnail" + "description": "Describes format of a thumbnail" }, { "name": "MaskPoint", "description": "Part of the face, relative to which a mask is placed" }, + { + "name": "StickerFormat", + "description": "Describes format of a sticker" + }, + { + "name": "StickerType", + "description": "Describes type of a sticker" + }, + { + "name": "StickerFullType", + "description": "Contains full information about sticker type" + }, { "name": "PollType", "description": "Describes the type of a poll" @@ -16791,10 +23245,22 @@ "name": "UserType", "description": "Represents the type of a user. The following types are possible: regular users, deleted users and bots" }, + { + "name": "ChatPhotoStickerType", + "description": "Describes type of a sticker, which was used to create a chat photo" + }, { "name": "InputChatPhoto", "description": "Describes a photo to be set as a user profile or chat photo" }, + { + "name": "PremiumGiveawayParticipantStatus", + "description": "Contains information about status of a user in a Telegram Premium giveaway" + }, + { + "name": "PremiumGiveawayInfo", + "description": "Contains information about Telegram Premium giveaway" + }, { "name": "ChatMemberStatus", "description": "Provides information about the status of a member in a chat" @@ -16807,6 +23273,10 @@ "name": "SupergroupMembersFilter", "description": "Specifies the kind of chat members to return in getSupergroupMembers" }, + { + "name": "InviteLinkChatType", + "description": "Describes the type of a chat to which points an invite link" + }, { "name": "SecretChatState", "description": "Describes the current secret chat state" @@ -16816,13 +23286,33 @@ "description": "Contains information about the sender of a message" }, { - "name": "MessageForwardOrigin", - "description": "Contains information about the origin of a forwarded message" + "name": "MessageOrigin", + "description": "Contains information about the origin of a message" + }, + { + "name": "ReactionType", + "description": "Describes type of message reaction" }, { "name": "MessageSendingState", "description": "Contains information about the sending state of the message" }, + { + "name": "MessageReplyTo", + "description": "Contains information about the message or the story a message is replying to" + }, + { + "name": "InputMessageReplyTo", + "description": "Contains information about the message or the story to be replied" + }, + { + "name": "MessageSource", + "description": "Describes source of a message" + }, + { + "name": "MessageSponsorType", + "description": "Describes type of a message sponsor" + }, { "name": "NotificationSettingsScope", "description": "Describes the types of chats to which notification settings are relevant" @@ -16839,6 +23329,10 @@ "name": "ChatSource", "description": "Describes a reason why an external chat is shown in a chat list" }, + { + "name": "ChatAvailableReactions", + "description": "Describes reactions available in the chat" + }, { "name": "PublicChatType", "description": "Describes a type of public chats" @@ -16883,6 +23377,18 @@ "name": "InputCredentials", "description": "Contains information about the payment method chosen by the user" }, + { + "name": "PaymentProvider", + "description": "Contains information about a payment provider" + }, + { + "name": "InputInvoice", + "description": "Describes an invoice to process" + }, + { + "name": "MessageExtendedMedia", + "description": "Describes a media, which is attached to an invoice" + }, { "name": "PassportElementType", "description": "Contains the type of a Telegram Passport element" @@ -16915,6 +23421,10 @@ "name": "MessageSchedulingState", "description": "Contains information about the time when a scheduled message will be sent" }, + { + "name": "MessageSelfDestructType", + "description": "Describes when a message will be self-destructed" + }, { "name": "InputMessageContent", "description": "The content of a message to send" @@ -16931,6 +23441,34 @@ "name": "UserStatus", "description": "Describes the last time the user was online" }, + { + "name": "EmojiCategoryType", + "description": "Describes type of an emoji category" + }, + { + "name": "StoryAreaType", + "description": "Describes type of a clickable rectangle area on a story media" + }, + { + "name": "InputStoryAreaType", + "description": "Describes type of a clickable rectangle area on a story media to be added" + }, + { + "name": "StoryContent", + "description": "Contains the content of a story" + }, + { + "name": "InputStoryContent", + "description": "The content of a story to send" + }, + { + "name": "StoryList", + "description": "Describes a list of stories" + }, + { + "name": "ChatBoostSource", + "description": "Describes source of a chat boost" + }, { "name": "CallDiscardReason", "description": "Describes the reason why a call was discarded" @@ -16951,10 +23489,22 @@ "name": "CallProblem", "description": "Describes the exact type of a problem with a call" }, + { + "name": "FirebaseAuthenticationSettings", + "description": "Contains settings for Firebase Authentication in the official applications" + }, { "name": "DiceStickers", "description": "Contains animated stickers which must be used for dice animation rendering" }, + { + "name": "SpeechRecognitionResult", + "description": "Describes result of speech recognition in a voice note" + }, + { + "name": "BotWriteAccessAllowReason", + "description": "Describes a reason why a bot was allowed to write messages to the current user" + }, { "name": "InputInlineQueryResult", "description": "Represents a single result of an inline query; for bots only" @@ -16963,6 +23513,10 @@ "name": "InlineQueryResult", "description": "Represents a single result of an inline query" }, + { + "name": "InlineQueryResultsButtonType", + "description": "Represents a type of a button in results of inline query" + }, { "name": "CallbackQueryPayload", "description": "Represents a payload of a callback query" @@ -16975,6 +23529,30 @@ "name": "LanguagePackStringValue", "description": "Represents the value of a string in a language pack" }, + { + "name": "PremiumLimitType", + "description": "Describes type of a limit, increased for Premium users" + }, + { + "name": "PremiumFeature", + "description": "Describes a feature available to Premium users" + }, + { + "name": "PremiumStoryFeature", + "description": "Describes a story feature available to Premium users" + }, + { + "name": "PremiumSource", + "description": "Describes a source from which the Premium features screen is opened" + }, + { + "name": "StorePaymentPurpose", + "description": "Describes a purpose of an in-store payment" + }, + { + "name": "TelegramPaymentPurpose", + "description": "Describes a purpose of a payment toward Telegram" + }, { "name": "DeviceToken", "description": "Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org" @@ -16991,6 +23569,10 @@ "name": "InputBackground", "description": "Contains information about background to set" }, + { + "name": "CanSendStoryResult", + "description": "Represents result of checking whether the current user can send a story in the specific chat" + }, { "name": "CanTransferOwnershipResult", "description": "Represents result of checking whether the current session can be used to transfer a chat ownership to another user" @@ -17031,21 +23613,37 @@ "name": "JsonValue", "description": "Represents a JSON value" }, + { + "name": "StoryPrivacySettings", + "description": "Describes privacy settings of a story" + }, { "name": "UserPrivacySettingRule", - "description": "Represents a single rule for managing privacy settings" + "description": "Represents a single rule for managing user privacy settings" }, { "name": "UserPrivacySetting", "description": "Describes available user privacy settings" }, { - "name": "ChatReportReason", + "name": "SessionType", + "description": "Represents the type of a session" + }, + { + "name": "ReportReason", "description": "Describes the reason why a chat is reported" }, + { + "name": "TargetChat", + "description": "Describes the target chat to be opened" + }, { "name": "InternalLinkType", - "description": "Describes an internal https://t.me or tg: link, which must be processed by the app in a special way" + "description": "Describes an internal https://t.me or tg: link, which must be processed by the application in a special way" + }, + { + "name": "BlockList", + "description": "Describes a type of a block list" }, { "name": "FileType", @@ -17059,6 +23657,10 @@ "name": "NetworkStatisticsEntry", "description": "Contains statistics about network usage" }, + { + "name": "AutosaveSettingsScope", + "description": "Describes scope of autosave settings" + }, { "name": "ConnectionState", "description": "Describes the current state of the connection to Telegram servers" @@ -17077,16 +23679,12 @@ }, { "name": "TextParseMode", - "description": "Describes the way the text needs to be parsed for TextEntities" + "description": "Describes the way the text needs to be parsed for text entities" }, { "name": "ProxyType", "description": "Describes the type of a proxy server" }, - { - "name": "InputSticker", - "description": "Describes a sticker that needs to be added to a sticker set" - }, { "name": "StatisticalGraph", "description": "Describes a statistical graph" @@ -17127,23 +23725,84 @@ "class": "Ok", "properties": [ { - "name": "parameters", - "type": "tdlibParameters", - "description": "Parameters for TDLib initialization" - } - ], - "is_synchronous": false, - "type": 1 - }, - { - "name": "checkDatabaseEncryptionKey", - "description": "Checks the database encryption key for correctness. Works only when the current authorization state is authorizationStateWaitEncryptionKey", - "class": "Ok", - "properties": [ + "name": "use_test_dc", + "type": "Bool", + "description": "Pass true to use Telegram test environment instead of the production environment" + }, { - "name": "encryption_key", + "name": "database_directory", + "type": "string", + "description": "The path to the directory for the persistent database; if empty, the current working directory will be used" + }, + { + "name": "files_directory", + "type": "string", + "description": "The path to the directory for storing files; if empty, database_directory will be used" + }, + { + "name": "database_encryption_key", "type": "bytes", - "description": "Encryption key to check or set up" + "description": "Encryption key for the database. If the encryption key is invalid, then an error with code 401 will be returned" + }, + { + "name": "use_file_database", + "type": "Bool", + "description": "Pass true to keep information about downloaded and uploaded files between application restarts" + }, + { + "name": "use_chat_info_database", + "type": "Bool", + "description": "Pass true to keep cache of users, basic groups, supergroups, channels and secret chats between restarts. Implies use_file_database" + }, + { + "name": "use_message_database", + "type": "Bool", + "description": "Pass true to keep cache of chats and messages between restarts. Implies use_chat_info_database" + }, + { + "name": "use_secret_chats", + "type": "Bool", + "description": "Pass true to enable support for secret chats" + }, + { + "name": "api_id", + "type": "int32", + "description": "Application identifier for Telegram API access, which can be obtained at https://my.telegram.org" + }, + { + "name": "api_hash", + "type": "string", + "description": "Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org" + }, + { + "name": "system_language_code", + "type": "string", + "description": "IETF language tag of the user's operating system language; must be non-empty" + }, + { + "name": "device_model", + "type": "string", + "description": "Model of the device the application is being run on; must be non-empty" + }, + { + "name": "system_version", + "type": "string", + "description": "Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib" + }, + { + "name": "application_version", + "type": "string", + "description": "Application version; must be non-empty" + }, + { + "name": "enable_storage_optimizer", + "type": "Bool", + "description": "Pass true to automatically delete old files in background" + }, + { + "name": "ignore_file_names", + "type": "Bool", + "description": "Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name" } ], "is_synchronous": false, @@ -17151,7 +23810,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, authorizationStateWaitRegistration, 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 authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword", "class": "Ok", "properties": [ { @@ -17168,14 +23827,42 @@ "is_synchronous": false, "type": 1 }, + { + "name": "setAuthenticationEmailAddress", + "description": "Sets the email address of the user and sends an authentication code to the email address. Works only when the current authorization state is authorizationStateWaitEmailAddress", + "class": "Ok", + "properties": [ + { + "name": "email_address", + "type": "string", + "description": "The email address of the user" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "resendAuthenticationCode", - "description": "Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed", + "description": "Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed, or when the current authorization state is authorizationStateWaitEmailCode", "class": "Ok", "properties": [], "is_synchronous": false, "type": 1 }, + { + "name": "checkAuthenticationEmailCode", + "description": "Checks the authentication of a email address. Works only when the current authorization state is authorizationStateWaitEmailCode", + "class": "Ok", + "properties": [ + { + "name": "code", + "type": "EmailAddressAuthentication", + "description": "Email address authentication to check" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "checkAuthenticationCode", "description": "Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode", @@ -17192,7 +23879,7 @@ }, { "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, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword", + "description": "Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword", "class": "Ok", "properties": [ { @@ -17223,15 +23910,23 @@ "is_synchronous": false, "type": 1 }, + { + "name": "resetAuthenticationEmailAddress", + "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", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 1 + }, { "name": "checkAuthenticationPassword", - "description": "Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword", + "description": "Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword", "class": "Ok", "properties": [ { "name": "password", "type": "string", - "description": "The password to check" + "description": "The 2-step verification password to check" } ], "is_synchronous": false, @@ -17239,7 +23934,7 @@ }, { "name": "requestAuthenticationPasswordRecovery", - "description": "Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword", + "description": "Requests to send a 2-step verification password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword", "class": "Ok", "properties": [], "is_synchronous": false, @@ -17247,7 +23942,7 @@ }, { "name": "checkAuthenticationPasswordRecoveryCode", - "description": "Checks whether a password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword", + "description": "Checks whether a 2-step verification password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword", "class": "Ok", "properties": [ { @@ -17261,7 +23956,7 @@ }, { "name": "recoverAuthenticationPassword", - "description": "Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword", + "description": "Recovers the 2-step verification password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword", "class": "Ok", "properties": [ { @@ -17272,7 +23967,7 @@ { "name": "new_password", "type": "string", - "description": "New password of the user; may be empty to remove the password" + "description": "New 2-step verification password of the user; may be empty to remove the password" }, { "name": "new_hint", @@ -17283,6 +23978,20 @@ "is_synchronous": false, "type": 1 }, + { + "name": "sendAuthenticationFirebaseSms", + "description": "Sends Firebase Authentication SMS to the phone number of the user. Works only when the current authorization state is authorizationStateWaitCode and the server returned code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos", + "class": "Ok", + "properties": [ + { + "name": "token", + "type": "string", + "description": "SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "checkAuthenticationBotToken", "description": "Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in", @@ -17337,7 +24046,7 @@ }, { "name": "getCurrentState", - "description": "Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization", + "description": "Returns all updates needed to restore current TDLib state, i.e. all actual updateAuthorizationState/updateUser/updateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization", "class": "Updates", "properties": [], "is_synchronous": false, @@ -17367,18 +24076,18 @@ }, { "name": "setPassword", - "description": "Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed", + "description": "Changes the 2-step verification password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed", "class": "PasswordState", "properties": [ { "name": "old_password", "type": "string", - "description": "Previous password of the user" + "description": "Previous 2-step verification password of the user" }, { "name": "new_password", "type": "string", - "description": "New password of the user; may be empty to remove the password" + "description": "New 2-step verification password of the user; may be empty to remove the password" }, { "name": "new_hint", @@ -17388,7 +24097,7 @@ { "name": "set_recovery_email_address", "type": "Bool", - "description": "Pass true if the recovery email address must be changed" + "description": "Pass true to change also the recovery email address" }, { "name": "new_recovery_email_address", @@ -17399,6 +24108,42 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setLoginEmailAddress", + "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. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly", + "class": "EmailAddressAuthenticationCodeInfo", + "properties": [ + { + "name": "new_login_email_address", + "type": "string", + "description": "New login email address" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "resendLoginEmailAddressCode", + "description": "Resends the login email address verification code", + "class": "EmailAddressAuthenticationCodeInfo", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "checkLoginEmailAddressCode", + "description": "Checks the login email address authentication", + "class": "Ok", + "properties": [ + { + "name": "code", + "type": "EmailAddressAuthentication", + "description": "Email address authentication to check" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getRecoveryEmailAddress", "description": "Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user", @@ -17407,7 +24152,7 @@ { "name": "password", "type": "string", - "description": "The password for the current user" + "description": "The 2-step verification password for the current user" } ], "is_synchronous": false, @@ -17421,7 +24166,7 @@ { "name": "password", "type": "string", - "description": "Password of the current user" + "description": "The 2-step verification password of the current user" }, { "name": "new_recovery_email_address", @@ -17489,7 +24234,7 @@ { "name": "new_password", "type": "string", - "description": "New password of the user; may be empty to remove the password" + "description": "New 2-step verification password of the user; may be empty to remove the password" }, { "name": "new_hint", @@ -17524,7 +24269,7 @@ { "name": "password", "type": "string", - "description": "Persistent user password" + "description": "The 2-step verification password of the current user" }, { "name": "valid_for", @@ -17651,7 +24396,7 @@ }, { "name": "getChat", - "description": "Returns information about a chat by its identifier, this is an offline request if the current user is not a bot", + "description": "Returns information about a chat by its identifier; this is an offline request if the current user is not a bot", "class": "Chat", "properties": [ { @@ -17684,7 +24429,7 @@ }, { "name": "getMessageLocally", - "description": "Returns information about a message, if it is available locally without sending network request. This is an offline request", + "description": "Returns information about a message, if it is available without sending network request. This is an offline request", "class": "Message", "properties": [ { @@ -17703,7 +24448,7 @@ }, { "name": "getRepliedMessage", - "description": "Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, and the invoice message for messages of the types messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively", + "description": "Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without replied message respectively", "class": "Message", "properties": [ { @@ -17799,7 +24544,7 @@ { "name": "getMessageViewers", "description": "Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true", - "class": "Users", + "class": "MessageViewers", "properties": [ { "name": "chat_id", @@ -17831,7 +24576,7 @@ }, { "name": "getRemoteFile", - "description": "Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application", + "description": "Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application", "class": "File", "properties": [ { @@ -17888,7 +24633,7 @@ }, { "name": "searchPublicChat", - "description": "Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned", + "description": "Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise, an error is returned", "class": "Chat", "properties": [ { @@ -17916,7 +24661,7 @@ }, { "name": "searchChats", - "description": "Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list", + "description": "Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list", "class": "Chats", "properties": [ { @@ -17968,7 +24713,7 @@ }, { "name": "getTopChats", - "description": "Returns a list of frequently used chats. Supported only if the chat info database is enabled", + "description": "Returns a list of frequently used chats", "class": "Chats", "properties": [ { @@ -18004,6 +24749,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "searchRecentlyFoundChats", + "description": "Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request", + "class": "Chats", + "properties": [ + { + "name": "query", + "type": "string", + "description": "Query to search for" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of chats to be returned" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "addRecentlyFoundChat", "description": "Adds a chat to the list of recently found chats. The chat is added to the beginning of the list. If the chat is already in the list, it will be removed from the list first", @@ -18042,7 +24806,7 @@ }, { "name": "getRecentlyOpenedChats", - "description": "Returns recently opened chats, this is an offline request. Returns chats in the order of last opening", + "description": "Returns recently opened chats; this is an offline request. Returns chats in the order of last opening", "class": "Chats", "properties": [ { @@ -18062,7 +24826,7 @@ { "name": "chat_id", "type": "int53", - "description": "Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created" + "description": "Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created" }, { "name": "username", @@ -18089,7 +24853,7 @@ }, { "name": "checkCreatedPublicChatsLimit", - "description": "Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached", + "description": "Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached. The limit can be increased with Telegram Premium", "class": "Ok", "properties": [ { @@ -18111,7 +24875,7 @@ }, { "name": "getInactiveSupergroupChats", - "description": "Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error", + "description": "Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium", "class": "Chats", "properties": [], "is_synchronous": false, @@ -18169,7 +24933,7 @@ { "name": "only_local", "type": "Bool", - "description": "If true, returns only messages that are available locally without sending network requests" + "description": "Pass true to get only messages that are available without sending network requests" } ], "is_synchronous": false, @@ -18222,7 +24986,7 @@ { "name": "remove_from_chat_list", "type": "Bool", - "description": "Pass true if the chat needs to be removed from the chat list" + "description": "Pass true to remove the chat from all chat lists" }, { "name": "revoke", @@ -18235,7 +24999,7 @@ }, { "name": "deleteChat", - "description": "Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method", + "description": "Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the usernames and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat", "class": "Ok", "properties": [ { @@ -18249,8 +25013,8 @@ }, { "name": "searchChatMessages", - "description": "Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit", - "class": "Messages", + "description": "Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation", + "class": "FoundChatMessages", "properties": [ { "name": "chat_id", @@ -18299,7 +25063,7 @@ { "name": "searchMessages", "description": "Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit", - "class": "Messages", + "class": "FoundMessages", "properties": [ { "name": "chat_list", @@ -18312,19 +25076,9 @@ "description": "Query to search for" }, { - "name": "offset_date", - "type": "int32", - "description": "The date of the message starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last message" - }, - { - "name": "offset_chat_id", - "type": "int53", - "description": "The chat identifier of the last found message, or 0 for the first request" - }, - { - "name": "offset_message_id", - "type": "int53", - "description": "The message identifier of the last found message, or 0 for the first request" + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" }, { "name": "limit", @@ -18334,7 +25088,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function" + "description": "Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function" }, { "name": "min_date", @@ -18368,7 +25122,7 @@ { "name": "offset", "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results" + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" }, { "name": "limit", @@ -18386,13 +25140,13 @@ }, { "name": "searchCallMessages", - "description": "Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib", - "class": "Messages", + "description": "Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib", + "class": "FoundMessages", "properties": [ { - "name": "from_message_id", - "type": "int53", - "description": "Identifier of the message from which to search; use 0 to get results from the last message" + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" }, { "name": "limit", @@ -18402,7 +25156,26 @@ { "name": "only_missed", "type": "Bool", - "description": "If true, returns only messages with missed/declined calls" + "description": "Pass true to search only for messages with missed/declined calls" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "searchOutgoingDocumentMessages", + "description": "Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order", + "class": "FoundMessages", + "properties": [ + { + "name": "query", + "type": "string", + "description": "Query to search for in document file name and message caption" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of messages to be returned; up to 100" } ], "is_synchronous": false, @@ -18481,7 +25254,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function" + "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function" }, { "name": "from_message_id", @@ -18510,7 +25283,7 @@ { "name": "filter", "type": "SearchMessagesFilter", - "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function" + "description": "Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function" }, { "name": "from_message_id", @@ -18539,7 +25312,36 @@ { "name": "return_local", "type": "Bool", - "description": "If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown" + "description": "Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatMessagePosition", + "description": "Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats", + "class": "Count", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat in which to find message position" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "filter", + "type": "SearchMessagesFilter", + "description": "Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, only messages in the specified thread will be considered; supergroups only" } ], "is_synchronous": false, @@ -18560,43 +25362,33 @@ "type": 2 }, { - "name": "getMessagePublicForwards", - "description": "Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib", - "class": "FoundMessages", + "name": "getChatSponsoredMessages", + "description": "Returns sponsored messages to be shown in a chat; for channel chats only", + "class": "SponsoredMessages", "properties": [ { "name": "chat_id", "type": "int53", - "description": "Chat identifier of the message" - }, - { - "name": "message_id", - "type": "int53", - "description": "Message identifier" - }, - { - "name": "offset", - "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get first chunk of results" - }, - { - "name": "limit", - "type": "int32", - "description": "The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" + "description": "Identifier of the chat" } ], "is_synchronous": false, "type": 2 }, { - "name": "getChatSponsoredMessage", - "description": "Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat", - "class": "SponsoredMessage", + "name": "clickChatSponsoredMessage", + "description": "Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message", + "class": "Ok", "properties": [ { "name": "chat_id", "type": "int53", - "description": "Identifier of the chat" + "description": "Chat identifier of the sponsored message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the sponsored message" } ], "is_synchronous": false, @@ -18658,7 +25450,7 @@ { "name": "media_timestamp", "type": "int32", - "description": "If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview" + "description": "If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its web page preview" }, { "name": "for_album", @@ -18666,9 +25458,9 @@ "description": "Pass true to create a link for the whole media album" }, { - "name": "for_comment", + "name": "in_message_thread", "type": "Bool", - "description": "Pass true to create a link to the message as a channel post comment, or from a message thread" + "description": "Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic" } ], "is_synchronous": false, @@ -18712,10 +25504,96 @@ "is_synchronous": false, "type": 1 }, + { + "name": "translateText", + "description": "Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved", + "class": "FormattedText", + "properties": [ + { + "name": "text", + "type": "formattedText", + "description": "Text to translate" + }, + { + "name": "to_language_code", + "type": "string", + "description": "Language code of the language to which the message is translated. Must be one of \"af\", \"sq\", \"am\", \"ar\", \"hy\", \"az\", \"eu\", \"be\", \"bn\", \"bs\", \"bg\", \"ca\", \"ceb\", \"zh-CN\", \"zh\", \"zh-Hans\", \"zh-TW\", \"zh-Hant\", \"co\", \"hr\", \"cs\", \"da\", \"nl\", \"en\", \"eo\", \"et\", \"fi\", \"fr\", \"fy\", \"gl\", \"ka\", \"de\", \"el\", \"gu\", \"ht\", \"ha\", \"haw\", \"he\", \"iw\", \"hi\", \"hmn\", \"hu\", \"is\", \"ig\", \"id\", \"in\", \"ga\", \"it\", \"ja\", \"jv\", \"kn\", \"kk\", \"km\", \"rw\", \"ko\", \"ku\", \"ky\", \"lo\", \"la\", \"lv\", \"lt\", \"lb\", \"mk\", \"mg\", \"ms\", \"ml\", \"mt\", \"mi\", \"mr\", \"mn\", \"my\", \"ne\", \"no\", \"ny\", \"or\", \"ps\", \"fa\", \"pl\", \"pt\", \"pa\", \"ro\", \"ru\", \"sm\", \"gd\", \"sr\", \"st\", \"sn\", \"sd\", \"si\", \"sk\", \"sl\", \"so\", \"es\", \"su\", \"sw\", \"sv\", \"tl\", \"tg\", \"ta\", \"tt\", \"te\", \"th\", \"tr\", \"tk\", \"uk\", \"ur\", \"ug\", \"uz\", \"vi\", \"cy\", \"xh\", \"yi\", \"ji\", \"yo\", \"zu\"" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "translateMessageText", + "description": "Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved", + "class": "FormattedText", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "to_language_code", + "type": "string", + "description": "Language code of the language to which the message is translated. Must be one of \"af\", \"sq\", \"am\", \"ar\", \"hy\", \"az\", \"eu\", \"be\", \"bn\", \"bs\", \"bg\", \"ca\", \"ceb\", \"zh-CN\", \"zh\", \"zh-Hans\", \"zh-TW\", \"zh-Hant\", \"co\", \"hr\", \"cs\", \"da\", \"nl\", \"en\", \"eo\", \"et\", \"fi\", \"fr\", \"fy\", \"gl\", \"ka\", \"de\", \"el\", \"gu\", \"ht\", \"ha\", \"haw\", \"he\", \"iw\", \"hi\", \"hmn\", \"hu\", \"is\", \"ig\", \"id\", \"in\", \"ga\", \"it\", \"ja\", \"jv\", \"kn\", \"kk\", \"km\", \"rw\", \"ko\", \"ku\", \"ky\", \"lo\", \"la\", \"lv\", \"lt\", \"lb\", \"mk\", \"mg\", \"ms\", \"ml\", \"mt\", \"mi\", \"mr\", \"mn\", \"my\", \"ne\", \"no\", \"ny\", \"or\", \"ps\", \"fa\", \"pl\", \"pt\", \"pa\", \"ro\", \"ru\", \"sm\", \"gd\", \"sr\", \"st\", \"sn\", \"sd\", \"si\", \"sk\", \"sl\", \"so\", \"es\", \"su\", \"sw\", \"sv\", \"tl\", \"tg\", \"ta\", \"tt\", \"te\", \"th\", \"tr\", \"tk\", \"uk\", \"ur\", \"ug\", \"uz\", \"vi\", \"cy\", \"xh\", \"yi\", \"ji\", \"yo\", \"zu\"" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "recognizeSpeech", + "description": "Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message \"MSG_VOICE_TOO_LONG\" if media duration is too big to be recognized", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "rateSpeechRecognition", + "description": "Rates recognized speech in a video note or a voice note message", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "is_good", + "type": "Bool", + "description": "Pass true if the speech recognition is good" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getChatAvailableMessageSenders", "description": "Returns list of message sender identifiers, which can be used to send messages in a chat", - "class": "MessageSenders", + "class": "ChatMessageSenders", "properties": [ { "name": "chat_id", @@ -18761,9 +25639,9 @@ "description": "If not 0, a message thread identifier in which the message will be sent" }, { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of the message to reply to or 0" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message or story to be replied; pass null if none" }, { "name": "options", @@ -18800,9 +25678,9 @@ "description": "If not 0, a message thread identifier in which the messages will be sent" }, { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of a message to reply to or 0" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message or story to be replied; pass null if none" }, { "name": "options", @@ -18858,9 +25736,9 @@ "description": "If not 0, a message thread identifier in which the message will be sent" }, { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of a message to reply to or 0" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message or story to be replied; pass null if none" }, { "name": "options", @@ -18875,12 +25753,12 @@ { "name": "result_id", "type": "string", - "description": "Identifier of the inline result" + "description": "Identifier of the inline query result" }, { "name": "hide_via_bot", "type": "Bool", - "description": "If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption(\"animation_search_bot_username\"), GetOption(\"photo_search_bot_username\") and GetOption(\"venue_search_bot_username\")" + "description": "Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption(\"animation_search_bot_username\"), getOption(\"photo_search_bot_username\"), and getOption(\"venue_search_bot_username\")" } ], "is_synchronous": false, @@ -18896,6 +25774,11 @@ "type": "int53", "description": "Identifier of the chat to which to forward messages" }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, a message thread identifier in which the message will be sent; for forum threads only" + }, { "name": "from_chat_id", "type": "int53", @@ -18904,7 +25787,7 @@ { "name": "message_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously" + "description": "Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if message.can_be_forwarded" }, { "name": "options", @@ -18914,17 +25797,12 @@ { "name": "send_copy", "type": "Bool", - "description": "If true, content of the messages will be copied without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local" + "description": "Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local" }, { "name": "remove_caption", "type": "Bool", - "description": "If true, media caption of message copies will be removed. Ignored if send_copy is false" - }, - { - "name": "only_preview", - "type": "Bool", - "description": "If true, messages will not be forwarded and instead fake messages will be returned" + "description": "Pass true to remove media captions of message copies. Ignored if send_copy is false" } ], "is_synchronous": false, @@ -18944,25 +25822,16 @@ "name": "message_ids", "type": "vector\u003cint53\u003e", "description": "Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order" + }, + { + "name": "quote", + "type": "formattedText", + "description": "New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false" } ], "is_synchronous": false, "type": 1 }, - { - "name": "sendChatScreenshotTakenNotification", - "description": "Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats", - "class": "Ok", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "addLocalMessage", "description": "Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message", @@ -18979,9 +25848,9 @@ "description": "Identifier of the sender of the message" }, { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of the message to reply to or 0" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message or story to be replied; pass null if none" }, { "name": "disable_notification", @@ -19189,7 +26058,7 @@ { "name": "caption", "type": "formattedText", - "description": "New message content caption; 0-GetOption(\"message_caption_length_max\") characters; pass null to remove caption" + "description": "New message content caption; 0-getOption(\"message_caption_length_max\") characters; pass null to remove caption" } ], "is_synchronous": false, @@ -19319,7 +26188,7 @@ { "name": "caption", "type": "formattedText", - "description": "New message content caption; pass null to remove caption; 0-GetOption(\"message_caption_length_max\") characters" + "description": "New message content caption; pass null to remove caption; 0-getOption(\"message_caption_length_max\") characters" } ], "is_synchronous": false, @@ -19368,15 +26237,471 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getForumTopicDefaultIcons", + "description": "Returns list of custom emojis, which can be used as forum topic icon by all users", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 1 + }, + { + "name": "createForumTopic", + "description": "Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup", + "class": "ForumTopicInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "name", + "type": "string", + "description": "Name of the topic; 1-128 characters" + }, + { + "name": "icon", + "type": "forumTopicIcon", + "description": "Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "editForumTopic", + "description": "Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + }, + { + "name": "name", + "type": "string", + "description": "New name of the topic; 0-128 characters. If empty, the previous topic name is kept" + }, + { + "name": "edit_icon_custom_emoji", + "type": "Bool", + "description": "Pass true to edit the icon of the topic. Icon of the General topic can't be edited" + }, + { + "name": "icon_custom_emoji_id", + "type": "int64", + "description": "Identifier of the new custom emoji for topic icon; pass 0 to remove the custom emoji. Ignored if edit_icon_custom_emoji is false. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getForumTopic", + "description": "Returns information about a forum topic", + "class": "ForumTopic", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getForumTopicLink", + "description": "Returns an HTTPS link to a topic in a forum chat. This is an offline request", + "class": "MessageLink", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getForumTopics", + "description": "Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server", + "class": "ForumTopics", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the forum chat" + }, + { + "name": "query", + "type": "string", + "description": "Query to search for in the forum topic's name" + }, + { + "name": "offset_date", + "type": "int32", + "description": "The date starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last topic" + }, + { + "name": "offset_message_id", + "type": "int53", + "description": "The message identifier of the last message in the last found topic, or 0 for the first request" + }, + { + "name": "offset_message_thread_id", + "type": "int53", + "description": "The message thread identifier of the last found topic, or 0 for the first request" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of forum topics to be returned; up to 100. For optimal performance, the number of returned forum topics is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setForumTopicNotificationSettings", + "description": "Changes the notification settings of a forum topic", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + }, + { + "name": "notification_settings", + "type": "chatNotificationSettings", + "description": "New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleForumTopicIsClosed", + "description": "Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + }, + { + "name": "is_closed", + "type": "Bool", + "description": "Pass true to close the topic; pass false to reopen it" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleGeneralForumTopicIsHidden", + "description": "Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "is_hidden", + "type": "Bool", + "description": "Pass true to hide and close the General topic; pass false to unhide it" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleForumTopicIsPinned", + "description": "Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can be up to getOption(\"pinned_forum_topic_count_max\") pinned forum topics", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "Pass true to pin the topic; pass false to unpin it" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setPinnedForumTopics", + "description": "Changes the order of pinned forum topics", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_thread_ids", + "type": "vector\u003cint53\u003e", + "description": "The new list of pinned forum topics" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteForumTopic", + "description": "Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier of the forum topic" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getEmojiReaction", + "description": "Returns information about a emoji reaction. Returns a 404 error if the reaction is not found", + "class": "EmojiReaction", + "properties": [ + { + "name": "emoji", + "type": "string", + "description": "Text representation of the reaction" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getCustomEmojiReactionAnimations", + "description": "Returns TGS stickers with generic animations for custom emoji reactions", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getMessageAvailableReactions", + "description": "Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message", + "class": "AvailableReactions", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "row_size", + "type": "int32", + "description": "Number of reaction per row, 5-25" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "clearRecentReactions", + "description": "Clears the list of recently used reactions", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "addMessageReaction", + "description": "Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reaction to add" + }, + { + "name": "is_big", + "type": "Bool", + "description": "Pass true if the reaction is added with a big animation" + }, + { + "name": "update_recent_reactions", + "type": "Bool", + "description": "Pass true if the reaction needs to be added to recent reactions" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "removeMessageReaction", + "description": "Removes a reaction from a message. A chosen reaction can always be removed", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reaction to remove" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getMessageAddedReactions", + "description": "Returns reactions added for a message, along with their sender", + "class": "AddedReactions", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reactions to return; pass null to return all added reactions" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of reactions to be returned; must be positive and can't be greater than 100" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setDefaultReactionType", + "description": "Changes type of default reaction for the current user", + "class": "Ok", + "properties": [ + { + "name": "reaction_type", + "type": "ReactionType", + "description": "New type of the default reaction" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "searchQuote", + "description": "Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously", + "class": "FoundPosition", + "properties": [ + { + "name": "text", + "type": "formattedText", + "description": "Text in which to search for the quote" + }, + { + "name": "quote", + "type": "formattedText", + "description": "Quote to search for" + }, + { + "name": "quote_position", + "type": "int32", + "description": "Approximate quote position in UTF-16 code units" + } + ], + "is_synchronous": true, + "type": 1 + }, { "name": "getTextEntities", - "description": "Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously", + "description": "Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously", "class": "TextEntities", "properties": [ { "name": "text", "type": "string", - "description": "The text in which to look for entites" + "description": "The text in which to look for entities" } ], "is_synchronous": true, @@ -19384,7 +26709,7 @@ }, { "name": "parseTextEntities", - "description": "Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously", + "description": "Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously", "class": "FormattedText", "properties": [ { @@ -19409,7 +26734,7 @@ { "name": "text", "type": "formattedText", - "description": "The text to parse. For example, \"__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**\"" + "description": "The text to parse. For example, \"__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**\"" } ], "is_synchronous": true, @@ -19528,6 +26853,20 @@ "is_synchronous": true, "type": 1 }, + { + "name": "getThemeParametersJsonString", + "description": "Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously", + "class": "Text", + "properties": [ + { + "name": "theme", + "type": "themeParameters", + "description": "Theme parameters to convert to JSON" + } + ], + "is_synchronous": true, + "type": 1 + }, { "name": "setPollAnswer", "description": "Changes the user answer to a poll. A poll in quiz mode can be answered only once", @@ -19554,8 +26893,8 @@ }, { "name": "getPollVoters", - "description": "Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib", - "class": "Users", + "description": "Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib", + "class": "MessageSenders", "properties": [ { "name": "chat_id", @@ -19575,12 +26914,12 @@ { "name": "offset", "type": "int32", - "description": "Number of users to skip in the result; must be non-negative" + "description": "Number of voters 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. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached" + "description": "The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached" } ], "is_synchronous": false, @@ -19588,7 +26927,7 @@ }, { "name": "stopPoll", - "description": "Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set", + "description": "Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set", "class": "Ok", "properties": [ { @@ -19671,7 +27010,75 @@ { "name": "allow_write_access", "type": "Bool", - "description": "True, if the user allowed the bot to send them messages" + "description": "Pass true to allow the bot to send messages to the current user" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "shareUserWithBot", + "description": "Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat with the bot" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message with the button" + }, + { + "name": "button_id", + "type": "int32", + "description": "Identifier of the button" + }, + { + "name": "shared_user_id", + "type": "int53", + "description": "Identifier of the shared user" + }, + { + "name": "only_check", + "type": "Bool", + "description": "Pass true to check that the user can be shared by the button instead of actually sharing them" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "shareChatWithBot", + "description": "Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat with the bot" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message with the button" + }, + { + "name": "button_id", + "type": "int32", + "description": "Identifier of the button" + }, + { + "name": "shared_chat_id", + "type": "int53", + "description": "Identifier of the shared chat" + }, + { + "name": "only_check", + "type": "Bool", + "description": "Pass true to check that the chat can be shared by the button instead of actually sharing it. Doesn't check bot_is_member and bot_administrator_rights restrictions. If the bot must be a member, then all chats from getGroupsInCommon and all chats, where the user can add the bot, are suitable. In the latter case the bot will be automatically added to the chat. If the bot must be an administrator, then all chats, where the bot already has requested rights or can be added to administrators by the user, are suitable. In the latter case the bot will be automatically granted requested rights" } ], "is_synchronous": false, @@ -19685,7 +27092,7 @@ { "name": "bot_user_id", "type": "int53", - "description": "The identifier of the target bot" + "description": "Identifier of the target bot" }, { "name": "chat_id", @@ -19705,7 +27112,7 @@ { "name": "offset", "type": "string", - "description": "Offset of the first entry to return" + "description": "Offset of the first entry to return; use empty string to get the first chunk of results" } ], "is_synchronous": false, @@ -19724,7 +27131,12 @@ { "name": "is_personal", "type": "Bool", - "description": "True, if the result of the query can be cached for the specified user" + "description": "Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query" + }, + { + "name": "button", + "type": "inlineQueryResultsButton", + "description": "Button to be shown above inline query results; pass null if none" }, { "name": "results", @@ -19740,16 +27152,199 @@ "name": "next_offset", "type": "string", "description": "Offset for the next inline query; pass an empty string if there are no more results" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "searchWebApp", + "description": "Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found", + "class": "FoundWebApp", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" }, { - "name": "switch_pm_text", + "name": "web_app_short_name", "type": "string", - "description": "If non-empty, this text must be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter" + "description": "Short name of the Web App" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getWebAppLinkUrl", + "description": "Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked", + "class": "HttpUrl", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat in which the link was clicked; pass 0 if none" }, { - "name": "switch_pm_parameter", + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "web_app_short_name", "type": "string", - "description": "The parameter for the bot start message" + "description": "Short name of the Web App" + }, + { + "name": "start_parameter", + "type": "string", + "description": "Start parameter from internalLinkTypeWebApp" + }, + { + "name": "theme", + "type": "themeParameters", + "description": "Preferred Web App theme; pass null to use the default theme" + }, + { + "name": "application_name", + "type": "string", + "description": "Short name of the application; 0-64 English letters, digits, and underscores" + }, + { + "name": "allow_write_access", + "type": "Bool", + "description": "Pass true if the current user allowed the bot to send them messages" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getWebAppUrl", + "description": "Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link", + "class": "HttpUrl", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "url", + "type": "string", + "description": "The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, an internalLinkTypeSideMenuBot link, or an empty when the bot is opened from the side menu" + }, + { + "name": "theme", + "type": "themeParameters", + "description": "Preferred Web App theme; pass null to use the default theme" + }, + { + "name": "application_name", + "type": "string", + "description": "Short name of the application; 0-64 English letters, digits, and underscores" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "sendWebAppData", + "description": "Sends data received from a keyboardButtonTypeWebApp Web App to a bot", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "button_text", + "type": "string", + "description": "Text of the keyboardButtonTypeWebApp button, which opened the Web App" + }, + { + "name": "data", + "type": "string", + "description": "The data" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "openWebApp", + "description": "Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once", + "class": "WebAppInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats" + }, + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the bot, providing the Web App" + }, + { + "name": "url", + "type": "string", + "description": "The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise" + }, + { + "name": "theme", + "type": "themeParameters", + "description": "Preferred Web App theme; pass null to use the default theme" + }, + { + "name": "application_name", + "type": "string", + "description": "Short name of the application; 0-64 English letters, digits, and underscores" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "If not 0, a message thread identifier in which the message will be sent" + }, + { + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message or story to be replied in the message sent by the Web App; pass null if none" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "closeWebApp", + "description": "Informs TDLib that a previously opened Web App was closed", + "class": "Ok", + "properties": [ + { + "name": "web_app_launch_id", + "type": "int64", + "description": "Identifier of Web App launch, received from openWebApp" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "answerWebAppQuery", + "description": "Sets the result of interaction with a Web App and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only", + "class": "SentWebAppMessage", + "properties": [ + { + "name": "web_app_query_id", + "type": "string", + "description": "Identifier of the Web App query" + }, + { + "name": "result", + "type": "InputInlineQueryResult", + "description": "The result of the query" } ], "is_synchronous": false, @@ -19797,7 +27392,7 @@ { "name": "show_alert", "type": "Bool", - "description": "If true, an alert must be shown to the user instead of a toast notification" + "description": "Pass true to show an alert to the user instead of a toast notification" }, { "name": "url", @@ -19874,7 +27469,7 @@ { "name": "edit_message", "type": "Bool", - "description": "True, if the message needs to be edited" + "description": "Pass true to edit the game message to include the current scoreboard" }, { "name": "user_id", @@ -19908,7 +27503,7 @@ { "name": "edit_message", "type": "Bool", - "description": "True, if the message needs to be edited" + "description": "Pass true to edit the game message to include the current scoreboard" }, { "name": "user_id", @@ -19974,7 +27569,7 @@ }, { "name": "deleteChatReplyMarkup", - "description": "Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup is changed", + "description": "Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed", "class": "Ok", "properties": [ { @@ -20053,20 +27648,20 @@ "type": "int53", "description": "Chat identifier" }, - { - "name": "message_thread_id", - "type": "int53", - "description": "If not 0, a message thread identifier in which the messages are being viewed" - }, { "name": "message_ids", "type": "vector\u003cint53\u003e", "description": "The identifiers of the messages being viewed" }, + { + "name": "source", + "type": "MessageSource", + "description": "Source of the message view; pass null to guess the source based on chat open state" + }, { "name": "force_read", "type": "Bool", - "description": "True, if messages in closed chats must be marked as read by the request" + "description": "Pass true to mark as read the specified messages even the chat is closed" } ], "is_synchronous": false, @@ -20110,6 +27705,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getInternalLink", + "description": "Returns an HTTPS or a tg: link with the given type. Can be called before authorization", + "class": "HttpUrl", + "properties": [ + { + "name": "type", + "type": "InternalLinkType", + "description": "Expected type of the link" + }, + { + "name": "is_http", + "type": "Bool", + "description": "Pass true to create an HTTPS link (only available for some link types); pass false to create a tg: link" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "getInternalLinkType", "description": "Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization", @@ -20151,7 +27765,7 @@ { "name": "allow_write_access", "type": "Bool", - "description": "True, if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages" + "description": "Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages" } ], "is_synchronous": false, @@ -20171,6 +27785,58 @@ "is_synchronous": false, "type": 2 }, + { + "name": "readAllMessageThreadMentions", + "description": "Marks all mentions in a forum topic as read", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier in which mentions are marked as read" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "readAllChatReactions", + "description": "Marks all reactions in a chat or a forum topic as read", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "readAllMessageThreadReactions", + "description": "Marks all reactions in a forum topic as read", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier in which reactions are marked as read" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "createPrivateChat", "description": "Returns an existing chat corresponding to a given user", @@ -20184,7 +27850,7 @@ { "name": "force", "type": "Bool", - "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -20203,7 +27869,7 @@ { "name": "force", "type": "Bool", - "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -20222,7 +27888,7 @@ { "name": "force", "type": "Bool", - "description": "If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect" + "description": "Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect" } ], "is_synchronous": false, @@ -20250,12 +27916,17 @@ { "name": "user_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of users to be added to the basic group" + "description": "Identifiers of users to be added to the basic group; may be empty to create a basic group without other members" }, { "name": "title", "type": "string", "description": "Title of the new basic group; 1-128 characters" + }, + { + "name": "message_auto_delete_time", + "type": "int32", + "description": "Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically" } ], "is_synchronous": false, @@ -20271,10 +27942,15 @@ "type": "string", "description": "Title of the new chat; 1-128 characters" }, + { + "name": "is_forum", + "type": "Bool", + "description": "Pass true to create a forum supergroup chat" + }, { "name": "is_channel", "type": "Bool", - "description": "True, if a channel chat needs to be created" + "description": "Pass true to create a channel chat; ignored if a forum is created" }, { "name": "description", @@ -20286,10 +27962,15 @@ "type": "chatLocation", "description": "Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat" }, + { + "name": "message_auto_delete_time", + "type": "int32", + "description": "Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically" + }, { "name": "for_import", "type": "Bool", - "description": "True, if the supergroup is created for importing messages using importMessage" + "description": "Pass true to create a supergroup for importing messages using importMessages" } ], "is_synchronous": false, @@ -20357,102 +28038,328 @@ "type": 2 }, { - "name": "getChatFilter", - "description": "Returns information about a chat filter by its identifier", - "class": "ChatFilter", + "name": "getChatFolder", + "description": "Returns information about a chat folder by its identifier", + "class": "ChatFolder", "properties": [ { - "name": "chat_filter_id", + "name": "chat_folder_id", "type": "int32", - "description": "Chat filter identifier" + "description": "Chat folder identifier" } ], "is_synchronous": false, "type": 2 }, { - "name": "createChatFilter", - "description": "Creates new chat filter. Returns information about the created chat filter", - "class": "ChatFilterInfo", + "name": "createChatFolder", + "description": "Creates new chat folder. Returns information about the created chat folder. There can be up to getOption(\"chat_folder_count_max\") chat folders, but the limit can be increased with Telegram Premium", + "class": "ChatFolderInfo", "properties": [ { - "name": "filter", - "type": "chatFilter", - "description": "Chat filter" + "name": "folder", + "type": "chatFolder", + "description": "The new chat folder" } ], "is_synchronous": false, "type": 2 }, { - "name": "editChatFilter", - "description": "Edits existing chat filter. Returns information about the edited chat filter", - "class": "ChatFilterInfo", + "name": "editChatFolder", + "description": "Edits existing chat folder. Returns information about the edited chat folder", + "class": "ChatFolderInfo", "properties": [ { - "name": "chat_filter_id", + "name": "chat_folder_id", "type": "int32", - "description": "Chat filter identifier" + "description": "Chat folder identifier" }, { - "name": "filter", - "type": "chatFilter", - "description": "The edited chat filter" + "name": "folder", + "type": "chatFolder", + "description": "The edited chat folder" } ], "is_synchronous": false, "type": 2 }, { - "name": "deleteChatFilter", - "description": "Deletes existing chat filter", + "name": "deleteChatFolder", + "description": "Deletes existing chat folder", "class": "Ok", "properties": [ { - "name": "chat_filter_id", + "name": "chat_folder_id", "type": "int32", - "description": "Chat filter identifier" + "description": "Chat folder identifier" + }, + { + "name": "leave_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the chats to leave. The chats must be pinned or always included in the folder" } ], "is_synchronous": false, "type": 2 }, { - "name": "reorderChatFilters", - "description": "Changes the order of chat filters", + "name": "getChatFolderChatsToLeave", + "description": "Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted", + "class": "Chats", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatFolderChatCount", + "description": "Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly", + "class": "Count", + "properties": [ + { + "name": "folder", + "type": "chatFolder", + "description": "The new chat folder" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reorderChatFolders", + "description": "Changes the order of chat folders", "class": "Ok", "properties": [ { - "name": "chat_filter_ids", + "name": "chat_folder_ids", "type": "vector\u003cint32\u003e", - "description": "Identifiers of chat filters in the new correct order" + "description": "Identifiers of chat folders in the new correct order" + }, + { + "name": "main_chat_list_position", + "type": "int32", + "description": "Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users" } ], "is_synchronous": false, "type": 2 }, { - "name": "getRecommendedChatFilters", - "description": "Returns recommended chat filters for the current user", - "class": "RecommendedChatFilters", + "name": "getRecommendedChatFolders", + "description": "Returns recommended chat folders for the current user", + "class": "RecommendedChatFolders", "properties": [], "is_synchronous": false, "type": 2 }, { - "name": "getChatFilterDefaultIconName", - "description": "Returns default icon name for a filter. Can be called synchronously", - "class": "Text", + "name": "getChatFolderDefaultIconName", + "description": "Returns default icon name for a folder. Can be called synchronously", + "class": "ChatFolderIcon", "properties": [ { - "name": "filter", - "type": "chatFilter", - "description": "Chat filter" + "name": "folder", + "type": "chatFolder", + "description": "Chat folder" } ], "is_synchronous": true, "type": 1 }, + { + "name": "getChatsForChatFolderInviteLink", + "description": "Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link", + "class": "Chats", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "createChatFolderInviteLink", + "description": "Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats", + "class": "ChatFolderInviteLink", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + }, + { + "name": "name", + "type": "string", + "description": "Name of the link; 0-32 characters" + }, + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link creation" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatFolderInviteLinks", + "description": "Returns invite links created by the current user for a shareable chat folder", + "class": "ChatFolderInviteLinks", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "editChatFolderInviteLink", + "description": "Edits an invite link for a chat folder", + "class": "ChatFolderInviteLink", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link to be edited" + }, + { + "name": "name", + "type": "string", + "description": "New name of the link; 0-32 characters" + }, + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "New identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link editing" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteChatFolderInviteLink", + "description": "Deletes an invite link for a chat folder", + "class": "Ok", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link to be deleted" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "checkChatFolderInviteLink", + "description": "Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder", + "class": "ChatFolderInviteLinkInfo", + "properties": [ + { + "name": "invite_link", + "type": "string", + "description": "Invite link to be checked" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "addChatFolderByInviteLink", + "description": "Adds a chat folder by an invite link", + "class": "Ok", + "properties": [ + { + "name": "invite_link", + "type": "string", + "description": "Invite link for the chat folder" + }, + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatFolderNewChats", + "description": "Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption(\"chat_folder_new_chats_update_period\") for the given chat folder", + "class": "Chats", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "processChatFolderNewChats", + "description": "Process new chats added to a shareable chat folder by its owner", + "class": "Ok", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + }, + { + "name": "added_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren't joined yet" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getArchiveChatListSettings", + "description": "Returns settings for automatic moving of chats to and from the Archive chat lists", + "class": "ArchiveChatListSettings", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setArchiveChatListSettings", + "description": "Changes settings for automatic moving of chats to and from the Archive chat lists", + "class": "Ok", + "properties": [ + { + "name": "settings", + "type": "archiveChatListSettings", + "description": "New settings" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setChatTitle", "description": "Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right", @@ -20492,8 +28399,8 @@ "type": 1 }, { - "name": "setChatMessageTtl", - "description": "Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram)", + "name": "setChatAccentColor", + "description": "Changes accent color and background custom emoji of a chat. Supported only for channels with getOption(\"channel_custom_accent_color_boost_level_min\") boost level. Requires can_change_info administrator right", "class": "Ok", "properties": [ { @@ -20502,13 +28409,37 @@ "description": "Chat identifier" }, { - "name": "ttl", + "name": "accent_color_id", "type": "int32", - "description": "New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret" + "description": "Identifier of the accent color to use" + }, + { + "name": "background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the reply header background; 0 if none" } ], "is_synchronous": false, - "type": 1 + "type": 2 + }, + { + "name": "setChatMessageAutoDeleteTime", + "description": "Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_auto_delete_time", + "type": "int32", + "description": "New time value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically" + } + ], + "is_synchronous": false, + "type": 2 }, { "name": "setChatPermissions", @@ -20529,6 +28460,35 @@ "is_synchronous": false, "type": 1 }, + { + "name": "setChatBackground", + "description": "Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "background", + "type": "InputBackground", + "description": "The input background to use; pass null to create a new filled background or to remove the current background" + }, + { + "name": "type", + "type": "BackgroundType", + "description": "Background type; pass null to remove the current background" + }, + { + "name": "dark_theme_dimming", + "type": "int32", + "description": "Dimming of the background in dark themes, as a percentage; 0-100" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setChatTheme", "description": "Changes the chat theme. Supported only in private and secret chats", @@ -20585,7 +28545,7 @@ { "name": "notification_settings", "type": "chatNotificationSettings", - "description": "New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever" + "description": "New notification settings for the chat. If the chat is muted for more than 366 days, it is considered to be muted forever" } ], "is_synchronous": false, @@ -20604,7 +28564,26 @@ { "name": "has_protected_content", "type": "Bool", - "description": "True, if chat content can't be saved locally, forwarded, or copied" + "description": "New value of has_protected_content" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleChatIsTranslatable", + "description": "Changes the translatable state of a chat; for Telegram Premium users only", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "is_translatable", + "type": "Bool", + "description": "New value of is_translatable" } ], "is_synchronous": false, @@ -20648,6 +28627,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setChatAvailableReactions", + "description": "Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "available_reactions", + "type": "ChatAvailableReactions", + "description": "Reactions available in the chat. All emoji reactions must be active" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "setChatClientData", "description": "Changes application-specific data associated with a chat", @@ -20761,12 +28759,12 @@ { "name": "disable_notification", "type": "Bool", - "description": "True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats" + "description": "Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats" }, { "name": "only_for_self", "type": "Bool", - "description": "True, if the message needs to be pinned for one side only; private chats only" + "description": "Pass true to pin the message only for self; private chats only" } ], "is_synchronous": false, @@ -20805,9 +28803,28 @@ "is_synchronous": false, "type": 1 }, + { + "name": "unpinAllMessageThreadMessages", + "description": "Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "message_thread_id", + "type": "int53", + "description": "Message thread identifier in which messages will be unpinned" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "joinChat", - "description": "Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method", + "description": "Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return an error with a message \"INVITE_REQUEST_SENT\" if only a join request was created", "class": "Ok", "properties": [ { @@ -20955,7 +28972,7 @@ { "name": "password", "type": "string", - "description": "The password of the current user" + "description": "The 2-step verification password of the current user" } ], "is_synchronous": false, @@ -20982,7 +28999,7 @@ }, { "name": "searchChatMembers", - "description": "Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels", + "description": "Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels", "class": "ChatMembers", "properties": [ { @@ -21025,13 +29042,63 @@ }, { "name": "clearAllDraftMessages", - "description": "Clears draft messages in all chats", + "description": "Clears message drafts in all chats", "class": "Ok", "properties": [ { "name": "exclude_secret_chats", "type": "Bool", - "description": "If true, local draft messages in secret chats will not be cleared" + "description": "Pass true to keep local message drafts in secret chats" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getSavedNotificationSound", + "description": "Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier", + "class": "NotificationSounds", + "properties": [ + { + "name": "notification_sound_id", + "type": "int64", + "description": "Identifier of the notification sound" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getSavedNotificationSounds", + "description": "Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used", + "class": "NotificationSounds", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "addSavedNotificationSound", + "description": "Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, its position isn't changed", + "class": "NotificationSound", + "properties": [ + { + "name": "sound", + "type": "InputFile", + "description": "Notification sound file to add" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "removeSavedNotificationSound", + "description": "Removes a notification sound from the list of saved notification sounds", + "class": "Ok", + "properties": [ + { + "name": "notification_sound_id", + "type": "int64", + "description": "Identifier of the notification sound" } ], "is_synchronous": false, @@ -21039,7 +29106,7 @@ }, { "name": "getChatNotificationSettingsExceptions", - "description": "Returns list of chats with non-default notification settings", + "description": "Returns list of chats with non-default notification settings for new messages", "class": "Chats", "properties": [ { @@ -21050,7 +29117,7 @@ { "name": "compare_sound", "type": "Bool", - "description": "If true, also chats with non-default sound will be returned" + "description": "Pass true to include in the response chats with only non-default sound" } ], "is_synchronous": false, @@ -21091,7 +29158,7 @@ }, { "name": "resetAllNotificationSettings", - "description": "Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to \"default\" and message previews are shown", + "description": "Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown", "class": "Ok", "properties": [], "is_synchronous": false, @@ -21099,7 +29166,7 @@ }, { "name": "toggleChatIsPinned", - "description": "Changes the pinned state of a chat. There can be up to GetOption(\"pinned_chat_count_max\")/GetOption(\"pinned_archived_chat_count_max\") pinned non-secret chats and the same number of secret chats in the main/arhive chat list", + "description": "Changes the pinned state of a chat. There can be up to getOption(\"pinned_chat_count_max\")/getOption(\"pinned_archived_chat_count_max\") pinned non-secret chats and the same number of secret chats in the main/archive chat list. The limit can be increased with Telegram Premium", "class": "Ok", "properties": [ { @@ -21115,7 +29182,7 @@ { "name": "is_pinned", "type": "Bool", - "description": "True, if the chat is pinned" + "description": "Pass true to pin the chat; pass false to unpin it" } ], "is_synchronous": false, @@ -21140,6 +29207,663 @@ "is_synchronous": false, "type": 2 }, + { + "name": "readChatList", + "description": "Traverse all chats in a chat list and marks all messages in the chats as read", + "class": "Ok", + "properties": [ + { + "name": "chat_list", + "type": "ChatList", + "description": "Chat list in which to mark all chats as read" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStory", + "description": "Returns a story", + "class": "Story", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + }, + { + "name": "only_local", + "type": "Bool", + "description": "Pass true to get only locally available information without sending network requests" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatsToSendStories", + "description": "Returns channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there", + "class": "Chats", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "canSendStory", + "description": "Checks whether the current user can send a story on behalf of a chat; requires can_post_stories rights for channel chats", + "class": "CanSendStoryResult", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "sendStory", + "description": "Sends a new story to a chat; requires can_post_stories rights for channel chats. Returns a temporary story", + "class": "Story", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat that will post the story" + }, + { + "name": "content", + "type": "InputStoryContent", + "description": "Content of the story" + }, + { + "name": "areas", + "type": "inputStoryAreas", + "description": "Clickable rectangle areas to be shown on the story media; pass null if none" + }, + { + "name": "caption", + "type": "formattedText", + "description": "Story caption; pass null to use an empty caption; 0-getOption(\"story_caption_length_max\") characters" + }, + { + "name": "privacy_settings", + "type": "StoryPrivacySettings", + "description": "The privacy settings for the story" + }, + { + "name": "active_period", + "type": "int32", + "description": "Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "Pass true to keep the story accessible after expiration" + }, + { + "name": "protect_content", + "type": "Bool", + "description": "Pass true if the content of the story must be protected from forwarding and screenshotting" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "editStory", + "description": "Changes content and caption of a story. Can be called only if story.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Identifier of the story to edit" + }, + { + "name": "content", + "type": "InputStoryContent", + "description": "New content of the story; pass null to keep the current content" + }, + { + "name": "areas", + "type": "inputStoryAreas", + "description": "New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can't be edited if story content isn't changed" + }, + { + "name": "caption", + "type": "formattedText", + "description": "New story caption; pass null to keep the current caption" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setStoryPrivacySettings", + "description": "Changes privacy settings of a story. Can be called only if story.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Identifier of the story" + }, + { + "name": "privacy_settings", + "type": "StoryPrivacySettings", + "description": "The new privacy settigs for the story" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleStoryIsPinned", + "description": "Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Identifier of the story" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "Pass true to make the story accessible after expiration; pass false to make it private" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteStory", + "description": "Deletes a previously sent story. Can be called only if story.can_be_deleted == true", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Identifier of the story to delete" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStoryNotificationSettingsExceptions", + "description": "Returns list of chats with non-default notification settings for stories", + "class": "Chats", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "loadActiveStories", + "description": "Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded", + "class": "Ok", + "properties": [ + { + "name": "story_list", + "type": "StoryList", + "description": "The story list in which to load active stories" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setChatActiveStoriesList", + "description": "Changes story list in which stories from the chat are shown", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat that posted stories" + }, + { + "name": "story_list", + "type": "StoryList", + "description": "New list for active stories posted by the chat" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatActiveStories", + "description": "Returns the list of active stories posted by the given chat", + "class": "ChatActiveStories", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatPinnedStories", + "description": "Returns the list of pinned stories posted by the given chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib", + "class": "Stories", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "from_story_id", + "type": "int32", + "description": "Identifier of the story starting from which stories must be returned; use 0 to get results from the last story" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatArchivedStories", + "description": "Returns the list of all stories posted by the given chat; requires can_edit_stories rights for channel chats. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib", + "class": "Stories", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "from_story_id", + "type": "int32", + "description": "Identifier of the story starting from which stories must be returned; use 0 to get results from the last story" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "openStory", + "description": "Informs TDLib that a story is opened and is being viewed by the user", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the opened story" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "closeStory", + "description": "Informs TDLib that a story is closed by the user", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story to close" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStoryAvailableReactions", + "description": "Returns reactions, which can be chosen for a story", + "class": "AvailableReactions", + "properties": [ + { + "name": "row_size", + "type": "int32", + "description": "Number of reaction per row, 5-25" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setStoryReaction", + "description": "Changes chosen reaction on a story", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + }, + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reaction to set; pass null to remove the reaction. `reactionTypeCustomEmoji` reactions can be used only by Telegram Premium users" + }, + { + "name": "update_recent_reactions", + "type": "Bool", + "description": "Pass true if the reaction needs to be added to recent reactions" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStoryViewers", + "description": "Returns viewers of a story. The method can be called only for stories posted on behalf of the current user", + "class": "StoryViewers", + "properties": [ + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + }, + { + "name": "query", + "type": "string", + "description": "Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers" + }, + { + "name": "only_contacts", + "type": "Bool", + "description": "Pass true to get only contacts; pass false to get all relevant viewers" + }, + { + "name": "prefer_with_reaction", + "type": "Bool", + "description": "Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of story viewers to return" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reportStory", + "description": "Reports a story to the Telegram moderators", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story to report" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story to report" + }, + { + "name": "reason", + "type": "ReportReason", + "description": "The reason for reporting the story" + }, + { + "name": "text", + "type": "string", + "description": "Additional report details; 0-1024 characters" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "activateStoryStealthMode", + "description": "Activates stealth mode for stories, which hides all views of stories from the current user in the last \"story_stealth_mode_past_period\" seconds and for the next \"story_stealth_mode_future_period\" seconds; for Telegram Premium users only", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getAvailableChatBoostSlots", + "description": "Returns the list of available chat boost slots for the current user", + "class": "ChatBoostSlots", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatBoostStatus", + "description": "Returns the current boost status for a channel chat", + "class": "ChatBoostStatus", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the channel chat" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "boostChat", + "description": "Boosts a chat and returns the list of available chat boost slots for the current user after the boost", + "class": "ChatBoostSlots", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "slot_ids", + "type": "vector\u003cint32\u003e", + "description": "Identifiers of boost slots of the current user from which to apply boosts to the chat" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatBoostLink", + "description": "Returns an HTTPS link to boost the specified channel chat", + "class": "ChatBoostLink", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getChatBoostLinkInfo", + "description": "Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost", + "class": "ChatBoostLinkInfo", + "properties": [ + { + "name": "url", + "type": "string", + "description": "The link to boost a chat" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getChatBoosts", + "description": "Returns list of boosts applied to a chat; requires administrator rights in the channel chat", + "class": "FoundChatBoosts", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "only_gift_codes", + "type": "Bool", + "description": "Pass true to receive only boosts received from gift codes and giveaways created by the chat" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getUserChatBoosts", + "description": "Returns list of boosts applied to a chat by a given user; requires administrator rights in the channel chat; for bots only", + "class": "FoundChatBoosts", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "getAttachmentMenuBot", + "description": "Returns information about a bot that can be added to attachment or side menu", + "class": "AttachmentMenuBot", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Bot's user identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleBotIsAddedToAttachmentMenu", + "description": "Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Bot's user identifier" + }, + { + "name": "is_added", + "type": "Bool", + "description": "Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu" + }, + { + "name": "allow_write_access", + "type": "Bool", + "description": "Pass true if the current user allowed the bot to send them messages. Ignored if is_added is false" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getThemedEmojiStatuses", + "description": "Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getRecentEmojiStatuses", + "description": "Returns recent emoji statuses", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDefaultEmojiStatuses", + "description": "Returns default emoji statuses", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "clearRecentEmojiStatuses", + "description": "Clears the list of recently used emoji statuses", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "downloadFile", "description": "Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates", @@ -21153,22 +29877,22 @@ { "name": "priority", "type": "int32", - "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first" + "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first" }, { "name": "offset", - "type": "int32", + "type": "int53", "description": "The starting position from which the file needs to be downloaded" }, { "name": "limit", - "type": "int32", + "type": "int53", "description": "Number of bytes which need to be downloaded starting from the \"offset\" position before the download will automatically be canceled; use 0 to download without a limit" }, { "name": "synchronous", "type": "Bool", - "description": "If false, this request returns file state just after the download has been started. If true, this request returns file state only after the download has succeeded, has failed, has been canceled or a new downloadFile request with different offset/limit parameters was sent" + "description": "Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started" } ], "is_synchronous": false, @@ -21177,7 +29901,7 @@ { "name": "getFileDownloadedPrefixSize", "description": "Returns file downloaded prefix size from a given offset, in bytes", - "class": "Count", + "class": "FileDownloadedPrefixSize", "properties": [ { "name": "file_id", @@ -21186,7 +29910,7 @@ }, { "name": "offset", - "type": "int32", + "type": "int53", "description": "Offset from which downloaded prefix size needs to be calculated" } ], @@ -21232,8 +29956,8 @@ "type": 1 }, { - "name": "uploadFile", - "description": "Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message", + "name": "preliminaryUploadFile", + "description": "Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message", "class": "File", "properties": [ { @@ -21249,15 +29973,15 @@ { "name": "priority", "type": "int32", - "description": "Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded first" + "description": "Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first" } ], "is_synchronous": false, "type": 1 }, { - "name": "cancelUploadFile", - "description": "Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined", + "name": "cancelPreliminaryUploadFile", + "description": "Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile. For other files the behavior is undefined", "class": "Ok", "properties": [ { @@ -21281,7 +30005,7 @@ }, { "name": "offset", - "type": "int32", + "type": "int53", "description": "The offset from which to write the data to the file" }, { @@ -21305,12 +30029,12 @@ }, { "name": "expected_size", - "type": "int32", + "type": "int53", "description": "Expected size of the generated file, in bytes; 0 if unknown" }, { "name": "local_prefix_size", - "type": "int32", + "type": "int53", "description": "The number of bytes already generated" } ], @@ -21348,12 +30072,12 @@ }, { "name": "offset", - "type": "int32", + "type": "int53", "description": "The offset from which to read the file" }, { "name": "count", - "type": "int32", + "type": "int53", "description": "Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position" } ], @@ -21374,9 +30098,148 @@ "is_synchronous": false, "type": 1 }, + { + "name": "addFileToDownloads", + "description": "Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file", + "class": "File", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "Identifier of the file to download" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message with the file" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "priority", + "type": "int32", + "description": "Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleDownloadIsPaused", + "description": "Changes pause state of a file in the file download list", + "class": "Ok", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "Identifier of the downloaded file" + }, + { + "name": "is_paused", + "type": "Bool", + "description": "Pass true if the download is paused" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleAllDownloadsArePaused", + "description": "Changes pause state of all files in the file download list", + "class": "Ok", + "properties": [ + { + "name": "are_paused", + "type": "Bool", + "description": "Pass true to pause all downloads; pass false to unpause them" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "removeFileFromDownloads", + "description": "Removes a file from the file download list", + "class": "Ok", + "properties": [ + { + "name": "file_id", + "type": "int32", + "description": "Identifier of the downloaded file" + }, + { + "name": "delete_from_cache", + "type": "Bool", + "description": "Pass true to delete the file from the TDLib file cache" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "removeAllFilesFromDownloads", + "description": "Removes all files from the file download list", + "class": "Ok", + "properties": [ + { + "name": "only_active", + "type": "Bool", + "description": "Pass true to remove only active downloads, including paused" + }, + { + "name": "only_completed", + "type": "Bool", + "description": "Pass true to remove only completed downloads" + }, + { + "name": "delete_from_cache", + "type": "Bool", + "description": "Pass true to delete the file from the TDLib file cache" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "searchFileDownloads", + "description": "Searches for files in the file download list or recently downloaded files from the list", + "class": "FoundFileDownloads", + "properties": [ + { + "name": "query", + "type": "string", + "description": "Query to search for; may be empty to return all downloaded files" + }, + { + "name": "only_active", + "type": "Bool", + "description": "Pass true to search only for active downloads, including paused" + }, + { + "name": "only_completed", + "type": "Bool", + "description": "Pass true to search only for completed downloads" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of files to be returned" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "getMessageFileType", - "description": "Returns information about a file with messages exported from another app", + "description": "Returns information about a file with messages exported from another application", "class": "MessageFileType", "properties": [ { @@ -21468,7 +30331,7 @@ { "name": "creates_join_request", "type": "Bool", - "description": "True, if the link only creates join request. If true, member_limit must not be specified" + "description": "Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0" } ], "is_synchronous": false, @@ -21507,7 +30370,7 @@ { "name": "creates_join_request", "type": "Bool", - "description": "True, if the link only creates join request. If true, member_limit must not be specified" + "description": "Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0" } ], "is_synchronous": false, @@ -21687,7 +30550,7 @@ }, { "name": "joinChatByInviteLink", - "description": "Uses an invite link to add the current user to the chat if possible", + "description": "Uses an invite link to add the current user to the chat if possible. May return an error with a message \"INVITE_REQUEST_SENT\" if only a join request was created", "class": "Chat", "properties": [ { @@ -21751,7 +30614,7 @@ { "name": "approve", "type": "Bool", - "description": "True, if the request is approved. Otherwise the request is declived" + "description": "Pass true to approve the request; pass false to decline it" } ], "is_synchronous": false, @@ -21775,7 +30638,7 @@ { "name": "approve", "type": "Bool", - "description": "True, if the requests are approved. Otherwise the requests are declived" + "description": "Pass true to approve all requests; pass false to decline them" } ], "is_synchronous": false, @@ -21799,7 +30662,7 @@ { "name": "is_video", "type": "Bool", - "description": "True, if a video call needs to be created" + "description": "Pass true to create a video call" } ], "is_synchronous": false, @@ -21856,7 +30719,7 @@ { "name": "is_disconnected", "type": "Bool", - "description": "True, if the user was disconnected" + "description": "Pass true if the user was disconnected" }, { "name": "duration", @@ -21866,7 +30729,7 @@ { "name": "is_video", "type": "Bool", - "description": "True, if the call was a video call" + "description": "Pass true if the call was a video call" }, { "name": "connection_id", @@ -21908,7 +30771,7 @@ }, { "name": "sendCallDebugInformation", - "description": "Sends debug information for a call", + "description": "Sends debug information for a call to Telegram servers", "class": "Ok", "properties": [ { @@ -21925,6 +30788,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "sendCallLog", + "description": "Sends log file for a call to Telegram servers", + "class": "Ok", + "properties": [ + { + "name": "call_id", + "type": "int32", + "description": "Call identifier" + }, + { + "name": "log_file", + "type": "InputFile", + "description": "Call log file. Only inputFileLocal and inputFileGenerated are supported" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getVideoChatAvailableParticipants", "description": "Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined", @@ -21966,7 +30848,7 @@ { "name": "chat_id", "type": "int53", - "description": "Chat identifier, in which the video chat will be created" + "description": "Identifier of a chat in which the video chat will be created" }, { "name": "title", @@ -21977,6 +30859,39 @@ "name": "start_date", "type": "int32", "description": "Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future" + }, + { + "name": "is_rtmp_stream", + "type": "Bool", + "description": "Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getVideoChatRtmpUrl", + "description": "Returns RTMP URL for streaming to the chat; requires creator privileges", + "class": "RtmpUrl", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "replaceVideoChatRtmpUrl", + "description": "Replaces the current RTMP URL for streaming to the chat; requires creator privileges", + "class": "RtmpUrl", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" } ], "is_synchronous": false, @@ -22057,12 +30972,12 @@ { "name": "is_muted", "type": "Bool", - "description": "True, if the user's microphone is muted" + "description": "Pass true to join the call with muted microphone" }, { "name": "is_my_video_enabled", "type": "Bool", - "description": "True, if the user's video is enabled" + "description": "Pass true if the user's video is enabled" }, { "name": "invite_hash", @@ -22110,7 +31025,7 @@ { "name": "is_paused", "type": "Bool", - "description": "True if screen sharing is paused" + "description": "Pass true to pause screen sharing; pass false to unpause it" } ], "is_synchronous": false, @@ -22170,7 +31085,7 @@ }, { "name": "inviteGroupCallParticipants", - "description": "Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats", + "description": "Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats", "class": "Ok", "properties": [ { @@ -22319,7 +31234,7 @@ { "name": "is_speaking", "type": "Bool", - "description": "True, if the user is speaking" + "description": "Pass true if the user is speaking" } ], "is_synchronous": false, @@ -22343,7 +31258,7 @@ { "name": "is_muted", "type": "Bool", - "description": "Pass true if the user must be muted and false otherwise" + "description": "Pass true to mute the user; pass false to unmute them" } ], "is_synchronous": false, @@ -22444,6 +31359,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getGroupCallStreams", + "description": "Returns information about available group call streams", + "class": "GroupCallStreams", + "properties": [ + { + "name": "group_call_id", + "type": "int32", + "description": "Group call identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getGroupCallStreamSegment", "description": "Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video", @@ -22479,8 +31408,8 @@ "type": 2 }, { - "name": "toggleMessageSenderIsBlocked", - "description": "Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked", + "name": "setMessageSenderBlockList", + "description": "Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked", "class": "Ok", "properties": [ { @@ -22489,9 +31418,9 @@ "description": "Identifier of a message sender to block/unblock" }, { - "name": "is_blocked", - "type": "Bool", - "description": "New value of is_blocked" + "name": "block_list", + "type": "BlockList", + "description": "New block list for the message sender; pass null to unblock the message sender" } ], "is_synchronous": false, @@ -22510,17 +31439,17 @@ { "name": "delete_message", "type": "Bool", - "description": "Pass true if the message must be deleted" + "description": "Pass true to delete the message" }, { "name": "delete_all_messages", "type": "Bool", - "description": "Pass true if all messages from the same sender must be deleted" + "description": "Pass true to delete all messages from the same sender" }, { "name": "report_spam", "type": "Bool", - "description": "Pass true if the sender must be reported to the Telegram moderators" + "description": "Pass true to report the sender to the Telegram moderators" } ], "is_synchronous": false, @@ -22531,6 +31460,11 @@ "description": "Returns users and chats that were blocked by the current user", "class": "MessageSenders", "properties": [ + { + "name": "block_list", + "type": "BlockList", + "description": "Block list from which to return users" + }, { "name": "offset", "type": "int32", @@ -22553,12 +31487,12 @@ { "name": "contact", "type": "contact", - "description": "The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored" + "description": "The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored" }, { "name": "share_phone_number", "type": "Bool", - "description": "True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number" + "description": "Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number" } ], "is_synchronous": false, @@ -22580,7 +31514,7 @@ }, { "name": "getContacts", - "description": "Returns all user contacts", + "description": "Returns all contacts of the user", "class": "Users", "properties": [], "is_synchronous": false, @@ -22649,6 +31583,80 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setCloseFriends", + "description": "Changes the list of close friends of the current user", + "class": "Ok", + "properties": [ + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "User identifiers of close friends; the users must be contacts of the current user" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getCloseFriends", + "description": "Returns all close friends of the current user", + "class": "Users", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setUserPersonalProfilePhoto", + "description": "Changes a personal profile photo of a contact user", + "class": "Ok", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "photo", + "type": "InputChatPhoto", + "description": "Profile photo to set; pass null to delete the photo; inputChatPhotoPrevious isn't supported in this function" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "suggestUserProfilePhoto", + "description": "Suggests a profile photo to another regular user with common messages", + "class": "Ok", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "photo", + "type": "InputChatPhoto", + "description": "Profile photo to suggest; inputChatPhotoPrevious isn't supported in this function" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "searchUserByPhoneNumber", + "description": "Searches a user by their phone number. Returns a 404 error if the user can't be found", + "class": "User", + "properties": [ + { + "name": "phone_number", + "type": "string", + "description": "Phone number to search for" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "sharePhoneNumber", "description": "Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber", @@ -22665,7 +31673,7 @@ }, { "name": "getUserProfilePhotos", - "description": "Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already", + "description": "Returns the profile photos of a user. Personal and public photo aren't returned", "class": "ChatPhotos", "properties": [ { @@ -22689,18 +31697,57 @@ }, { "name": "getStickers", - "description": "Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, favorite and recently used stickers may also be returned", + "description": "Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned", "class": "Stickers", "properties": [ { - "name": "emoji", + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers to return" + }, + { + "name": "query", "type": "string", - "description": "String representation of emoji. If empty, returns all known installed stickers" + "description": "Search query; a space-separated list of emoji or a keyword prefix. If empty, returns all known installed stickers" }, { "name": "limit", "type": "int32", "description": "The maximum number of stickers to be returned" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getAllStickerEmojis", + "description": "Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id)", + "class": "Emojis", + "properties": [ + { + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers to search for" + }, + { + "name": "query", + "type": "string", + "description": "Search query" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier for which to find stickers" + }, + { + "name": "return_only_main_emoji", + "type": "Bool", + "description": "Pass true if only main emoji for each found sticker must be included in the result" } ], "is_synchronous": false, @@ -22708,18 +31755,37 @@ }, { "name": "searchStickers", - "description": "Searches for stickers from public sticker sets that correspond to a given emoji", + "description": "Searches for stickers from public sticker sets that correspond to any of the given emoji", "class": "Stickers", "properties": [ { - "name": "emoji", + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers to return" + }, + { + "name": "emojis", "type": "string", - "description": "String representation of emoji; must be non-empty" + "description": "Space-separated list of emoji to search for; must be non-empty" }, { "name": "limit", "type": "int32", - "description": "The maximum number of stickers to be returned" + "description": "The maximum number of stickers to be returned; 0-100" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumStickers", + "description": "Returns premium stickers from regular sticker sets", + "class": "Stickers", + "properties": [ + { + "name": "limit", + "type": "int32", + "description": "The maximum number of stickers to be returned; 0-100" } ], "is_synchronous": false, @@ -22731,9 +31797,9 @@ "class": "StickerSets", "properties": [ { - "name": "is_masks", - "type": "Bool", - "description": "Pass true to return mask sticker sets; pass false to return ordinary sticker sets" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to return" } ], "is_synchronous": false, @@ -22745,9 +31811,9 @@ "class": "StickerSets", "properties": [ { - "name": "is_masks", - "type": "Bool", - "description": "Pass true to return mask stickers sets; pass false to return ordinary sticker sets" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to return" }, { "name": "offset_sticker_set_id", @@ -22766,8 +31832,13 @@ { "name": "getTrendingStickerSets", "description": "Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib", - "class": "StickerSets", + "class": "TrendingStickerSets", "properties": [ + { + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to return" + }, { "name": "offset", "type": "int32", @@ -22784,7 +31855,7 @@ }, { "name": "getAttachedStickerSets", - "description": "Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets", + "description": "Returns a list of sticker sets attached to a file, including regular, mask, and emoji sticker sets. Currently, only animations, photos, and videos can have attached sticker sets", "class": "StickerSets", "properties": [ { @@ -22830,9 +31901,9 @@ "class": "StickerSets", "properties": [ { - "name": "is_masks", - "type": "Bool", - "description": "Pass true to return mask sticker sets; pass false to return ordinary sticker sets" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to search for" }, { "name": "query", @@ -22906,9 +31977,9 @@ "class": "Ok", "properties": [ { - "name": "is_masks", - "type": "Bool", - "description": "Pass true to change the order of mask sticker sets; pass false to change the order of ordinary sticker sets" + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to reorder" }, { "name": "sticker_set_ids", @@ -22935,7 +32006,7 @@ }, { "name": "addRecentSticker", - "description": "Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list", + "description": "Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers", "class": "Stickers", "properties": [ { @@ -22995,7 +32066,7 @@ }, { "name": "addFavoriteSticker", - "description": "Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list", + "description": "Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers", "class": "Ok", "properties": [ { @@ -23048,7 +32119,7 @@ { "name": "exact_match", "type": "Bool", - "description": "True, if only emojis, which exactly match text needs to be returned" + "description": "Pass true if only emojis, which exactly match the text, needs to be returned" }, { "name": "input_language_codes", @@ -23059,6 +32130,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getEmojiCategories", + "description": "Returns available emojis categories", + "class": "EmojiCategories", + "properties": [ + { + "name": "type", + "type": "EmojiCategoryType", + "description": "Type of emoji categories to return; pass null to get default emoji categories" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getAnimatedEmoji", "description": "Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji", @@ -23087,6 +32172,44 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getCustomEmojiStickers", + "description": "Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned", + "class": "Stickers", + "properties": [ + { + "name": "custom_emoji_ids", + "type": "vector\u003cint64\u003e", + "description": "Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getDefaultChatPhotoCustomEmojiStickers", + "description": "Returns default list of custom emoji stickers for placing on a chat photo", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDefaultProfilePhotoCustomEmojiStickers", + "description": "Returns default list of custom emoji stickers for placing on a profile photo", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDefaultBackgroundCustomEmojiStickers", + "description": "Returns default list of custom emoji stickers for reply background", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "getSavedAnimations", "description": "Returns saved animations", @@ -23166,13 +32289,18 @@ }, { "name": "getWebPagePreview", - "description": "Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview", + "description": "Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview", "class": "WebPage", "properties": [ { "name": "text", "type": "formattedText", "description": "Message text with formatting" + }, + { + "name": "link_preview_options", + "type": "linkPreviewOptions", + "description": "Options to be used for generation of the link preview; pass null to use default link preview options" } ], "is_synchronous": false, @@ -23191,7 +32319,7 @@ { "name": "force_full", "type": "Bool", - "description": "If true, the full instant view for the web page will be returned" + "description": "Pass true to get full instant view for the web page" } ], "is_synchronous": false, @@ -23206,6 +32334,11 @@ "name": "photo", "type": "InputChatPhoto", "description": "Profile photo to set" + }, + { + "name": "is_public", + "type": "Bool", + "description": "Pass true to set a public photo, which will be visible even the main photo is hidden by privacy settings" } ], "is_synchronous": false, @@ -23225,6 +32358,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setAccentColor", + "description": "Changes accent color and background custom emoji for the current user; for Telegram Premium users only", + "class": "Ok", + "properties": [ + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color to use" + }, + { + "name": "background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the reply header background; 0 if none" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setName", "description": "Changes the first and last name of the current user", @@ -23252,7 +32404,7 @@ { "name": "bio", "type": "string", - "description": "The new value of the user bio; 0-70 characters without line feeds" + "description": "The new value of the user bio; 0-getOption(\"bio_length_max\") characters without line feeds" } ], "is_synchronous": false, @@ -23260,13 +32412,60 @@ }, { "name": "setUsername", - "description": "Changes the username of the current user", + "description": "Changes the editable username of the current user", "class": "Ok", "properties": [ { "name": "username", "type": "string", - "description": "The new value of the username. Use an empty string to remove the username" + "description": "The new value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleUsernameIsActive", + "description": "Changes active state for a username of the current user. The editable username can't be disabled. May return an error with a message \"USERNAMES_ACTIVE_TOO_MUCH\" if the maximum number of active usernames has been reached", + "class": "Ok", + "properties": [ + { + "name": "username", + "type": "string", + "description": "The username to change" + }, + { + "name": "is_active", + "type": "Bool", + "description": "Pass true to activate the username; pass false to disable it" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reorderActiveUsernames", + "description": "Changes order of active usernames of the current user", + "class": "Ok", + "properties": [ + { + "name": "usernames", + "type": "vector\u003cstring\u003e", + "description": "The new order of active usernames. All currently active usernames must be specified" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setEmojiStatus", + "description": "Changes the emoji status of the current user; for Telegram Premium users only", + "class": "Ok", + "properties": [ + { + "name": "emoji_status", + "type": "emojiStatus", + "description": "New emoji status; pass null to switch to the default badge" } ], "is_synchronous": false, @@ -23274,7 +32473,7 @@ }, { "name": "setLocation", - "description": "Changes the location of the current user. Needs to be called if GetOption(\"is_location_visible\") is true and location changes for more than 1 kilometer", + "description": "Changes the location of the current user. Needs to be called if getOption(\"is_location_visible\") is true and location changes for more than 1 kilometer", "class": "Ok", "properties": [ { @@ -23288,7 +32487,7 @@ }, { "name": "changePhoneNumber", - "description": "Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code", + "description": "Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code", "class": "AuthenticationCodeInfo", "properties": [ { @@ -23307,7 +32506,7 @@ }, { "name": "resendChangePhoneNumberCode", - "description": "Re-sends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed", + "description": "Resends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed", "class": "AuthenticationCodeInfo", "properties": [], "is_synchronous": false, @@ -23327,6 +32526,28 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getUserLink", + "description": "Returns an HTTPS link, which can be used to get information about the current user", + "class": "UserLink", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "searchUserByToken", + "description": "Searches a user by a token from the user's link", + "class": "User", + "properties": [ + { + "name": "token", + "type": "string", + "description": "Token to search for" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setCommands", "description": "Sets the list of commands supported by the bot for the given user scope and language; for bots only", @@ -23340,7 +32561,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands" + "description": "A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands" }, { "name": "commands", @@ -23364,7 +32585,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code or an empty string" + "description": "A two-letter ISO 639-1 language code or an empty string" } ], "is_synchronous": false, @@ -23372,7 +32593,7 @@ }, { "name": "getCommands", - "description": "Returns the list of commands supported by the bot for the given user scope and language; for bots only", + "description": "Returns list of commands supported by the bot for the given user scope and language; for bots only", "class": "BotCommands", "properties": [ { @@ -23383,12 +32604,316 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code or an empty string" + "description": "A two-letter ISO 639-1 language code or an empty string" } ], "is_synchronous": false, "type": 3 }, + { + "name": "setMenuButton", + "description": "Sets menu button for the given user or for all users; for bots only", + "class": "Ok", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user or 0 to set menu button for all users" + }, + { + "name": "menu_button", + "type": "botMenuButton", + "description": "New menu button" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "getMenuButton", + "description": "Returns menu button set by the bot for the given user; for bots only", + "class": "BotMenuButton", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user or 0 to get the default menu button" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setDefaultGroupAdministratorRights", + "description": "Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only", + "class": "Ok", + "properties": [ + { + "name": "default_group_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setDefaultChannelAdministratorRights", + "description": "Sets default administrator rights for adding the bot to channel chats; for bots only", + "class": "Ok", + "properties": [ + { + "name": "default_channel_administrator_rights", + "type": "chatAdministratorRights", + "description": "Default administrator rights for adding the bot to channels; pass null to remove default rights" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "canBotSendMessages", + "description": "Checks whether the specified bot can send messages to the user. Returns a 404 error if can't and the access can be granted by call to allowBotToSendMessages", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "allowBotToSendMessages", + "description": "Allows the specified bot to send messages to the user", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "sendWebAppCustomRequest", + "description": "Sends a custom request from a Web App", + "class": "CustomRequestResult", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the bot" + }, + { + "name": "method", + "type": "string", + "description": "The method name" + }, + { + "name": "parameters", + "type": "string", + "description": "JSON-serialized method parameters" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setBotName", + "description": "Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name" + }, + { + "name": "name", + "type": "string", + "description": "New bot's name on the specified language; 0-64 characters; must be non-empty if language code is empty" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getBotName", + "description": "Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true", + "class": "Text", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code or an empty string" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "setBotProfilePhoto", + "description": "Changes a profile photo for a bot", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "photo", + "type": "InputChatPhoto", + "description": "Profile photo to set; pass null to delete the chat photo" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleBotUsernameIsActive", + "description": "Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message \"USERNAMES_ACTIVE_TOO_MUCH\" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "username", + "type": "string", + "description": "The username to change" + }, + { + "name": "is_active", + "type": "Bool", + "description": "Pass true to activate the username; pass false to disable it" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reorderBotActiveUsernames", + "description": "Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "usernames", + "type": "vector\u003cstring\u003e", + "description": "The new order of active usernames. All currently active usernames must be specified" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setBotInfoDescription", + "description": "Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code. If empty, the description will be shown to all users for whose languages there is no dedicated description" + }, + { + "name": "description", + "type": "string", + "description": "New bot's description on the specified language" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getBotInfoDescription", + "description": "Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true", + "class": "Text", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code or an empty string" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "setBotInfoShortDescription", + "description": "Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users for whose languages there is no dedicated description" + }, + { + "name": "short_description", + "type": "string", + "description": "New bot's short description on the specified language" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getBotInfoShortDescription", + "description": "Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true", + "class": "Text", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code or an empty string" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "getActiveSessions", "description": "Returns all active sessions of the current user", @@ -23419,6 +32944,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "confirmSession", + "description": "Confirms an unconfirmed session of the current user from another device", + "class": "Ok", + "properties": [ + { + "name": "session_id", + "type": "int64", + "description": "Session identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "toggleSessionCanAcceptCalls", "description": "Toggles whether a session can accept incoming calls", @@ -23432,7 +32971,7 @@ { "name": "can_accept_calls", "type": "Bool", - "description": "True, if incoming calls can be accepted by the session" + "description": "Pass true to allow accepting incoming calls by the session; pass false otherwise" } ], "is_synchronous": false, @@ -23451,7 +32990,7 @@ { "name": "can_accept_secret_chats", "type": "Bool", - "description": "True, if incoming secret chats can be accepted by the session" + "description": "Pass true to allow accepting secret chats by the session; pass false otherwise" } ], "is_synchronous": false, @@ -23503,7 +33042,7 @@ }, { "name": "setSupergroupUsername", - "description": "Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel", + "description": "Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel", "class": "Ok", "properties": [ { @@ -23514,7 +33053,64 @@ { "name": "username", "type": "string", - "description": "New value of the username. Use an empty string to remove the username" + "description": "New value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleSupergroupUsernameIsActive", + "description": "Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or channel. The editable username can't be disabled. May return an error with a message \"USERNAMES_ACTIVE_TOO_MUCH\" if the maximum number of active usernames has been reached", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup or channel" + }, + { + "name": "username", + "type": "string", + "description": "The username to change" + }, + { + "name": "is_active", + "type": "Bool", + "description": "Pass true to activate the username; pass false to disable it" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "disableAllSupergroupUsernames", + "description": "Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup or channel" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reorderSupergroupActiveUsernames", + "description": "Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup or channel" + }, + { + "name": "usernames", + "type": "vector\u003cstring\u003e", + "description": "The new order of active usernames. All currently active usernames must be specified" } ], "is_synchronous": false, @@ -23558,6 +33154,44 @@ "is_synchronous": false, "type": 2 }, + { + "name": "toggleSupergroupJoinToSendMessages", + "description": "Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members administrator right", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup" + }, + { + "name": "join_to_send_messages", + "type": "Bool", + "description": "New value of join_to_send_messages" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleSupergroupJoinByRequest", + "description": "Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the channel" + }, + { + "name": "join_by_request", + "type": "Bool", + "description": "New value of join_by_request" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "toggleSupergroupIsAllHistoryAvailable", "description": "Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right", @@ -23577,6 +33211,63 @@ "is_synchronous": false, "type": 2 }, + { + "name": "toggleSupergroupHasHiddenMembers", + "description": "Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers. Can be called only if supergroupFullInfo.can_hide_members == true", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup" + }, + { + "name": "has_hidden_members", + "type": "Bool", + "description": "New value of has_hidden_members" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleSupergroupHasAggressiveAntiSpamEnabled", + "description": "Toggles whether aggressive anti-spam checks are enabled in the supergroup. Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam == true", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "The identifier of the supergroup, which isn't a broadcast group" + }, + { + "name": "has_aggressive_anti_spam_enabled", + "type": "Bool", + "description": "The new value of has_aggressive_anti_spam_enabled" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleSupergroupIsForum", + "description": "Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup" + }, + { + "name": "is_forum", + "type": "Bool", + "description": "New value of is_forum" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "toggleSupergroupIsBroadcastGroup", "description": "Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup", @@ -23610,6 +33301,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "reportSupergroupAntiSpamFalsePositive", + "description": "Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup. Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Supergroup identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the erroneously deleted message" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getSupergroupMembers", "description": "Returns information about members or banned users in a supergroup or channel. Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters", @@ -23655,7 +33365,7 @@ }, { "name": "getChatEventLog", - "description": "Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id)", + "description": "Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id)", "class": "ChatEvents", "properties": [ { @@ -23694,22 +33404,17 @@ }, { "name": "getPaymentForm", - "description": "Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy", + "description": "Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy", "class": "PaymentForm", "properties": [ { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier of the Invoice message" - }, - { - "name": "message_id", - "type": "int53", - "description": "Message identifier" + "name": "input_invoice", + "type": "InputInvoice", + "description": "The invoice" }, { "name": "theme", - "type": "paymentFormTheme", + "type": "themeParameters", "description": "Preferred payment form theme; pass null to use the default theme" } ], @@ -23722,14 +33427,9 @@ "class": "ValidatedOrderInfo", "properties": [ { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier of the Invoice message" - }, - { - "name": "message_id", - "type": "int53", - "description": "Message identifier" + "name": "input_invoice", + "type": "InputInvoice", + "description": "The invoice" }, { "name": "order_info", @@ -23739,7 +33439,7 @@ { "name": "allow_save", "type": "Bool", - "description": "True, if the order information can be saved" + "description": "Pass true to save the order information" } ], "is_synchronous": false, @@ -23751,14 +33451,9 @@ "class": "PaymentResult", "properties": [ { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier of the Invoice message" - }, - { - "name": "message_id", - "type": "int53", - "description": "Message identifier" + "name": "input_invoice", + "type": "InputInvoice", + "description": "The invoice" }, { "name": "payment_form_id", @@ -23797,7 +33492,7 @@ { "name": "chat_id", "type": "int53", - "description": "Chat identifier of the PaymentSuccessful message" + "description": "Chat identifier of the messagePaymentSuccessful message" }, { "name": "message_id", @@ -23810,7 +33505,7 @@ }, { "name": "getSavedOrderInfo", - "description": "Returns saved order info, if any", + "description": "Returns saved order information. Returns a 404 error if there is no saved order information", "class": "OrderInfo", "properties": [], "is_synchronous": false, @@ -23818,7 +33513,7 @@ }, { "name": "deleteSavedOrderInfo", - "description": "Deletes saved order info", + "description": "Deletes saved order information", "class": "Ok", "properties": [], "is_synchronous": false, @@ -23832,6 +33527,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "createInvoiceLink", + "description": "Creates a link for the given invoice; for bots only", + "class": "HttpUrl", + "properties": [ + { + "name": "invoice", + "type": "InputMessageContent", + "description": "Information about the invoice of the type inputMessageInvoice" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getSupportUser", "description": "Returns a user that can be contacted to get support", @@ -23848,7 +33557,7 @@ { "name": "for_dark_theme", "type": "Bool", - "description": "True, if the backgrounds must be ordered for dark theme" + "description": "Pass true to order returned backgrounds for a dark theme" } ], "is_synchronous": false, @@ -23895,7 +33604,7 @@ { "name": "background", "type": "InputBackground", - "description": "The input background to use; pass null to create a new filled backgrounds or to remove the current background" + "description": "The input background to use; pass null to create a new filled background or to remove the current background" }, { "name": "type", @@ -23905,7 +33614,7 @@ { "name": "for_dark_theme", "type": "Bool", - "description": "True, if the background is chosen for dark theme" + "description": "Pass true if the background is changed for a dark theme" } ], "is_synchronous": false, @@ -23941,7 +33650,7 @@ { "name": "only_local", "type": "Bool", - "description": "If true, returns only locally available information without sending network requests" + "description": "Pass true to get only locally available information without sending network requests" } ], "is_synchronous": false, @@ -24002,7 +33711,7 @@ { "name": "language_pack_id", "type": "string", - "description": "Identifier of a language pack to be added; may be different from a name that is used in an \"https://t.me/setlanguage/\" link" + "description": "Identifier of a language pack to be added" } ], "is_synchronous": false, @@ -24016,7 +33725,7 @@ { "name": "info", "type": "languagePackInfo", - "description": "Information about the language pack. Language pack ID must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization" + "description": "Information about the language pack. Language pack identifier must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization" }, { "name": "strings", @@ -24170,7 +33879,7 @@ }, { "name": "getOption", - "description": "Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization", + "description": "Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options \"version\" and \"commit_hash\"", "class": "OptionValue", "properties": [ { @@ -24179,7 +33888,7 @@ "description": "The name of the option" } ], - "is_synchronous": false, + "is_synchronous": true, "type": 1 }, { @@ -24232,11 +33941,38 @@ "name": "reason", "type": "string", "description": "The reason why the account was deleted; optional" + }, + { + "name": "password", + "type": "string", + "description": "The 2-step verification password of the current user. If not specified, account deletion can be canceled within one week" } ], "is_synchronous": false, "type": 2 }, + { + "name": "setDefaultMessageAutoDeleteTime", + "description": "Changes the default message auto-delete time for new chats", + "class": "Ok", + "properties": [ + { + "name": "message_auto_delete_time", + "type": "messageAutoDeleteTime", + "description": "New default message auto-delete time; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDefaultMessageAutoDeleteTime", + "description": "Returns default message auto-delete time setting for new chats", + "class": "MessageAutoDeleteTime", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "removeChatActionBar", "description": "Removes a chat action bar without any other action", @@ -24264,11 +34000,11 @@ { "name": "message_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of reported messages, if any" + "description": "Identifiers of reported messages; may be empty to report the whole chat" }, { "name": "reason", - "type": "ChatReportReason", + "type": "ReportReason", "description": "The reason for reporting the chat" }, { @@ -24297,7 +34033,7 @@ }, { "name": "reason", - "type": "ChatReportReason", + "type": "ReportReason", "description": "The reason for reporting the chat photo" }, { @@ -24309,6 +34045,30 @@ "is_synchronous": false, "type": 2 }, + { + "name": "reportMessageReactions", + "description": "Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the sender, which added the reaction" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getChatStatistics", "description": "Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true", @@ -24352,6 +34112,35 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getMessagePublicForwards", + "description": "Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib", + "class": "FoundMessages", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getStatisticalGraph", "description": "Loads an asynchronous or a zoomed in statistical graph", @@ -24396,7 +34185,7 @@ "class": "StorageStatisticsFast", "properties": [], "is_synchronous": false, - "type": 1 + "type": 2 }, { "name": "getDatabaseStatistics", @@ -24424,7 +34213,7 @@ { "name": "count", "type": "int32", - "description": "Limit on the total count of files after deletion. Pass -1 to use the default limit" + "description": "Limit on the total number of files after deletion. Pass -1 to use the default limit" }, { "name": "immunity_delay", @@ -24482,7 +34271,7 @@ { "name": "only_current", "type": "Bool", - "description": "If true, returns only data for the current library launch" + "description": "Pass true to get statistics only for the current library launch" } ], "is_synchronous": false, @@ -24537,6 +34326,41 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getAutosaveSettings", + "description": "Returns autosave settings for the current user", + "class": "AutosaveSettings", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setAutosaveSettings", + "description": "Sets autosave settings for the given scope. The method is guaranteed to work only after at least one call to getAutosaveSettings", + "class": "Ok", + "properties": [ + { + "name": "scope", + "type": "AutosaveSettingsScope", + "description": "Autosave settings scope" + }, + { + "name": "settings", + "type": "scopeAutosaveSettings", + "description": "New autosave settings for the scope; pass null to set autosave settings to default" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "clearAutosaveSettingsExceptions", + "description": "Clears the list of all autosave settings exceptions. The method is guaranteed to work only after at least one call to getAutosaveSettings", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "getBankCardInfo", "description": "Returns information about a bank card", @@ -24564,7 +34388,7 @@ { "name": "password", "type": "string", - "description": "Password of the current user" + "description": "The 2-step verification password of the current user" } ], "is_synchronous": false, @@ -24578,7 +34402,7 @@ { "name": "password", "type": "string", - "description": "Password of the current user" + "description": "The 2-step verification password of the current user" } ], "is_synchronous": false, @@ -24597,7 +34421,7 @@ { "name": "password", "type": "string", - "description": "Password of the current user" + "description": "The 2-step verification password of the current user" } ], "is_synchronous": false, @@ -24671,7 +34495,7 @@ }, { "name": "resendPhoneNumberVerificationCode", - "description": "Re-sends the code to verify a phone number to be added to a user's Telegram Passport", + "description": "Resends the code to verify a phone number to be added to a user's Telegram Passport", "class": "AuthenticationCodeInfo", "properties": [], "is_synchronous": false, @@ -24707,7 +34531,7 @@ }, { "name": "resendEmailAddressVerificationCode", - "description": "Re-sends the code to verify an email address to be added to a user's Telegram Passport", + "description": "Resends the code to verify an email address to be added to a user's Telegram Passport", "class": "EmailAddressAuthenticationCodeInfo", "properties": [], "is_synchronous": false, @@ -24762,14 +34586,14 @@ "class": "PassportElementsWithErrors", "properties": [ { - "name": "autorization_form_id", + "name": "authorization_form_id", "type": "int32", "description": "Authorization form identifier" }, { "name": "password", "type": "string", - "description": "Password of the current user" + "description": "The 2-step verification password of the current user" } ], "is_synchronous": false, @@ -24781,7 +34605,7 @@ "class": "Ok", "properties": [ { - "name": "autorization_form_id", + "name": "authorization_form_id", "type": "int32", "description": "Authorization form identifier" }, @@ -24869,10 +34693,15 @@ "type": "int53", "description": "Sticker file owner; ignored for regular users" }, + { + "name": "sticker_format", + "type": "StickerFormat", + "description": "Sticker format" + }, { "name": "sticker", - "type": "InputSticker", - "description": "Sticker file to upload" + "type": "InputFile", + "description": "File file to upload; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" } ], "is_synchronous": false, @@ -24927,14 +34756,24 @@ "description": "Sticker set name. Can contain only English letters, digits and underscores. Must end with *\"_by_\u003cbot username\u003e\"* (*\u003cbot_username\u003e* is case insensitive) for bots; 1-64 characters" }, { - "name": "is_masks", + "name": "sticker_format", + "type": "StickerFormat", + "description": "Format of the stickers in the set" + }, + { + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers in the set" + }, + { + "name": "needs_repainting", "type": "Bool", - "description": "True, if stickers are masks. Animated stickers can't be masks" + "description": "Pass true if stickers in the sticker set must be repainted; for custom emoji sticker sets only" }, { "name": "stickers", - "type": "vector\u003cInputSticker\u003e", - "description": "List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown" + "type": "vector\u003cinputSticker\u003e", + "description": "List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown" }, { "name": "source", @@ -24947,8 +34786,8 @@ }, { "name": "addStickerToSet", - "description": "Adds a new sticker to a set; for bots only. Returns the sticker set", - "class": "StickerSet", + "description": "Adds a new sticker to a set; for bots only", + "class": "Ok", "properties": [ { "name": "user_id", @@ -24962,7 +34801,7 @@ }, { "name": "sticker", - "type": "InputSticker", + "type": "inputSticker", "description": "Sticker to add to the set" } ], @@ -24971,8 +34810,8 @@ }, { "name": "setStickerSetThumbnail", - "description": "Sets a sticker set thumbnail; for bots only. Returns the sticker set", - "class": "StickerSet", + "description": "Sets a sticker set thumbnail; for bots only", + "class": "Ok", "properties": [ { "name": "user_id", @@ -24987,7 +34826,59 @@ { "name": "thumbnail", "type": "InputFile", - "description": "Thumbnail to set in PNG or TGS format; pass null to remove the sticker set thumbnail. Animated thumbnail must be set for animated sticker sets and only for them" + "description": "Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setCustomEmojiStickerSetThumbnail", + "description": "Sets a custom emoji sticker set thumbnail; for bots only", + "class": "Ok", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Sticker set name" + }, + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Identifier of the custom emoji from the sticker set, which will be set as sticker set thumbnail; pass 0 to remove the sticker set thumbnail" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setStickerSetTitle", + "description": "Sets a sticker set title; for bots only", + "class": "Ok", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Sticker set name" + }, + { + "name": "title", + "type": "string", + "description": "New sticker set title" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "deleteStickerSet", + "description": "Deleted a sticker set; for bots only", + "class": "Ok", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Sticker set name" } ], "is_synchronous": false, @@ -25006,7 +34897,7 @@ { "name": "position", "type": "int32", - "description": "New position of the sticker in the set, zero-based" + "description": "New position of the sticker in the set, 0-based" } ], "is_synchronous": false, @@ -25026,6 +34917,63 @@ "is_synchronous": false, "type": 3 }, + { + "name": "setStickerEmojis", + "description": "Changes the list of emoji corresponding to a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot", + "class": "Ok", + "properties": [ + { + "name": "sticker", + "type": "InputFile", + "description": "Sticker" + }, + { + "name": "emojis", + "type": "string", + "description": "New string with 1-20 emoji corresponding to the sticker" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setStickerKeywords", + "description": "Changes the list of keywords of a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot", + "class": "Ok", + "properties": [ + { + "name": "sticker", + "type": "InputFile", + "description": "Sticker" + }, + { + "name": "keywords", + "type": "vector\u003cstring\u003e", + "description": "List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "setStickerMaskPosition", + "description": "Changes the mask position of a mask sticker; for bots only. The sticker must belong to a mask sticker set created by the bot", + "class": "Ok", + "properties": [ + { + "name": "sticker", + "type": "InputFile", + "description": "Sticker" + }, + { + "name": "mask_position", + "type": "maskPosition", + "description": "Position where the mask is placed; pass null to remove mask position" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getMapThumbnailFile", "description": "Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded", @@ -25059,12 +35007,220 @@ { "name": "chat_id", "type": "int53", - "description": "Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown" + "description": "Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown" } ], "is_synchronous": false, "type": 1 }, + { + "name": "getPremiumLimit", + "description": "Returns information about a limit, increased for Premium users. Returns a 404 error if the limit is unknown", + "class": "PremiumLimit", + "properties": [ + { + "name": "limit_type", + "type": "PremiumLimitType", + "description": "Type of the limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumFeatures", + "description": "Returns information about features, available to Premium users", + "class": "PremiumFeatures", + "properties": [ + { + "name": "source", + "type": "PremiumSource", + "description": "Source of the request; pass null if the method is called from some non-standard source" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumStickerExamples", + "description": "Returns examples of premium stickers for demonstration purposes", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "viewPremiumFeature", + "description": "Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen", + "class": "Ok", + "properties": [ + { + "name": "feature", + "type": "PremiumFeature", + "description": "The viewed premium feature" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "clickPremiumSubscriptionButton", + "description": "Informs TDLib that the user clicked Premium subscription button on the Premium features screen", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumState", + "description": "Returns state of Telegram Premium subscription and promotion videos for Premium features", + "class": "PremiumState", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumGiftCodePaymentOptions", + "description": "Returns available options for Telegram Premium gift code or giveaway creation", + "class": "PremiumGiftCodePaymentOptions", + "properties": [ + { + "name": "boosted_chat_id", + "type": "int53", + "description": "Identifier of the channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "checkPremiumGiftCode", + "description": "Return information about a Telegram Premium gift code", + "class": "PremiumGiftCodeInfo", + "properties": [ + { + "name": "code", + "type": "string", + "description": "The code to check" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "applyPremiumGiftCode", + "description": "Applies a Telegram Premium gift code", + "class": "Ok", + "properties": [ + { + "name": "code", + "type": "string", + "description": "The code to apply" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "launchPrepaidPremiumGiveaway", + "description": "Launches a prepaid Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels", + "class": "Ok", + "properties": [ + { + "name": "giveaway_id", + "type": "int64", + "description": "Unique identifier of the prepaid giveaway" + }, + { + "name": "parameters", + "type": "premiumGiveawayParameters", + "description": "Giveaway parameters" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumGiveawayInfo", + "description": "Returns information about a Telegram Premium giveaway", + "class": "PremiumGiveawayInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the channel chat which started the giveaway" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the giveaway message in the chat" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "canPurchasePremium", + "description": "Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase", + "class": "Ok", + "properties": [ + { + "name": "purpose", + "type": "StorePaymentPurpose", + "description": "Transaction purpose" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "assignAppStoreTransaction", + "description": "Informs server about a purchase through App Store. For official applications only", + "class": "Ok", + "properties": [ + { + "name": "receipt", + "type": "bytes", + "description": "App Store receipt" + }, + { + "name": "purpose", + "type": "StorePaymentPurpose", + "description": "Transaction purpose" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "assignGooglePlayTransaction", + "description": "Informs server about a purchase through Google Play. For official applications only", + "class": "Ok", + "properties": [ + { + "name": "package_name", + "type": "string", + "description": "Application package name" + }, + { + "name": "store_product_id", + "type": "string", + "description": "Identifier of the purchased store product" + }, + { + "name": "purchase_token", + "type": "string", + "description": "Google Play purchase token" + }, + { + "name": "purpose", + "type": "StorePaymentPurpose", + "description": "Transaction purpose" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "acceptTermsOfService", "description": "Accepts Telegram terms of services", @@ -25079,6 +35235,35 @@ "is_synchronous": false, "type": 2 }, + { + "name": "searchStringsByPrefix", + "description": "Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously", + "class": "FoundPositions", + "properties": [ + { + "name": "strings", + "type": "vector\u003cstring\u003e", + "description": "The strings to search in for the query" + }, + { + "name": "query", + "type": "string", + "description": "Query to search for" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of objects to return" + }, + { + "name": "return_none_for_empty_query", + "type": "Bool", + "description": "Pass true to receive no results for an empty query" + } + ], + "is_synchronous": true, + "type": 1 + }, { "name": "sendCustomRequest", "description": "Sends a custom request; for bots only", @@ -25169,7 +35354,7 @@ { "name": "language_code", "type": "string", - "description": "A two-letter ISO 639-1 country code for country information localization" + "description": "A two-letter ISO 639-1 language code for country information localization" }, { "name": "phone_number_prefix", @@ -25180,14 +35365,6 @@ "is_synchronous": true, "type": 1 }, - { - "name": "getApplicationDownloadLink", - "description": "Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram", - "class": "HttpUrl", - "properties": [], - "is_synchronous": false, - "type": 2 - }, { "name": "getDeepLinkInfo", "description": "Returns information about a tg:// deep link. Use \"tg://need_update_for_some_feature\" or \"tg:some_unsupported_feature\" for testing. Returns a 404 error for unknown links. Can be called before authorization", @@ -25210,6 +35387,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "addApplicationChangelog", + "description": "Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed", + "class": "Ok", + "properties": [ + { + "name": "previous_application_version", + "type": "string", + "description": "The previous application version" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "saveApplicationLogEvent", "description": "Saves application log event on the server. Can be called before authorization", @@ -25234,6 +35425,14 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getApplicationDownloadLink", + "description": "Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram", + "class": "HttpUrl", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "addProxy", "description": "Adds a proxy server for network requests. Can be called before authorization", @@ -25242,7 +35441,7 @@ { "name": "server", "type": "string", - "description": "Proxy server IP address" + "description": "Proxy server domain or IP address" }, { "name": "port", @@ -25252,7 +35451,7 @@ { "name": "enable", "type": "Bool", - "description": "True, if the proxy needs to be enabled" + "description": "Pass true to immediately enable the proxy" }, { "name": "type", @@ -25276,7 +35475,7 @@ { "name": "server", "type": "string", - "description": "Proxy server IP address" + "description": "Proxy server domain or IP address" }, { "name": "port", @@ -25286,7 +35485,7 @@ { "name": "enable", "type": "Bool", - "description": "True, if the proxy needs to be enabled" + "description": "Pass true to immediately enable the proxy" }, { "name": "type", @@ -25473,6 +35672,47 @@ "is_synchronous": true, "type": 1 }, + { + "name": "getUserSupportInfo", + "description": "Returns support information for the given user; for Telegram support only", + "class": "UserSupportInfo", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setUserSupportInfo", + "description": "Sets support information for the given user; for Telegram support only", + "class": "UserSupportInfo", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "message", + "type": "formattedText", + "description": "New information message" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getSupportName", + "description": "Returns localized name of the Telegram support user; for Telegram support only", + "class": "Text", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "testCallEmpty", "description": "Does nothing; for testing only. This is an offline method. Can be called before authorization", @@ -25595,7 +35835,7 @@ { "name": "server", "type": "string", - "description": "Proxy server IP address" + "description": "Proxy server domain or IP address" }, { "name": "port", @@ -25610,7 +35850,7 @@ { "name": "dc_id", "type": "int32", - "description": "Identifier of a datacenter, with which to test connection" + "description": "Identifier of a datacenter with which to test connection" }, { "name": "timeout", diff --git a/data/td_api.tl b/data/td_api.tl index d973c2b..c2b106b 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -22,50 +22,82 @@ error code:int32 message:string = Error; ok = Ok; -//@description Contains parameters for TDLib initialization -//@use_test_dc If set to true, the Telegram test environment will be used instead of the production environment -//@database_directory The path to the directory for the persistent database; if empty, the current working directory will be used -//@files_directory The path to the directory for storing files; if empty, database_directory will be used -//@use_file_database If set to true, information about downloaded and uploaded files will be saved between application restarts -//@use_chat_info_database If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database -//@use_message_database If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database -//@use_secret_chats If set to true, support for secret chats will be enabled -//@api_id Application identifier for Telegram API access, which can be obtained at https://my.telegram.org -//@api_hash Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org -//@system_language_code IETF language tag of the user's operating system language; must be non-empty -//@device_model Model of the device the application is being run on; must be non-empty -//@system_version Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib -//@application_version Application version; must be non-empty -//@enable_storage_optimizer If set to true, old files will automatically be deleted -//@ignore_file_names If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name -tdlibParameters use_test_dc:Bool database_directory:string files_directory:string use_file_database:Bool use_chat_info_database:Bool use_message_database:Bool use_secret_chats:Bool api_id:int32 api_hash:string system_language_code:string device_model:string system_version:string application_version:string enable_storage_optimizer:Bool ignore_file_names:Bool = TdlibParameters; - - //@class AuthenticationCodeType @description Provides information about the method by which an authentication code is delivered to the user -//@description An authentication code is delivered via a private Telegram message, which can be viewed from another active session @length Length of the code +//@description An authentication code is delivered via a private Telegram message, which can be viewed from another active session +//@length Length of the code authenticationCodeTypeTelegramMessage length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered via an SMS message to the specified phone number @length Length of the code +//@description An authentication code is delivered via an SMS message to the specified phone number; applications may not receive this type of code +//@length Length of the code authenticationCodeTypeSms length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered via a phone call to the specified phone number @length Length of the code +//@description An authentication code is delivered via a phone call to the specified phone number +//@length Length of the code authenticationCodeTypeCall length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically @pattern Pattern of the phone number from which the call will be made +//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically +//@pattern Pattern of the phone number from which the call will be made authenticationCodeTypeFlashCall pattern:string = AuthenticationCodeType; -//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user @phone_number_prefix Prefix of the phone number from which the call will be made @length Number of digits in the code, excluding the prefix +//@description An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user +//@phone_number_prefix Prefix of the phone number from which the call will be made +//@length Number of digits in the code, excluding the prefix authenticationCodeTypeMissedCall phone_number_prefix:string length:int32 = AuthenticationCodeType; +//@description An authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT +//@url URL to open to receive the code +//@length Length of the code +authenticationCodeTypeFragment url:string length:int32 = AuthenticationCodeType; -//@description Information about the authentication code that was sent @phone_number A phone number that is being authenticated @type The way the code was sent to the user @next_type The way the next code will be sent to the user; may be null @timeout Timeout before the code can be re-sent, in seconds +//@description An authentication code is delivered via Firebase Authentication to the official Android application +//@nonce Nonce to pass to the SafetyNet Attestation API +//@length Length of the code +authenticationCodeTypeFirebaseAndroid nonce:bytes length:int32 = AuthenticationCodeType; + +//@description An authentication code is delivered via Firebase Authentication to the official iOS application +//@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 +//@length Length of the code +authenticationCodeTypeFirebaseIos receipt:string push_timeout:int32 length:int32 = AuthenticationCodeType; + + +//@description Information about the authentication code that was sent +//@phone_number A phone number that is being authenticated +//@type The way the code was sent to the user +//@next_type The way the next code will be sent to the user; may be null +//@timeout Timeout before the code can be re-sent, in seconds authenticationCodeInfo phone_number:string type:AuthenticationCodeType next_type:AuthenticationCodeType timeout:int32 = AuthenticationCodeInfo; -//@description Information about the email address authentication code that was sent @email_address_pattern Pattern of the email address to which an authentication code was sent @length Length of the code; 0 if unknown +//@description Information about the email address authentication code that was sent +//@email_address_pattern Pattern of the email address to which an authentication code was sent +//@length Length of the code; 0 if unknown emailAddressAuthenticationCodeInfo email_address_pattern:string length:int32 = EmailAddressAuthenticationCodeInfo; +//@class EmailAddressAuthentication @description Contains authentication data for a email address + +//@description An authentication code delivered to a user's email address @code The code +emailAddressAuthenticationCode code:string = EmailAddressAuthentication; + +//@description An authentication token received through Apple ID @token The token +emailAddressAuthenticationAppleId token:string = EmailAddressAuthentication; + +//@description An authentication token received through Google ID @token The token +emailAddressAuthenticationGoogleId token:string = EmailAddressAuthentication; + + +//@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 textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; @@ -73,39 +105,52 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntities entities:vector = TextEntities; //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other +//-Pre, Code and PreCode entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other formattedText text:string entities:vector = FormattedText; -//@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if any @show_popup True, if a blocking popup with terms of service must be shown to the user +//@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if age isn't restricted @show_popup True, if a blocking popup with terms of service must be shown to the user termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfService; //@class AuthorizationState @description Represents the current authorization state of the TDLib client -//@description TDLib needs TdlibParameters for initialization +//@description Initialization parameters are needed. Call setTdlibParameters to provide them authorizationStateWaitTdlibParameters = AuthorizationState; -//@description TDLib needs an encryption key to decrypt the local database @is_encrypted True, if the database is currently encrypted -authorizationStateWaitEncryptionKey is_encrypted:Bool = AuthorizationState; - -//@description TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options +//@description TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options authorizationStateWaitPhoneNumber = AuthorizationState; -//@description TDLib needs the user's authentication code to authorize @code_info Information about the authorization code that was sent +//@description TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed +//@allow_apple_id True, if authorization through Apple ID is allowed +//@allow_google_id True, if authorization through Google ID is allowed +authorizationStateWaitEmailAddress allow_apple_id:Bool allow_google_id:Bool = AuthorizationState; + +//@description TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code +//@allow_apple_id True, if authorization through Apple ID is allowed +//@allow_google_id True, if authorization through Google ID is allowed +//@code_info Information about the sent authentication code +//@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 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 authorizationStateWaitCode code_info:authenticationCodeInfo = AuthorizationState; //@description The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link @link A tg:// URL for the QR code. The link will be updated frequently authorizationStateWaitOtherDeviceConfirmation link:string = AuthorizationState; -//@description The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration @terms_of_service Telegram terms of service +//@description The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data @terms_of_service Telegram terms of service authorizationStateWaitRegistration terms_of_service:termsOfService = AuthorizationState; -//@description The user has been authorized, but needs to enter a password to start using the application @password_hint Hint for the password; may be empty @has_recovery_email_address True, if a recovery email address has been set up +//@description The user has been authorized, but needs to enter a 2-step verification password to start using the application. +//-Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week +//@password_hint Hint for the password; may be empty +//@has_recovery_email_address True, if a recovery email address has been set up +//@has_passport_data True, if some Telegram Passport elements were saved //@recovery_email_address_pattern Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent -authorizationStateWaitPassword password_hint:string has_recovery_email_address:Bool recovery_email_address_pattern:string = AuthorizationState; +authorizationStateWaitPassword password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_pattern:string = AuthorizationState; -//@description The user has been successfully authorized. TDLib is now ready to answer queries +//@description The user has been successfully authorized. TDLib is now ready to answer general requests authorizationStateReady = AuthorizationState; //@description The user is currently logging out @@ -119,11 +164,15 @@ authorizationStateClosing = AuthorizationState; authorizationStateClosed = AuthorizationState; -//@description Represents the current state of 2-step verification @has_password True, if a 2-step verification password is set @password_hint Hint for the password; may be empty -//@has_recovery_email_address True, if a recovery email is set @has_passport_data True, if some Telegram Passport elements were saved +//@description Represents the current state of 2-step verification +//@has_password True, if a 2-step verification password is set +//@password_hint Hint for the password; may be empty +//@has_recovery_email_address True, if a recovery email is set +//@has_passport_data True, if some Telegram Passport elements were saved //@recovery_email_address_code_info Information about the recovery email address to which the confirmation email was sent; may be null -//@pending_reset_date If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword -passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo pending_reset_date:int32 = PasswordState; +//@login_email_address_pattern Pattern of the email address set up for logging in +//@pending_reset_date If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword +passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo login_email_address_pattern:string pending_reset_date:int32 = PasswordState; //@description Contains information about the current recovery email address @recovery_email_address Recovery email address recoveryEmailAddress recovery_email_address:string = RecoveryEmailAddress; @@ -142,17 +191,18 @@ temporaryPasswordState has_password:Bool valid_for:int32 = TemporaryPasswordStat //@download_offset Download will be started from this offset. downloaded_prefix_size is calculated from this offset //@downloaded_prefix_size If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes //@downloaded_size Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage -localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_active:Bool is_downloading_completed:Bool download_offset:int32 downloaded_prefix_size:int32 downloaded_size:int32 = LocalFile; +localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_active:Bool is_downloading_completed:Bool download_offset:int53 downloaded_prefix_size:int53 downloaded_size:int53 = LocalFile; //@description Represents a remote file //@id Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. -//-If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. -//-If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location +//-If the identifier starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. +//-If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. +//-Application must generate the file by downloading it to the specified location //@unique_id Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time //@is_uploading_active True, if the file is currently being uploaded (or a remote copy is being generated by some other means) //@is_uploading_completed True, if a remote copy is fully available //@uploaded_size Size of the remote available part of the file, in bytes; 0 if unknown -remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_completed:Bool uploaded_size:int32 = RemoteFile; +remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_completed:Bool uploaded_size:int53 = RemoteFile; //@description Represents a file //@id Unique file identifier @@ -160,15 +210,15 @@ remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_comp //@expected_size Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress //@local Information about the local copy of the file //@remote Information about the remote copy of the file -file id:int32 size:int32 expected_size:int32 local:localFile remote:remoteFile = File; +file id:int32 size:int53 expected_size:int53 local:localFile remote:remoteFile = File; //@class InputFile @description Points to a file -//@description A file defined by its unique ID @id Unique file identifier +//@description A file defined by its unique identifier @id Unique file identifier inputFileId id:int32 = InputFile; -//@description A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. +//@description A file defined by its remote identifier. The remote identifier is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. //-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application //@id Remote file identifier inputFileRemote id:string = InputFile; @@ -176,14 +226,18 @@ inputFileRemote id:string = InputFile; //@description A file defined by a local path @path Local path to the file inputFileLocal path:string = InputFile; -//@description A file generated by the application @original_path Local path to a file from which the file is generated; may be empty if there is no such file +//@description A file generated by the application +//@original_path Local path to a file from which the file is generated; may be empty if there is no such file //@conversion String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage //@expected_size Expected size of the generated file, in bytes; 0 if unknown -inputFileGenerated original_path:string conversion:string expected_size:int32 = InputFile; +inputFileGenerated original_path:string conversion:string expected_size:int53 = InputFile; -//@description Describes an image in JPEG format @type Image type (see https://core.telegram.org/constructor/photoSize) -//@photo Information about the image file @width Image width @height Image height +//@description Describes an image in JPEG format +//@type Image type (see https://core.telegram.org/constructor/photoSize) +//@photo Information about the image file +//@width Image width +//@height Image height //@progressive_sizes Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes photoSize type:string photo:file width:int32 height:int32 progressive_sizes:vector = PhotoSize; @@ -191,28 +245,35 @@ photoSize type:string photo:file width:int32 height:int32 progressive_sizes:vect minithumbnail width:int32 height:int32 data:bytes = Minithumbnail; -//@class ThumbnailFormat @description Describes format of the thumbnail +//@class ThumbnailFormat @description Describes format of a thumbnail //@description The thumbnail is in JPEG format thumbnailFormatJpeg = ThumbnailFormat; -//@description The thumbnail is in PNG format. It will be used only for background patterns -thumbnailFormatPng = ThumbnailFormat; - -//@description The thumbnail is in WEBP format. It will be used only for some stickers -thumbnailFormatWebp = ThumbnailFormat; - -//@description The thumbnail is in static GIF format. It will be used only for some bot inline results +//@description The thumbnail is in static GIF format. It will be used only for some bot inline query results thumbnailFormatGif = ThumbnailFormat; -//@description The thumbnail is in TGS format. It will be used only for animated sticker sets -thumbnailFormatTgs = ThumbnailFormat; - //@description The thumbnail is in MPEG4 format. It will be used only for some animations and videos thumbnailFormatMpeg4 = ThumbnailFormat; +//@description The thumbnail is in PNG format. It will be used only for background patterns +thumbnailFormatPng = ThumbnailFormat; -//@description Represents a thumbnail @format Thumbnail format @width Thumbnail width @height Thumbnail height @file The thumbnail +//@description The thumbnail is in TGS format. It will be used only for TGS sticker sets +thumbnailFormatTgs = ThumbnailFormat; + +//@description The thumbnail is in WEBM format. It will be used only for WEBM sticker sets +thumbnailFormatWebm = ThumbnailFormat; + +//@description The thumbnail is in WEBP format. It will be used only for some stickers +thumbnailFormatWebp = ThumbnailFormat; + + +//@description Represents a thumbnail +//@format Thumbnail format +//@width Thumbnail width +//@height Thumbnail height +//@file The thumbnail thumbnail format:ThumbnailFormat width:int32 height:int32 file:file = Thumbnail; @@ -230,19 +291,62 @@ maskPointMouth = MaskPoint; //@description The mask is placed relatively to the chin maskPointChin = MaskPoint; -//@description Position on a photo where a mask is placed @point Part of the face, relative to which the mask is placed +//@description Position on a photo where a mask is placed +//@point Part of the face, relative to which the mask is placed //@x_shift Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position) //@y_shift Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. (For example, 1.0 will place the mask just below the default mask position) //@scale Mask scaling coefficient. (For example, 2.0 means a doubled size) maskPosition point:MaskPoint x_shift:double y_shift:double scale:double = MaskPosition; +//@class StickerFormat @description Describes format of a sticker + +//@description The sticker is an image in WEBP format +stickerFormatWebp = StickerFormat; + +//@description The sticker is an animation in TGS format +stickerFormatTgs = StickerFormat; + +//@description The sticker is a video in WEBM format +stickerFormatWebm = StickerFormat; + + +//@class StickerType @description Describes type of a sticker + +//@description The sticker is a regular sticker +stickerTypeRegular = StickerType; + +//@description The sticker is a mask in WEBP format to be placed on photos or videos +stickerTypeMask = StickerType; + +//@description The sticker is a custom emoji to be used inside message text and caption +stickerTypeCustomEmoji = StickerType; + + +//@class StickerFullType @description Contains full information about sticker type + +//@description The sticker is a regular sticker @premium_animation Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker +stickerFullTypeRegular premium_animation:file = StickerFullType; + +//@description The sticker is a mask in WEBP format to be placed on photos or videos @mask_position Position where the mask is placed; may be null +stickerFullTypeMask mask_position:maskPosition = StickerFullType; + +//@description The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji +//@custom_emoji_id Identifier of the custom emoji +//@needs_repainting True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places +stickerFullTypeCustomEmoji custom_emoji_id:int64 needs_repainting:Bool = StickerFullType; + + //@description Represents a closed vector path. The path begins at the end point of the last command @commands List of vector path commands closedVectorPath commands:vector = ClosedVectorPath; -//@description Describes one answer option of a poll @text Option text; 1-100 characters @voter_count Number of voters for this option, available only for closed or voted polls @vote_percentage The percentage of votes for this option; 0-100 -//@is_chosen True, if the option was chosen by the user @is_being_chosen True, if the option is being chosen by a pending setPollAnswer request +//@description Describes one answer option of a poll +//@text Option text; 1-100 characters +//@voter_count Number of voters for this option, available only for closed or voted polls +//@vote_percentage The percentage of votes for this option; 0-100 +//@is_chosen True, if the option was chosen by the user +//@is_being_chosen True, if the option is being chosen by a pending setPollAnswer request pollOption text:string voter_count:int32 vote_percentage:int32 is_chosen:Bool is_being_chosen:Bool = PollOption; @@ -257,87 +361,183 @@ pollTypeRegular allow_multiple_answers:Bool = PollType; pollTypeQuiz correct_option_id:int32 explanation:formattedText = PollType; -//@description Describes an animation file. The animation must be encoded in GIF or MPEG4 format @duration Duration of the animation, in seconds; as defined by the sender @width Width of the animation @height Height of the animation -//@file_name Original name of the file; as defined by the sender @mime_type MIME type of the file, usually "image/gif" or "video/mp4" +//@description Describes an animation file. The animation must be encoded in GIF or MPEG4 format +//@duration Duration of the animation, in seconds; as defined by the sender +//@width Width of the animation +//@height Height of the animation +//@file_name Original name of the file; as defined by the sender +//@mime_type MIME type of the file, usually "image/gif" or "video/mp4" //@has_stickers True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets -//@minithumbnail Animation minithumbnail; may be null @thumbnail Animation thumbnail in JPEG or MPEG4 format; may be null @animation File containing the animation +//@minithumbnail Animation minithumbnail; may be null +//@thumbnail Animation thumbnail in JPEG or MPEG4 format; may be null +//@animation File containing the animation animation duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool minithumbnail:minithumbnail thumbnail:thumbnail animation:file = Animation; -//@description Describes an audio file. Audio is usually in MP3 or M4A format @duration Duration of the audio, in seconds; as defined by the sender @title Title of the audio; as defined by the sender @performer Performer of the audio; as defined by the sender -//@file_name Original name of the file; as defined by the sender @mime_type The MIME type of the file; as defined by the sender @album_cover_minithumbnail The minithumbnail of the album cover; may be null -//@album_cover_thumbnail The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null @audio File containing the audio -audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:thumbnail audio:file = Audio; +//@description Describes an audio file. Audio is usually in MP3 or M4A format +//@duration Duration of the audio, in seconds; as defined by the sender +//@title Title of the audio; as defined by the sender +//@performer Performer of the audio; as defined by the sender +//@file_name Original name of the file; as defined by the sender +//@mime_type The MIME type of the file; as defined by the sender +//@album_cover_minithumbnail The minithumbnail of the album cover; may be null +//@album_cover_thumbnail The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null +//@external_album_covers Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate +//@audio File containing the audio +audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:thumbnail external_album_covers:vector audio:file = Audio; -//@description Describes a document of any type @file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender -//@minithumbnail Document minithumbnail; may be null @thumbnail Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null @document File containing the document +//@description Describes a document of any type +//@file_name Original name of the file; as defined by the sender +//@mime_type MIME type of the file; as defined by the sender +//@minithumbnail Document minithumbnail; may be null +//@thumbnail Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null +//@document File containing the document document file_name:string mime_type:string minithumbnail:minithumbnail thumbnail:thumbnail document:file = Document; -//@description Describes a photo @has_stickers True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets -//@minithumbnail Photo minithumbnail; may be null @sizes Available variants of the photo, in different sizes +//@description Describes a photo +//@has_stickers True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets +//@minithumbnail Photo minithumbnail; may be null +//@sizes Available variants of the photo, in different sizes photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector = Photo; -//@description Describes a sticker @set_id The identifier of the sticker set to which the sticker belongs; 0 if none @width Sticker width; as defined by the sender @height Sticker height; as defined by the sender -//@emoji Emoji corresponding to the sticker @is_animated True, if the sticker is an animated sticker in TGS format @is_mask True, if the sticker is a mask @mask_position Position where the mask is placed; may be null -//@outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner @thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @sticker File containing the sticker -sticker set_id:int64 width:int32 height:int32 emoji:string is_animated:Bool is_mask:Bool mask_position:maskPosition outline:vector thumbnail:thumbnail sticker:file = Sticker; +//@description Describes a sticker +//@id Unique sticker identifier within the set; 0 if none +//@set_id Identifier of the sticker set to which the sticker belongs; 0 if none +//@width Sticker width; as defined by the sender +//@height Sticker height; as defined by the sender +//@emoji Emoji corresponding to the sticker +//@format Sticker format +//@full_type Sticker's full type +//@outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@thumbnail Sticker thumbnail in WEBP or JPEG format; may be null +//@sticker File containing the sticker +sticker id:int64 set_id:int64 width:int32 height:int32 emoji:string format:StickerFormat full_type:StickerFullType outline:vector thumbnail:thumbnail sticker:file = Sticker; -//@description Describes a video file @duration Duration of the video, in seconds; as defined by the sender @width Video width; as defined by the sender @height Video height; as defined by the sender -//@file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender +//@description Describes a video file +//@duration Duration of the video, in seconds; as defined by the sender +//@width Video width; as defined by the sender +//@height Video height; as defined by the sender +//@file_name Original name of the file; as defined by the sender +//@mime_type MIME type of the file; as defined by the sender //@has_stickers True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets -//@supports_streaming True, if the video is supposed to be streamed @minithumbnail Video minithumbnail; may be null -//@thumbnail Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null @video File containing the video +//@supports_streaming True, if the video is supposed to be streamed +//@minithumbnail Video minithumbnail; may be null +//@thumbnail Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null +//@video File containing the video video duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool supports_streaming:Bool minithumbnail:minithumbnail thumbnail:thumbnail video:file = Video; -//@description Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format @duration Duration of the video, in seconds; as defined by the sender -//@length Video width and height; as defined by the sender @minithumbnail Video minithumbnail; may be null -//@thumbnail Video thumbnail in JPEG format; as defined by the sender; may be null @video File containing the video -videoNote duration:int32 length:int32 minithumbnail:minithumbnail thumbnail:thumbnail video:file = VideoNote; +//@description Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format +//@duration Duration of the video, in seconds; as defined by the sender +//@waveform A waveform representation of the video note's audio in 5-bit format; may be empty if unknown +//@length Video width and height; as defined by the sender +//@minithumbnail Video minithumbnail; may be null +//@thumbnail Video thumbnail in JPEG format; as defined by the sender; may be null +//@speech_recognition_result Result of speech recognition in the video note; may be null +//@video File containing the video +videoNote duration:int32 waveform:bytes length:int32 minithumbnail:minithumbnail thumbnail:thumbnail speech_recognition_result:SpeechRecognitionResult video:file = VideoNote; -//@description Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel @duration Duration of the voice note, in seconds; as defined by the sender -//@waveform A waveform representation of the voice note in 5-bit format @mime_type MIME type of the file; as defined by the sender @voice File containing the voice note -voiceNote duration:int32 waveform:bytes mime_type:string voice:file = VoiceNote; +//@description Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel +//@duration Duration of the voice note, in seconds; as defined by the sender +//@waveform A waveform representation of the voice note in 5-bit format +//@mime_type MIME type of the file; as defined by the sender +//@speech_recognition_result Result of speech recognition in the voice note; may be null +//@voice File containing the voice note +voiceNote duration:int32 waveform:bytes mime_type:string speech_recognition_result:SpeechRecognitionResult voice:file = VoiceNote; -//@description Describes an animated representation of an emoji -//@sticker Animated sticker for the emoji +//@description Describes an animated or custom representation of an emoji +//@sticker Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs +//@sticker_width Expected width of the sticker, which can be used if the sticker is null +//@sticker_height Expected height of the sticker, which can be used if the sticker is null //@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none -//@sound File containing the sound to be played when the animated emoji is clicked if any; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container -animatedEmoji sticker:sticker fitzpatrick_type:int32 sound:file = AnimatedEmoji; +//@sound File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container +animatedEmoji sticker:sticker sticker_width:int32 sticker_height:int32 fitzpatrick_type:int32 sound:file = AnimatedEmoji; -//@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0 +//@description Describes a user contact +//@phone_number Phone number of the user +//@first_name First name of the user; 1-255 characters in length +//@last_name Last name of the user +//@vcard Additional data about the user in a form of vCard; 0-2048 bytes in length +//@user_id Identifier of the user, if known; 0 otherwise contact phone_number:string first_name:string last_name:string vcard:string user_id:int53 = Contact; -//@description Describes a location on planet Earth @latitude Latitude of the location in degrees; as defined by the sender @longitude Longitude of the location, in degrees; as defined by the sender +//@description Describes a location on planet Earth +//@latitude Latitude of the location in degrees; as defined by the sender +//@longitude Longitude of the location, in degrees; as defined by the sender //@horizontal_accuracy The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown location latitude:double longitude:double horizontal_accuracy:double = Location; -//@description Describes a venue @location Venue location; as defined by the sender @title Venue name; as defined by the sender @address Venue address; as defined by the sender @provider Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported -//@id Identifier of the venue in the provider database; as defined by the sender @type Type of the venue in the provider database; as defined by the sender +//@description Describes a venue +//@location Venue location; as defined by the sender +//@title Venue name; as defined by the sender +//@address Venue address; as defined by the sender +//@provider Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported +//@id Identifier of the venue in the provider database; as defined by the sender +//@type Type of the venue in the provider database; as defined by the sender venue location:location title:string address:string provider:string id:string type:string = Venue; -//@description Describes a game @id Game ID @short_name Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name} @title Game title @text Game text, usually containing scoreboards for a game -//@param_description Game description @photo Game photo @animation Game animation; may be null +//@description Describes a game. Use getInternalLink with internalLinkTypeGame to share the game +//@id Unique game identifier +//@short_name Game short name +//@title Game title +//@text Game text, usually containing scoreboards for a game +//@param_description Game description +//@photo Game photo +//@animation Game animation; may be null game id:int64 short_name:string title:string text:formattedText description:string photo:photo animation:animation = Game; -//@description Describes a poll @id Unique poll identifier @question Poll question; 1-300 characters @options List of poll answer options -//@total_voter_count Total number of voters, participating in the poll @recent_voter_user_ids User identifiers of recent voters, if the poll is non-anonymous -//@is_anonymous True, if the poll is anonymous @type Type of the poll -//@open_period Amount of time the poll will be active after creation, in seconds @close_date Point in time (Unix timestamp) when the poll will automatically be closed @is_closed True, if the poll is closed -poll id:int64 question:string options:vector total_voter_count:int32 recent_voter_user_ids:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; +//@description Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App +//@short_name Web App short name +//@title Web App title +//@param_description Web App description +//@photo Web App photo +//@animation Web App animation; may be null +webApp short_name:string title:string description:string photo:photo animation:animation = WebApp; + +//@description Describes a poll +//@id Unique poll identifier +//@question Poll question; 1-300 characters +//@options List of poll answer options +//@total_voter_count Total number of voters, participating in the poll +//@recent_voter_ids Identifiers of recent voters, if the poll is non-anonymous +//@is_anonymous True, if the poll is anonymous +//@type Type of the poll +//@open_period Amount of time the poll will be active after creation, in seconds +//@close_date Point in time (Unix timestamp) when the poll will automatically be closed +//@is_closed True, if the poll is closed +poll id:int64 question:string options:vector total_voter_count:int32 recent_voter_ids:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; -//@description Describes a user profile photo @id Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos +//@description Describes a chat background +//@id Unique background identifier +//@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 filled backgrounds +//@type Type of the background +background id:int64 is_default:Bool is_dark:Bool name:string document:document type:BackgroundType = Background; + +//@description Contains a list of backgrounds @backgrounds A list of backgrounds +backgrounds backgrounds:vector = Backgrounds; + +//@description Describes a background set for a specific chat @background The background @dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 +chatBackground background:background dark_theme_dimming:int32 = ChatBackground; + + +//@description Describes a user profile photo +//@id Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos //@small A small (160x160) user profile photo. The file can be downloaded only before the photo is changed //@big A big (640x640) user profile photo. The file can be downloaded only before the photo is changed //@minithumbnail User profile photo minithumbnail; may be null //@has_animation True, if the photo has animated variant -profilePhoto id:int64 small:file big:file minithumbnail:minithumbnail has_animation:Bool = ProfilePhoto; +//@is_personal True, if the photo is visible only for the current user +profilePhoto id:int64 small:file big:file minithumbnail:minithumbnail has_animation:Bool is_personal:Bool = ProfilePhoto; //@description Contains basic information about the photo of a chat //@small A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed //@big A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed //@minithumbnail Chat photo minithumbnail; may be null //@has_animation True, if the photo has animated variant -chatPhotoInfo small:file big:file minithumbnail:minithumbnail has_animation:Bool = ChatPhotoInfo; +//@is_personal True, if the photo is visible only for the current user +chatPhotoInfo small:file big:file minithumbnail:minithumbnail has_animation:Bool is_personal:Bool = ChatPhotoInfo; //@class UserType @description Represents the type of a user. The following types are possible: regular users, deleted users and bots @@ -348,10 +548,15 @@ userTypeRegular = UserType; //@description A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user userTypeDeleted = UserType; -//@description A bot (see https://core.telegram.org/bots) @can_join_groups True, if the bot can be invited to basic group and supergroup chats +//@description A bot (see https://core.telegram.org/bots) +//@can_be_edited True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription +//@can_join_groups True, if the bot can be invited to basic group and supergroup chats //@can_read_all_group_messages True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages -//@is_inline True, if the bot supports inline queries @inline_query_placeholder Placeholder for inline queries (displayed on the application input field) @need_location True, if the location of the user is expected to be sent with every inline query to this bot -userTypeBot can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool = UserType; +//@is_inline True, if the bot supports inline queries +//@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) +//@need_location True, if the location of the user is expected to be sent with every inline query to this bot +//@can_be_added_to_attachment_menu True, if the bot can be added to attachment or side menu +userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_be_added_to_attachment_menu:Bool = UserType; //@description No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type userTypeUnknown = UserType; @@ -363,11 +568,31 @@ botCommand command:string description:string = BotCommand; //@description Contains a list of bot commands @bot_user_id Bot's user identifier @commands List of bot commands botCommands bot_user_id:int53 commands:vector = BotCommands; +//@description Describes a button to be shown instead of bot commands menu button @text Text of the button @url URL to be passed to openWebApp +botMenuButton text:string url:string = BotMenuButton; + //@description Represents a location to which a chat is connected @location The location @address Location address; 1-64 characters, as defined by the chat owner chatLocation location:location address:string = ChatLocation; +//@class ChatPhotoStickerType @description Describes type of a sticker, which was used to create a chat photo + +//@description Information about the sticker, which was used to create the chat photo +//@sticker_set_id Sticker set identifier +//@sticker_id Identifier of the sticker in the set +chatPhotoStickerTypeRegularOrMask sticker_set_id:int64 sticker_id:int64 = ChatPhotoStickerType; + +//@description Information about the custom emoji, which was used to create the chat photo +//@custom_emoji_id Identifier of the custom emoji +chatPhotoStickerTypeCustomEmoji custom_emoji_id:int64 = ChatPhotoStickerType; + + +//@description Information about the sticker, which was used to create the chat photo. The sticker is shown at the center of the photo and occupies at most 67% of it +//@type Type of the sticker +//@background_fill The fill to be used as background for the sticker; rotation angle in backgroundFillGradient isn't supported +chatPhotoSticker type:ChatPhotoStickerType background_fill:BackgroundFill = ChatPhotoSticker; + //@description Animated variant of a chat photo in MPEG4 format //@length Animation width and height //@file Information about the animation file @@ -380,8 +605,10 @@ animatedChatPhoto length:int32 file:file main_frame_timestamp:double = AnimatedC //@added_date Point in time (Unix timestamp) when the photo has been added //@minithumbnail Photo minithumbnail; may be null //@sizes Available variants of the photo in JPEG format, in different size -//@animation Animated variant of the photo in MPEG4 format; may be null -chatPhoto id:int64 added_date:int32 minithumbnail:minithumbnail sizes:vector animation:animatedChatPhoto = ChatPhoto; +//@animation A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null +//@small_animation A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available +//@sticker Sticker-based version of the chat photo; may be null +chatPhoto id:int64 added_date:int32 minithumbnail:minithumbnail sizes:vector animation:animatedChatPhoto small_animation:animatedChatPhoto sticker:chatPhotoSticker = ChatPhoto; //@description Contains a list of chat or user profile photos @total_count Total number of photos @photos List of photos chatPhotos total_count:int32 photos:vector = ChatPhotos; @@ -395,48 +622,216 @@ inputChatPhotoPrevious chat_photo_id:int64 = InputChatPhoto; //@description A static photo in JPEG format @photo Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed inputChatPhotoStatic photo:InputFile = InputChatPhoto; -//@description An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 800 and be at most 2MB in size +//@description An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 1280 and be at most 2MB in size //@animation Animation to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed //@main_frame_timestamp Timestamp of the frame, which will be used as static chat photo inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputChatPhoto; +//@description A sticker on a custom background @sticker Information about the sticker +inputChatPhotoSticker sticker:chatPhotoSticker = InputChatPhoto; + + +//@description Describes actions that a user is allowed to take in a chat +//@can_send_basic_messages True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues +//@can_send_audios True, if the user can send music files +//@can_send_documents True, if the user can send documents +//@can_send_photos True, if the user can send photos +//@can_send_videos True, if the user can send videos +//@can_send_video_notes True, if the user can send video notes +//@can_send_voice_notes True, if the user can send voice notes +//@can_send_polls True, if the user can send polls +//@can_send_other_messages True, if the user can send animations, games, stickers, and dice and use inline bots +//@can_add_web_page_previews True, if the user may add a web page preview to their messages +//@can_change_info True, if the user can change the chat title, photo, and other settings +//@can_invite_users True, if the user can invite new users to the chat +//@can_pin_messages True, if the user can pin messages +//@can_manage_topics True, if the user can manage topics +chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_documents:Bool can_send_photos:Bool can_send_videos:Bool can_send_video_notes:Bool can_send_voice_notes:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool can_manage_topics:Bool = ChatPermissions; + +//@description Describes rights of the administrator +//@can_manage_chat True, if the administrator can get chat event log, get chat boosts in channels, get channel members, report supergroup spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only +//@can_change_info True, if the administrator can change the chat title, photo, and other settings +//@can_post_messages True, if the administrator can create channel posts or view channel statistics; applicable to channels only +//@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only +//@can_delete_messages True, if the administrator can delete messages of other users +//@can_invite_users True, if the administrator can invite new users to the chat +//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels +//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only +//@can_manage_topics True, if the administrator can manage topics; applicable to forum supergroups only +//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them +//@can_manage_video_chats True, if the administrator can manage video chats +//@can_post_stories True, if the administrator can create new channel stories, or edit and delete posted stories; applicable to channels only +//@can_edit_stories True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to channels only +//@can_delete_stories True, if the administrator can delete stories posted by other users; applicable to channels only +//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only +chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool can_post_stories:Bool can_edit_stories:Bool can_delete_stories:Bool is_anonymous:Bool = ChatAdministratorRights; + + +//@description Describes an option for buying Telegram Premium to a user +//@currency ISO 4217 currency code for Telegram Premium subscription payment +//@amount The amount to pay, in the smallest units of the currency +//@discount_percentage The discount associated with this option, as a percentage +//@month_count Number of month the Telegram Premium subscription will be active +//@store_product_id Identifier of the store product associated with the option +//@payment_link An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available +premiumPaymentOption currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumPaymentOption; + +//@description Describes an option for buying or upgrading Telegram Premium for self +//@payment_option Information about the payment option +//@is_current True, if this is the currently used Telegram Premium subscription option +//@is_upgrade True, if the payment option can be used to upgrade the existing Telegram Premium subscription +//@last_transaction_id Identifier of the last in-store transaction for the currently used option +premiumStatePaymentOption payment_option:premiumPaymentOption is_current:Bool is_upgrade:Bool last_transaction_id:string = PremiumStatePaymentOption; + +//@description Describes an option for creating Telegram Premium gift codes +//@currency ISO 4217 currency code for Telegram Premium gift code payment +//@amount The amount to pay, in the smallest units of the currency +//@user_count Number of users which will be able to activate the gift codes +//@month_count Number of month the Telegram Premium subscription will be active +//@store_product_id Identifier of the store product associated with the option; may be empty if none +//@store_product_quantity Number of times the store product must be paid +premiumGiftCodePaymentOption currency:string amount:int53 user_count:int32 month_count:int32 store_product_id:string store_product_quantity:int32 = PremiumGiftCodePaymentOption; + +//@description Contains a list of options for creating Telegram Premium gift codes @options The list of options +premiumGiftCodePaymentOptions options:vector = PremiumGiftCodePaymentOptions; + +//@description Contains information about a Telegram Premium gift code +//@creator_id Identifier of a chat or a user that created the gift code +//@creation_date Point in time (Unix timestamp) when the code was created +//@is_from_giveaway True, if the gift code was created for a giveaway +//@giveaway_message_id Identifier of the corresponding giveaway message; can be 0 or an identifier of a deleted message +//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@user_id Identifier of a user for which the code was created; 0 if none +//@use_date Point in time (Unix timestamp) when the code was activated; 0 if none +premiumGiftCodeInfo creator_id:MessageSender creation_date:int32 is_from_giveaway:Bool giveaway_message_id:int53 month_count:int32 user_id:int53 use_date:int32 = PremiumGiftCodeInfo; + + +//@class PremiumGiveawayParticipantStatus @description Contains information about status of a user in a Telegram Premium giveaway + +//@description The user is eligible for the giveaway +premiumGiveawayParticipantStatusEligible = PremiumGiveawayParticipantStatus; + +//@description The user participates in the giveaway +premiumGiveawayParticipantStatusParticipating = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they have already been member of the chat +//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat +premiumGiveawayParticipantStatusAlreadyWasMember joined_chat_date:int32 = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway @chat_id Identifier of the chat administered by the user +premiumGiveawayParticipantStatusAdministrator chat_id:int53 = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they phone number is from a disallowed country @user_country_code A two-letter ISO 3166-1 alpha-2 country code of the user's country +premiumGiveawayParticipantStatusDisallowedCountry user_country_code:string = PremiumGiveawayParticipantStatus; + + +//@class PremiumGiveawayInfo @description Contains information about Telegram Premium giveaway + +//@description Describes an ongoing giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created +//@status Status of the current user in the giveaway +//@is_ended True, if the giveaway has ended and results are being prepared +premiumGiveawayInfoOngoing creation_date:int32 status:PremiumGiveawayParticipantStatus is_ended:Bool = PremiumGiveawayInfo; + +//@description Describes a completed giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created +//@actual_winners_selection_date Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway +//@was_refunded True, if the giveaway was canceled and was fully refunded +//@winner_count Number of winners in the giveaway +//@activation_count Number of winners, which activated their gift codes +//@gift_code Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway +premiumGiveawayInfoCompleted creation_date:int32 actual_winners_selection_date:int32 was_refunded:Bool winner_count:int32 activation_count:int32 gift_code:string = PremiumGiveawayInfo; + + +//@description Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews +//@id Accent color identifier +//@built_in_accent_color_id Identifier of a built-in color to use in places, where only one color is needed; 0-6 +//@light_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes +//@dark_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes +accentColor id:int32 built_in_accent_color_id:int32 light_theme_colors:vector dark_theme_colors:vector = AccentColor; + +//@description Describes a custom emoji to be shown instead of the Telegram Premium badge +//@custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format +//@expiration_date Point in time (Unix timestamp) when the status will expire; 0 if never +emojiStatus custom_emoji_id:int64 expiration_date:int32 = EmojiStatus; + +//@description Contains a list of custom emoji identifiers, which can be set as emoji statuses @custom_emoji_ids The list of custom emoji identifiers +emojiStatuses custom_emoji_ids:vector = EmojiStatuses; + + +//@description Describes usernames assigned to a user, a supergroup, or a channel +//@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames +//@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive +//@editable_username The active username, which can be changed with setUsername or setSupergroupUsername +usernames active_usernames:vector disabled_usernames:vector editable_username:string = Usernames; + //@description Represents a user //@id User identifier //@first_name First name of the user //@last_name Last name of the user -//@username Username of the user +//@usernames Usernames of the user; may be null //@phone_number Phone number of the user //@status Current online status of the user //@profile_photo Profile photo of the user; may be null +//@accent_color_id Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none. For Telegram Premium users only +//@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only //@is_contact The user is a contact of the current user //@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user +//@is_close_friend The user is a close friend of the current user; implies that the user is a contact //@is_verified True, if the user is verified +//@is_premium True, if the user is a Telegram Premium user //@is_support True, if the user is Telegram support account //@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted //@is_scam True, if many users reported this user as a scam //@is_fake True, if many users reported this user as a fake account -//@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser +//@has_active_stories True, if the user has non-expired stories available to the current user +//@has_unread_active_stories True, if the user has unread non-expired stories available to the current user +//@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots -user id:int53 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string = User; +//@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots +user id:int53 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; + + +//@description Contains information about a bot +//@short_description The text that is shown on the bot's profile page and is sent together with the link when users share the bot +//@param_description The text shown in the chat with the bot if the chat is empty +//@photo Photo shown in the chat with the bot if the chat is empty; may be null +//@animation Animation shown in the chat with the bot if the chat is empty; may be null +//@menu_button Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown +//@commands List of the bot commands +//@default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null +//@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null +//@edit_commands_link The internal link, which can be used to edit bot commands; may be null +//@edit_description_link The internal link, which can be used to edit bot description; may be null +//@edit_description_media_link The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null +//@edit_settings_link The internal link, which can be used to edit bot settings; may be null +botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; //@description Contains full information about a user -//@photo User profile photo; may be null -//@is_blocked True, if the user is blocked by the current user +//@personal_photo User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. +//-If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos +//@photo User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. +//-If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo +//@public_photo User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. +//-If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos +//@block_list Block list to which the user is added; may be null if none //@can_be_called True, if the user can be called //@supports_video_calls True, if a video call can be created with the user //@has_private_calls True, if the user can't be called due to their privacy settings //@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings +//@has_restricted_voice_and_video_note_messages True, if voice and video notes can't be sent or forwarded to the user +//@has_pinned_stories True, if the user has pinned stories //@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used -//@bio A short user bio -//@share_text For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot -//@param_description For bots, the text shown in the chat with the bot if the chat is empty +//@bio A short user bio; may be null for bots +//@premium_gift_options The list of available options for gifting Telegram Premium to the user //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user -//@commands For bots, list of the bot commands -userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool need_phone_number_privacy_exception:Bool bio:string share_text:string description:string group_in_common_count:int32 commands:vector = UserFullInfo; +//@bot_info For bots, information about the bot; may be null if the user isn't a bot +userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_pinned_stories:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector group_in_common_count:int32 bot_info:botInfo = UserFullInfo; -//@description Represents a list of users @total_count Approximate total count of users found @user_ids A list of user identifiers +//@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers users total_count:int32 user_ids:vector = Users; @@ -447,18 +842,6 @@ chatAdministrator user_id:int53 custom_title:string is_owner:Bool = ChatAdminist chatAdministrators administrators:vector = ChatAdministrators; -//@description Describes actions that a user is allowed to take in a chat -//@can_send_messages True, if the user can send text messages, contacts, locations, and venues -//@can_send_media_messages True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions -//@can_send_polls True, if the user can send polls. Implies can_send_messages permissions -//@can_send_other_messages True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions -//@can_add_web_page_previews True, if the user may add a web page preview to their messages. Implies can_send_messages permissions -//@can_change_info True, if the user can change the chat title, photo, and other settings -//@can_invite_users True, if the user can invite new users to the chat -//@can_pin_messages True, if the user can pin messages -chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool = ChatPermissions; - - //@class ChatMemberStatus @description Provides information about the status of a member in a chat //@description The user is the owner of the chat and has all the administrator privileges @@ -467,21 +850,12 @@ chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_pol //@is_member True, if the user is a member of the chat chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = ChatMemberStatus; -//@description The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges +//@description The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. +//-In supergroups and channels, there are more detailed options for administrator privileges //@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only //@can_be_edited True, if the current user can edit the administrator privileges for the called user -//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only -//@can_change_info True, if the administrator can change the chat title, photo, and other settings -//@can_post_messages True, if the administrator can create channel posts; applicable to channels only -//@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only -//@can_delete_messages True, if the administrator can delete messages of other users -//@can_invite_users True, if the administrator can invite new users to the chat -//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels -//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only -//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them -//@can_manage_video_chats True, if the administrator can manage video chats -//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only -chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatMemberStatus; +//@rights Rights of the administrator +chatMemberStatusAdministrator custom_title:string can_be_edited:Bool rights:chatAdministratorRights = ChatMemberStatus; //@description The user is a member of the chat, without any additional privileges or restrictions chatMemberStatusMember = ChatMemberStatus; @@ -503,11 +877,11 @@ chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus; //@description Describes a user or a chat as a member of another chat //@member_id Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels //@inviter_user_id Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown -//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat +//@joined_chat_date Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat //@status Status of the member in the chat chatMember member_id:MessageSender inviter_user_id:int53 joined_chat_date:int32 status:ChatMemberStatus = ChatMember; -//@description Contains a list of chat members @total_count Approximate total count of chat members found @members A list of chat members +//@description Contains a list of chat members @total_count Approximate total number of chat members found @members A list of chat members chatMembers total_count:int32 members:vector = ChatMembers; @@ -577,7 +951,7 @@ supergroupMembersFilterBots = SupergroupMembersFilter; //@is_revoked True, if the link was revoked chatInviteLink invite_link:string name:string creator_user_id:int53 date:int32 edit_date:int32 expiration_date:int32 member_limit:int32 member_count:int32 pending_join_request_count:int32 creates_join_request:Bool is_primary:Bool is_revoked:Bool = ChatInviteLink; -//@description Contains a list of chat invite links @total_count Approximate total count of chat invite links found @invite_links List of invite links +//@description Contains a list of chat invite links @total_count Approximate total number of chat invite links found @invite_links List of invite links chatInviteLinks total_count:int32 invite_links:vector = ChatInviteLinks; //@description Describes a chat administrator with a number of active and revoked chat invite links @@ -589,29 +963,51 @@ chatInviteLinkCount user_id:int53 invite_link_count:int32 revoked_invite_link_co //@description Contains a list of chat invite link counts @invite_link_counts List of invite link counts chatInviteLinkCounts invite_link_counts:vector = ChatInviteLinkCounts; -//@description Describes a chat member joined a chat via an invite link @user_id User identifier @joined_chat_date Point in time (Unix timestamp) when the user joined the chat @approver_user_id User identifier of the chat administrator, approved user join request -chatInviteLinkMember user_id:int53 joined_chat_date:int32 approver_user_id:int53 = ChatInviteLinkMember; +//@description Describes a chat member joined a chat via an invite link +//@user_id User identifier +//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat +//@via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder +//@approver_user_id User identifier of the chat administrator, approved user join request +chatInviteLinkMember user_id:int53 joined_chat_date:int32 via_chat_folder_invite_link:Bool approver_user_id:int53 = ChatInviteLinkMember; -//@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total count of chat members found @members List of chat members, joined a chat via an invite link +//@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total number of chat members found @members List of chat members, joined a chat via an invite link chatInviteLinkMembers total_count:int32 members:vector = ChatInviteLinkMembers; + +//@class InviteLinkChatType @description Describes the type of a chat to which points an invite link + +//@description The link is an invite link for a basic group +inviteLinkChatTypeBasicGroup = InviteLinkChatType; + +//@description The link is an invite link for a supergroup +inviteLinkChatTypeSupergroup = InviteLinkChatType; + +//@description The link is an invite link for a channel +inviteLinkChatTypeChannel = InviteLinkChatType; + + //@description Contains information about a chat invite link //@chat_id Chat identifier of the invite link; 0 if the user has no access to the chat before joining //@accessible_for If non-zero, the amount of time for which read access to the chat will remain available, in seconds //@type Type of the chat //@title Title of the chat //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for chat title and background of chat photo //@param_description Chat description //@member_count Number of members in the chat //@member_user_ids User identifiers of some chat members that may be known to the current user //@creates_join_request True, if the link only creates join request //@is_public True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup -chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string photo:chatPhotoInfo description:string member_count:int32 member_user_ids:vector creates_join_request:Bool is_public:Bool = ChatInviteLinkInfo; +//@is_verified True, if the chat is verified +//@is_scam True, if many users reported this chat as a scam +//@is_fake True, if many users reported this chat as a fake account +chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo; + //@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user chatJoinRequest user_id:int53 date:int32 bio:string = ChatJoinRequest; -//@description Contains a list of requests to join a chat @total_count Approximate total count of requests found @requests List of the requests +//@description Contains a list of requests to join a chat @total_count Approximate total number of requests found @requests List of the requests chatJoinRequests total_count:int32 requests:vector = ChatJoinRequests; //@description Contains information about pending join requests for a chat @total_count Total number of pending join requests @user_ids Identifiers of at most 3 users sent the newest pending join requests @@ -627,35 +1023,45 @@ chatJoinRequestsInfo total_count:int32 user_ids:vector = ChatJoinRequests basicGroup id:int53 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int53 = BasicGroup; //@description Contains full information about a basic group -//@photo Chat photo; may be null +//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo //@param_description Group description. Updated only after the basic group is opened //@creator_user_id User identifier of the creator of the group; 0 if unknown //@members Group members +//@can_hide_members True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup +//@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup //@invite_link Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened //@bot_commands List of commands of bots in the group -basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 members:vector invite_link:chatInviteLink bot_commands:vector = BasicGroupFullInfo; +basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 members:vector can_hide_members:Bool can_toggle_aggressive_anti_spam:Bool invite_link:chatInviteLink bot_commands:vector = BasicGroupFullInfo; -//@description Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. Unlike supergroups, channels can have an unlimited number of subscribers +//@description Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: +//-only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. +//-Unlike supergroups, channels can have an unlimited number of subscribers //@id Supergroup or channel identifier -//@username Username of the supergroup or channel; empty for private supergroups or channels +//@usernames Usernames of the supergroup or channel; may be null //@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member -//@status Status of the current user in the supergroup or channel; custom title will be always empty -//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules +//@status Status of the current user in the supergroup or channel; custom title will always be empty +//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received +//-through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, getUserPrivacySettingRules, or in chatFolderInviteLinkInfo.missing_chat_ids //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup //@sign_messages True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels +//@join_to_send_messages True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups +//@join_by_request True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat //@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup //@is_channel True, if the supergroup is a channel //@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members +//@is_forum True, if the supergroup must be shown as a forum by default //@is_verified True, if the supergroup or channel is verified //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted //@is_scam True, if many users reported this supergroup or channel as a scam //@is_fake True, if many users reported this supergroup or channel as a fake account -supergroup id:int53 username:string date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup; +//@has_active_stories True, if the channel has non-expired stories available to the current user +//@has_unread_active_stories True, if the channel has unread non-expired stories available to the current user +supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; //@description Contains full information about a supergroup or channel -//@photo Chat photo; may be null +//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo //@param_description Supergroup or channel description //@member_count Number of members in the supergroup or channel; 0 if unknown //@administrator_count Number of privileged users in the supergroup or channel; 0 if unknown @@ -664,19 +1070,24 @@ supergroup id:int53 username:string date:int32 status:ChatMemberStatus member_co //@linked_chat_id Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown //@slow_mode_delay Delay between consecutive sent messages for non-administrator supergroup members, in seconds //@slow_mode_delay_expires_in Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero -//@can_get_members True, if members of the chat can be retrieved -//@can_set_username True, if the chat username can be changed +//@can_get_members True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers +//@has_hidden_members True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers +//@can_hide_members True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators //@can_set_sticker_set True, if the supergroup sticker set can be changed //@can_set_location True, if the supergroup location can be changed //@can_get_statistics True, if the supergroup or channel statistics are available -//@is_all_history_available True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators +//@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup +//@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, +//-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators +//@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators +//@has_pinned_stories True, if the channel has pinned stories //@sticker_set_id Identifier of the supergroup sticker set; 0 if none -//@location Location to which the supergroup is connected; may be null -//@invite_link Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only +//@location Location to which the supergroup is connected; may be null if none +//@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool can_set_username:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool is_all_history_available:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool has_aggressive_anti_spam_enabled:Bool has_pinned_stories:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -695,10 +1106,11 @@ secretChatStateClosed = SecretChatState; //@id Secret chat identifier //@user_id Identifier of the chat partner //@state State of the secret chat -//@is_outbound True, if the chat was created by the current user; otherwise false +//@is_outbound True, if the chat was created by the current user; false otherwise //@key_hash Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. //-The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers -//@layer Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101 +//@layer Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101, +//-files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144 secretChat id:int32 user_id:int53 state:SecretChatState is_outbound:Bool key_hash:bytes layer:int32 = SecretChat; @@ -711,40 +1123,65 @@ messageSenderUser user_id:int53 = MessageSender; messageSenderChat chat_id:int53 = MessageSender; -//@description Represents a list of message senders @total_count Approximate total count of messages senders found @senders List of message senders +//@description Represents a list of message senders @total_count Approximate total number of messages senders found @senders List of message senders messageSenders total_count:int32 senders:vector = MessageSenders; -//@class MessageForwardOrigin @description Contains information about the origin of a forwarded message +//@description Represents a message sender, which can be used to send messages in a chat @sender Available message senders @needs_premium True, if Telegram Premium is needed to use the message sender +chatMessageSender sender:MessageSender needs_premium:Bool = ChatMessageSender; + +//@description Represents a list of message senders, which can be used to send messages in a chat @senders List of available message senders +chatMessageSenders senders:vector = ChatMessageSenders; + + +//@description Represents a viewer of a message @user_id User identifier of the viewer @view_date Approximate point in time (Unix timestamp) when the message was viewed +messageViewer user_id:int53 view_date:int32 = MessageViewer; + +//@description Represents a list of message viewers @viewers List of message viewers +messageViewers viewers:vector = MessageViewers; + + +//@class MessageOrigin @description Contains information about the origin of a message //@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message -messageForwardOriginUser sender_user_id:int53 = MessageForwardOrigin; +messageOriginUser sender_user_id:int53 = MessageOrigin; + +//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender +messageOriginHiddenUser sender_name:string = MessageOrigin; //@description The message was originally sent on behalf of a chat //@sender_chat_id Identifier of the chat that originally sent the message //@author_signature For messages originally sent by an anonymous chat administrator, original message author signature -messageForwardOriginChat sender_chat_id:int53 author_signature:string = MessageForwardOrigin; - -//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender -messageForwardOriginHiddenUser sender_name:string = MessageForwardOrigin; +messageOriginChat sender_chat_id:int53 author_signature:string = MessageOrigin; //@description The message was originally a post in a channel -//@chat_id Identifier of the chat from which the message was originally forwarded +//@chat_id Identifier of the channel chat to which the message was originally sent //@message_id Message identifier of the original message //@author_signature Original post author signature -messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin; +messageOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageOrigin; -//@description The message was imported from an exported message history @sender_name Name of the sender -messageForwardOriginMessageImport sender_name:string = MessageForwardOrigin; + +//@class ReactionType @description Describes type of message reaction + +//@description A reaction with an emoji @emoji Text representation of the reaction +reactionTypeEmoji emoji:string = ReactionType; + +//@description A reaction with a custom emoji @custom_emoji_id Unique identifier of the custom emoji +reactionTypeCustomEmoji custom_emoji_id:int64 = ReactionType; //@description Contains information about a forwarded message -//@origin Origin of a forwarded message +//@origin Origin of the forwarded message //@date Point in time (Unix timestamp) when the message was originally sent //@public_service_announcement_type The type of a public service announcement for the forwarded message //@from_chat_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown //@from_message_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown -messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; +messageForwardInfo origin:MessageOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; + +//@description Contains information about a message created with importMessages +//@sender_name Name of the original sender +//@date Point in time (Unix timestamp) when the message was originally sent +messageImportInfo sender_name:string date:int32 = MessageImportInfo; //@description Contains information about replies to a message //@reply_count Number of times the message was directly or indirectly replied @@ -754,72 +1191,131 @@ messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announc //@last_message_id Identifier of the last reply to the message messageReplyInfo reply_count:int32 recent_replier_ids:vector last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 last_message_id:int53 = MessageReplyInfo; +//@description Contains information about a reaction to a message +//@type Type of the reaction +//@total_count Number of times the reaction was added +//@is_chosen True, if the reaction is chosen by the current user +//@used_sender_id Identifier of the message sender used by the current user to add the reaction; null if unknown or the reaction isn't chosen +//@recent_sender_ids Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats +messageReaction type:ReactionType total_count:int32 is_chosen:Bool used_sender_id:MessageSender recent_sender_ids:vector = MessageReaction; + + //@description Contains information about interactions with a message //@view_count Number of times the message was viewed //@forward_count Number of times the message was forwarded //@reply_info Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself -messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo = MessageInteractionInfo; +//@reactions The list of reactions added to the message +messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo reactions:vector = MessageInteractionInfo; + +//@description Contains information about an unread reaction to a message +//@type Type of the reaction +//@sender_id Identifier of the sender, added the reaction +//@is_big True, if the reaction was added with a big animation +unreadReaction type:ReactionType sender_id:MessageSender is_big:Bool = UnreadReaction; //@class MessageSendingState @description Contains information about the sending state of the message -//@description The message is being sent now, but has not yet been delivered to the server -messageSendingStatePending = MessageSendingState; +//@description The message is being sent now, but has not yet been delivered to the server @sending_id Non-persistent message sending identifier, specified by the application +messageSendingStatePending sending_id:int32 = MessageSendingState; -//@description The message failed to be sent @error_code An error code; 0 if unknown @error_message Error message +//@description The message failed to be sent +//@error The cause of the message sending failure //@can_retry True, if the message can be re-sent //@need_another_sender True, if the message can be re-sent only on behalf of a different sender +//@need_another_reply_quote True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message +//@need_drop_reply True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages //@retry_after Time left before the message can be re-sent, in seconds. No update is sent when this field changes -messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool need_another_sender:Bool retry_after:double = MessageSendingState; +messageSendingStateFailed error:error can_retry:Bool need_another_sender:Bool need_another_reply_quote:Bool need_drop_reply:Bool retry_after:double = MessageSendingState; + + +//@class MessageReplyTo @description Contains information about the message or the story a message is replying to + +//@description Describes a message replied by a given message +//@chat_id The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat +//@message_id The identifier of the message; may be 0 if the replied message is in unknown chat +//@quote Manually or automatically chosen quote from the replied message; may be null if none. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the quote +//@is_quote_manual True, if the quote was manually chosen by the message sender +//@origin Information about origin of the message if the message was replied from another chat; may be null for messages from the same chat +//@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was replied from another chat; 0 for messages from the same chat +//@content Media content of the message if the message was replied from another chat; may be null for messages from the same chat and messages without media. +//-Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, +//-messagePhoto, messagePoll, messagePremiumGiveaway, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote +messageReplyToMessage chat_id:int53 message_id:int53 quote:formattedText is_quote_manual:Bool origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; + +//@description Describes a story replied by a given message @story_sender_chat_id The identifier of the sender of the story @story_id The identifier of the story +messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; + + +//@class InputMessageReplyTo @description Contains information about the message or the story to be replied + +//@description Describes a message to be replied +//@chat_id The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat only if message.can_be_replied_in_another_chat +//@message_id The identifier of the message to be replied in the same or the specified chat +//@quote Manually chosen quote from the message to be replied; pass null if none; 0-getOption("message_reply_quote_length_max") characters. Must always be null for replies in secret chats. +//-Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote +inputMessageReplyToMessage chat_id:int53 message_id:int53 quote:formattedText = InputMessageReplyTo; + +//@description Describes a story to be replied @story_sender_chat_id The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat @story_id The identifier of the story +inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessageReplyTo; //@description Describes a message //@id Message identifier; unique for the chat to which the message belongs //@sender_id Identifier of the sender of the message //@chat_id Chat identifier -//@sending_state The sending state of the message; may be null -//@scheduling_state The scheduling state of the message; may be null +//@sending_state The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent +//@scheduling_state The scheduling state of the message; may be null if the message isn't scheduled //@is_outgoing True, if the message is outgoing //@is_pinned True, if the message is pinned //@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application //@can_be_forwarded True, if the message can be forwarded +//@can_be_replied_in_another_chat True, if the message can be replied in another chat //@can_be_saved True, if content of the message can be saved locally or copied //@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it //@can_be_deleted_for_all_users True, if the message can be deleted for all users -//@can_get_statistics True, if the message statistics are available -//@can_get_message_thread True, if the message thread info is available +//@can_get_added_reactions True, if the list of added reactions is available through getMessageAddedReactions +//@can_get_statistics True, if the message statistics are available through getMessageStatistics +//@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory //@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers -//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description +//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink +//@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions //@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message //@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts +//@is_topic_message True, if the message is a forum topic message //@contains_unread_mention True, if the message contains an unread mention for the current user //@date Point in time (Unix timestamp) when the message was sent //@edit_date Point in time (Unix timestamp) when the message was last edited -//@forward_info Information about the initial message sender; may be null -//@interaction_info Information about interactions with the message; may be null -//@reply_in_chat_id If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id -//@reply_to_message_id If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message +//@forward_info Information about the initial message sender; may be null if none or unknown +//@import_info Information about the initial message for messages created with importMessages; may be null if the message isn't imported +//@interaction_info Information about interactions with the message; may be null if none +//@unread_reactions Information about unread reactions added to the message +//@reply_to Information about the message or the story this message is replying to; may be null if none //@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs -//@ttl For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires -//@ttl_expires_in Time left before the message expires, in seconds. If the TTL timer isn't started yet, equals to the value of the ttl field +//@self_destruct_type The message's self-destruct type; may be null if none +//@self_destruct_in Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet +//@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never //@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent //@author_signature For channel posts and anonymous group messages, optional author signature //@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message -//@reply_markup Reply markup for the message; may be null -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +//@reply_markup Reply markup for the message; may be null if none +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_to:MessageReplyTo message_thread_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; -//@description Contains a list of messages @total_count Approximate total count of messages found @messages List of messages; messages may be null +//@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; -//@description Contains a list of messages found by a search @total_count Approximate total count of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results +//@description Contains a list of messages found by a search @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results foundMessages total_count:int32 messages:vector next_offset:string = FoundMessages; +//@description Contains a list of messages found by a search in a given chat @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_from_message_id The offset for the next request. If 0, there are no more results +foundChatMessages total_count:int32 messages:vector next_from_message_id:int53 = FoundChatMessages; + //@description Contains information about a message in a specific position @position 0-based message position in the full list of suitable messages @message_id Message identifier @date Point in time (Unix timestamp) when the message was sent messagePosition position:int32 message_id:int53 date:int32 = MessagePosition; -//@description Contains a list of message positions @total_count Total count of messages found @positions List of message positions +//@description Contains a list of message positions @total_count Total number of messages found @positions List of message positions messagePositions total_count:int32 positions:vector = MessagePositions; //@description Contains information about found messages sent on a specific day @total_count Total number of found messages sent on the day @message First message sent on the day @@ -829,12 +1325,91 @@ messageCalendarDay total_count:int32 message:message = MessageCalendarDay; messageCalendar total_count:int32 days:vector = MessageCalendar; +//@class MessageSource @description Describes source of a message + +//@description The message is from a chat history +messageSourceChatHistory = MessageSource; + +//@description The message is from a message thread history +messageSourceMessageThreadHistory = MessageSource; + +//@description The message is from a forum topic history +messageSourceForumTopicHistory = MessageSource; + +//@description The message is from chat, message thread or forum topic history preview +messageSourceHistoryPreview = MessageSource; + +//@description The message is from a chat list or a forum topic list +messageSourceChatList = MessageSource; + +//@description The message is from search results, including file downloads, local file list, outgoing document messages, calendar +messageSourceSearch = MessageSource; + +//@description The message is from a chat event log +messageSourceChatEventLog = MessageSource; + +//@description The message is from a notification +messageSourceNotification = MessageSource; + +//@description The message was screenshotted; the source must be used only if the message content was visible during the screenshot +messageSourceScreenshot = MessageSource; + +//@description The message is from some other source +messageSourceOther = MessageSource; + + +//@class MessageSponsorType @description Describes type of a message sponsor + +//@description The sponsor is a bot @bot_user_id User identifier of the bot @link An internal link to be opened when the sponsored message is clicked +messageSponsorTypeBot bot_user_id:int53 link:InternalLinkType = MessageSponsorType; + +//@description The sponsor is a public channel chat @chat_id Sponsor chat identifier @link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead +messageSponsorTypePublicChannel chat_id:int53 link:InternalLinkType = MessageSponsorType; + +//@description The sponsor is a private channel chat @title Title of the chat @invite_link Invite link for the channel +messageSponsorTypePrivateChannel title:string invite_link:string = MessageSponsorType; + +//@description The sponsor is a website @url URL of the website @name Name of the website +messageSponsorTypeWebsite url:string name:string = MessageSponsorType; + + +//@description Information about the sponsor of a message +//@type Type of the sponsor +//@photo Photo of the sponsor; may be null if must not be shown +//@info Additional optional information about the sponsor to be shown along with the message +messageSponsor type:MessageSponsorType photo:chatPhotoInfo info:string = MessageSponsor; + //@description Describes a sponsored message //@message_id Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages -//@sponsor_chat_id Chat identifier -//@link An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead +//@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored" //@content Content of the message. Currently, can be only of the type messageText -sponsoredMessage message_id:int53 sponsor_chat_id:int53 link:InternalLinkType content:MessageContent = SponsoredMessage; +//@sponsor Information about the sponsor of the message +//@additional_info If non-empty, additional information about the sponsored message to be shown along with the message +sponsoredMessage message_id:int53 is_recommended:Bool content:MessageContent sponsor:messageSponsor additional_info:string = SponsoredMessage; + +//@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages +sponsoredMessages messages:vector messages_between:int32 = SponsoredMessages; + + +//@description Describes a file added to file download list +//@file_id File identifier +//@message The message with the file +//@add_date Point in time (Unix timestamp) when the file was added to the download list +//@complete_date Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed +//@is_paused True, if downloading of the file is paused +fileDownload file_id:int32 message:message add_date:int32 complete_date:int32 is_paused:Bool = FileDownload; + +//@description Contains number of being downloaded and recently downloaded files found +//@active_count Number of active file downloads found, including paused +//@paused_count Number of paused file downloads found +//@completed_count Number of completed file downloads found +downloadedFileCounts active_count:int32 paused_count:int32 completed_count:int32 = DownloadedFileCounts; + +//@description Contains a list of downloaded files, found by a search +//@total_counts Total number of suitable files, ignoring offset +//@files The list of files +//@next_offset The offset for the next request. If empty, there are no more results +foundFileDownloads total_counts:downloadedFileCounts files:vector next_offset:string = FoundFileDownloads; //@class NotificationSettingsScope @description Describes the types of chats to which notification settings are relevant @@ -842,35 +1417,50 @@ sponsoredMessage message_id:int53 sponsor_chat_id:int53 link:InternalLinkType co //@description Notification settings applied to all private and secret chats when the corresponding chat setting has a default value notificationSettingsScopePrivateChats = NotificationSettingsScope; -//@description Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value +//@description Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value notificationSettingsScopeGroupChats = NotificationSettingsScope; -//@description Notification settings applied to all channels when the corresponding chat setting has a default value +//@description Notification settings applied to all channel chats when the corresponding chat setting has a default value notificationSettingsScopeChannelChats = NotificationSettingsScope; -//@description Contains information about notification settings for a chat -//@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat is used instead @mute_for Time left before notifications will be unmuted, in seconds -//@use_default_sound If true, sound is ignored and the value for the relevant type of chat is used instead @sound The name of an audio file to be used for notification sounds; only applies to iOS applications -//@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat is used instead @show_preview True, if message content must be displayed in notifications -//@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead @disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message -//@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead @disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message -chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound:string use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; +//@description Contains information about notification settings for a chat or a forum topic +//@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead +//@mute_for Time left before notifications will be unmuted, in seconds +//@use_default_sound If true, the value for the relevant type of chat or the forum chat is used instead of sound_id +//@sound_id Identifier of the notification sound to be played for messages; 0 if sound is disabled +//@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead +//@show_preview True, if message content must be displayed in notifications +//@use_default_mute_stories If true, mute_stories is ignored and the value for the relevant type of chat is used instead +//@mute_stories True, if story notifications are disabled for the chat +//@use_default_story_sound If true, the value for the relevant type of chat is used instead of story_sound_id +//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled +//@use_default_show_story_sender If true, show_story_sender is ignored and the value for the relevant type of chat is used instead +//@show_story_sender True, if the sender of stories must be displayed in notifications +//@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead +//@disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message +//@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead +//@disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message +chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool use_default_story_sound:Bool story_sound_id:int64 use_default_show_story_sender:Bool show_story_sender:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; //@description Contains information about notification settings for several chats //@mute_for Time left before notifications will be unmuted, in seconds -//@sound The name of an audio file to be used for notification sounds; only applies to iOS applications +//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@show_preview True, if message content must be displayed in notifications +//@use_default_mute_stories If true, mute_stories is ignored and story notifications are received only for the first 5 chats from topChatCategoryUsers +//@mute_stories True, if story notifications are disabled for the chat +//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled +//@show_story_sender True, if the sender of stories must be displayed in notifications //@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message //@disable_mention_notifications True, if notifications for messages with mentions will be created as for an ordinary unread message -scopeNotificationSettings mute_for:int32 sound:string show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; +scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool story_sound_id:int64 show_story_sender:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; //@description Contains information about a message draft -//@reply_to_message_id Identifier of the message to reply to; 0 if none +//@reply_to Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none //@date Point in time (Unix timestamp) when the draft was created //@input_message_text Content of the message draft; must be of the type inputMessageText -draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage; +draftMessage reply_to:InputMessageReplyTo date:int32 input_message_text:InputMessageContent = DraftMessage; //@class ChatType @description Describes the type of a chat @@ -888,13 +1478,17 @@ chatTypeSupergroup supergroup_id:int53 is_channel:Bool = ChatType; chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; -//@description Represents a filter of user chats -//@title The title of the filter; 1-12 characters without line feeds -//@icon_name The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". -//-If empty, use getChatFilterDefaultIconName to get default icon name for the filter -//@pinned_chat_ids The chat identifiers of pinned chats in the filtered chat list -//@included_chat_ids The chat identifiers of always included chats in the filtered chat list -//@excluded_chat_ids The chat identifiers of always excluded chats in the filtered chat list +//@description Represents an icon for a chat folder @name The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", +//-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" +chatFolderIcon name:string = ChatFolderIcon; + +//@description Represents a folder for user chats +//@title The title of the folder; 1-12 characters without line feeds +//@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder +//@is_shareable True, if at least one link has been created for the folder +//@pinned_chat_ids The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@included_chat_ids The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@excluded_chat_ids The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium //@exclude_muted True, if muted chats need to be excluded //@exclude_read True, if read chats need to be excluded //@exclude_archived True, if archived chats need to be excluded @@ -903,19 +1497,42 @@ chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; //@include_bots True, if bots need to be included //@include_groups True, if basic groups and supergroups need to be included //@include_channels True, if channels need to be included -chatFilter title:string icon_name:string pinned_chat_ids:vector included_chat_ids:vector excluded_chat_ids:vector exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFilter; +chatFolder title:string icon:chatFolderIcon is_shareable:Bool pinned_chat_ids:vector included_chat_ids:vector excluded_chat_ids:vector exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder; -//@description Contains basic information about a chat filter -//@id Unique chat filter identifier -//@title The title of the filter; 1-12 characters without line feeds -//@icon_name The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" -chatFilterInfo id:int32 title:string icon_name:string = ChatFilterInfo; +//@description Contains basic information about a chat folder +//@id Unique chat folder identifier +//@title The title of the folder; 1-12 characters without line feeds +//@icon The chosen or default icon for the chat folder +//@is_shareable True, if at least one link has been created for the folder +//@has_my_invite_links True, if the chat folder has invite links created by the current user +chatFolderInfo id:int32 title:string icon:chatFolderIcon is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo; -//@description Describes a recommended chat filter @filter The chat filter @param_description Chat filter description -recommendedChatFilter filter:chatFilter description:string = RecommendedChatFilter; +//@description Contains a chat folder invite link +//@invite_link The chat folder invite link +//@name Name of the link +//@chat_ids Identifiers of chats, included in the link +chatFolderInviteLink invite_link:string name:string chat_ids:vector = ChatFolderInviteLink; -//@description Contains a list of recommended chat filters @chat_filters List of recommended chat filters -recommendedChatFilters chat_filters:vector = RecommendedChatFilters; +//@description Represents a list of chat folder invite links @invite_links List of the invite links +chatFolderInviteLinks invite_links:vector = ChatFolderInviteLinks; + +//@description Contains information about an invite link to a chat folder +//@chat_folder_info Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet +//@missing_chat_ids Identifiers of the chats from the link, which aren't added to the folder yet +//@added_chat_ids Identifiers of the chats from the link, which are added to the folder already +chatFolderInviteLinkInfo chat_folder_info:chatFolderInfo missing_chat_ids:vector added_chat_ids:vector = ChatFolderInviteLinkInfo; + +//@description Describes a recommended chat folder @folder The chat folder @param_description Chat folder description +recommendedChatFolder folder:chatFolder description:string = RecommendedChatFolder; + +//@description Contains a list of recommended chat folders @chat_folders List of recommended chat folders +recommendedChatFolders chat_folders:vector = RecommendedChatFolders; + +//@description Contains settings for automatic moving of chats to and from the Archive chat lists +//@archive_and_mute_new_chats_from_unknown_users True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true +//@keep_unmuted_chats_archived True, if unmuted chats will be kept in the Archive chat list when they get a new message +//@keep_chats_from_folders_archived True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true +archiveChatListSettings archive_and_mute_new_chats_from_unknown_users:Bool keep_unmuted_chats_archived:Bool keep_chats_from_folders_archived:Bool = ArchiveChatListSettings; //@class ChatList @description Describes a list of chats @@ -926,8 +1543,8 @@ chatListMain = ChatList; //@description A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives chatListArchive = ChatList; -//@description A list of chats belonging to a chat filter @chat_filter_id Chat filter identifier -chatListFilter chat_filter_id:int32 = ChatList; +//@description A list of chats added to a chat folder @chat_folder_id Chat folder identifier +chatListFolder chat_folder_id:int32 = ChatList; //@description Contains a list of chat lists @chat_lists List of chat lists chatLists chat_lists:vector = ChatLists; @@ -950,6 +1567,15 @@ chatSourcePublicServiceAnnouncement type:string text:string = ChatSource; chatPosition list:ChatList order:int64 is_pinned:Bool source:ChatSource = ChatPosition; +//@class ChatAvailableReactions @description Describes reactions available in the chat + +//@description All reactions are available in the chat +chatAvailableReactionsAll = ChatAvailableReactions; + +//@description Only specific reactions are available in the chat @reactions The list of reactions +chatAvailableReactionsSome reactions:vector = ChatAvailableReactions; + + //@description Describes a video chat //@group_call_id Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall //@has_participants True, if the video chat has participants @@ -962,13 +1588,16 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@type Type of the chat //@title Chat title //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none //@permissions Actions that non-administrator chat members are allowed to take in the chat -//@last_message Last message in the chat; may be null +//@last_message Last message in the chat; may be null if none or unknown //@positions Positions of the chat in chat lists //@message_sender_id Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender +//@block_list Block list to which the chat is added; may be null if none //@has_protected_content True, if chat content can't be saved locally, forwarded, or copied +//@is_translatable True, if translation of all messages in the chat must be suggested to the user //@is_marked_as_unread True, if the chat is marked as unread -//@is_blocked True, if the chat is blocked by the current user and private messages from the chat can't be received //@has_scheduled_messages True, if the chat has scheduled messages //@can_be_deleted_only_for_self True, if the chat messages can be deleted only for the current user while other users will continue to see the messages //@can_be_deleted_for_all_users True, if the chat messages can be deleted for all users @@ -978,18 +1607,21 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@last_read_inbox_message_id Identifier of the last read incoming message //@last_read_outbox_message_id Identifier of the last read outgoing message //@unread_mention_count Number of unread messages with a mention/reply in the chat -//@notification_settings Notification settings for this chat -//@message_ttl Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats +//@unread_reaction_count Number of messages with unread reactions in the chat +//@notification_settings Notification settings for the chat +//@available_reactions Types of reaction, available in the chat +//@message_auto_delete_time Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date +//@background Background set for the chat; may be null if none //@theme_name If non-empty, name of a theme, set for the chat -//@action_bar Information about actions which must be possible to do through the chat action bar; may be null +//@action_bar Information about actions which must be possible to do through the chat action bar; may be null if none //@video_chat Information about video chat of the chat -//@pending_join_requests Information about pending join requests; may be null +//@pending_join_requests Information about pending join requests; may be null 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 +//@draft_message A draft of a message in the chat; may be null if none //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings message_ttl:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; -//@description Represents a list of chats @total_count Approximate total count of chats found @chat_ids List of chat identifiers +//@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; @@ -1002,7 +1634,7 @@ chatsNearby users_nearby:vector supergroups_nearby:vector