UNPKG

tdjson

Version:

TypeScript types for libtdjson.so

1,952 lines 1.32 MB
/** An object of this type can be returned on every function call, in case of an error. */ export interface Error { '@type': 'error'; /** Error code; subject to future changes. If the error code is 406, the error message must not be processed in any way and must not be displayed to the user. */ code: number; /** Error message; subject to future changes. */ message: string; } /** An object of this type is returned on a successful function call for certain functions. */ export interface Ok { '@type': 'ok'; } /** Provides information about the method by which an authentication code is delivered to the user. Subtype of {@link AuthenticationCodeType}. */ export interface AuthenticationCodeTypeTelegramMessage { '@type': 'authenticationCodeTypeTelegramMessage'; /** Length of the code. */ length: number; } /** A digit-only authentication code is delivered via an SMS message to the specified phone number; non-official applications may not receive this type of code. Subtype of {@link AuthenticationCodeType}. */ export interface AuthenticationCodeTypeSms { '@type': 'authenticationCodeTypeSms'; /** Length of the code. */ length: number; } /** An authentication code is a word delivered via an SMS message to the specified phone number; non-official applications may not receive this type of code. Subtype of {@link AuthenticationCodeType}. */ export interface AuthenticationCodeTypeSmsWord { '@type': 'authenticationCodeTypeSmsWord'; /** The first letters of the word if known. */ first_letter: string; } /** An authentication code is a phrase from multiple words delivered via an SMS message to the specified phone number; non-official applications may not receive this type of code. Subtype of {@link AuthenticationCodeType}. */ export interface AuthenticationCodeTypeSmsPhrase { '@type': 'authenticationCodeTypeSmsPhrase'; /** The first word of the phrase if known. */ first_word: string; } /** A digit-only authentication code is delivered via a phone call to the specified phone number. Subtype of {@link AuthenticationCodeType}. */ export interface AuthenticationCodeTypeCall { '@type': 'authenticationCodeTypeCall'; /** Length of the code. */ length: number; } /** 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. Subtype of {@link AuthenticationCodeType}. */ export interface AuthenticationCodeTypeFlashCall { '@type': 'authenticationCodeTypeFlashCall'; /** Pattern of the phone number from which the call will be made. */ pattern: string; } /** 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. Subtype of {@link AuthenticationCodeType}. */ export interface AuthenticationCodeTypeMissedCall { '@type': 'authenticationCodeTypeMissedCall'; /** Prefix of the phone number from which the call will be made. */ phone_number_prefix: string; /** Number of digits in the code, excluding the prefix. */ length: number; } /** A digit-only authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT. Subtype of {@link AuthenticationCodeType}. */ export interface AuthenticationCodeTypeFragment { '@type': 'authenticationCodeTypeFragment'; /** URL to open to receive the code. */ url: string; /** Length of the code. */ length: number; } /** A digit-only authentication code is delivered via Firebase Authentication to the official Android application. Subtype of {@link AuthenticationCodeType}. */ export interface AuthenticationCodeTypeFirebaseAndroid { '@type': 'authenticationCodeTypeFirebaseAndroid'; /** Parameters to be used for device verification. */ device_verification_parameters: FirebaseDeviceVerificationParameters; /** Length of the code. */ length: number; } /** A digit-only authentication code is delivered via Firebase Authentication to the official iOS application. Subtype of {@link AuthenticationCodeType}. */ export interface AuthenticationCodeTypeFirebaseIos { '@type': 'authenticationCodeTypeFirebaseIos'; /** Receipt of successful application token validation to compare with receipt from push notification. */ receipt: string; /** Time after the next authentication method is expected to be used if verification push notification isn't received, in seconds. */ push_timeout: number; /** Length of the code. */ length: number; } /** Information about the authentication code that was sent. */ export interface AuthenticationCodeInfo { '@type': 'authenticationCodeInfo'; /** A phone number that is being authenticated. */ phone_number: string; /** The way the code was sent to the user. */ type: AuthenticationCodeType; /** The way the next code will be sent to the user; may be null. */ next_type: AuthenticationCodeType; /** Timeout before the code can be re-sent, in seconds. */ timeout: number; } /** Information about the email address authentication code that was sent. */ export interface EmailAddressAuthenticationCodeInfo { '@type': 'emailAddressAuthenticationCodeInfo'; /** Pattern of the email address to which an authentication code was sent. */ email_address_pattern: string; /** Length of the code; 0 if unknown. */ length: number; } /** Contains authentication data for an email address. Subtype of {@link EmailAddressAuthentication}. */ export interface EmailAddressAuthenticationCode { '@type': 'emailAddressAuthenticationCode'; /** The code. */ code: string; } /** An authentication token received through Apple ID. Subtype of {@link EmailAddressAuthentication}. */ export interface EmailAddressAuthenticationAppleId { '@type': 'emailAddressAuthenticationAppleId'; /** The token. */ token: string; } /** An authentication token received through Google ID. Subtype of {@link EmailAddressAuthentication}. */ export interface EmailAddressAuthenticationGoogleId { '@type': 'emailAddressAuthenticationGoogleId'; /** The token. */ token: string; } /** Describes reset state of an email address. Subtype of {@link EmailAddressResetState}. */ export interface EmailAddressResetStateAvailable { '@type': 'emailAddressResetStateAvailable'; /** Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium. */ wait_period: number; } /** Email address reset has already been requested. Call resetAuthenticationEmailAddress to check whether immediate reset is possible. Subtype of {@link EmailAddressResetState}. */ export interface EmailAddressResetStatePending { '@type': 'emailAddressResetStatePending'; /** Left time before the email address will be reset, in seconds. updateAuthorizationState is not sent when this field changes. */ reset_in: number; } /** Represents a part of the text that needs to be formatted in some unusual way. */ export interface TextEntity { '@type': 'textEntity'; /** Offset of the entity, in UTF-16 code units. */ offset: number; /** Length of the entity, in UTF-16 code units. */ length: number; /** Type of the entity. */ type: TextEntityType; } /** Contains a list of text entities. */ export interface TextEntities { '@type': 'textEntities'; /** List of text entities. */ entities: TextEntity[]; } /** A text with some entities. */ export interface FormattedText { '@type': 'formattedText'; /** The text. */ text: string; /** 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[]; } /** Contains Telegram terms of service. */ export interface TermsOfService { '@type': 'termsOfService'; /** Text of the terms of service. */ text: FormattedText; /** The minimum age of a user to be able to accept the terms; 0 if age isn't restricted. */ min_user_age: number; /** True, if a blocking popup with terms of service must be shown to the user. */ show_popup?: boolean; } /** Represents the current authorization state of the TDLib client. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateWaitTdlibParameters { '@type': 'authorizationStateWaitTdlibParameters'; } /** 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. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateWaitPhoneNumber { '@type': 'authorizationStateWaitPhoneNumber'; } /** 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. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateWaitEmailAddress { '@type': 'authorizationStateWaitEmailAddress'; /** True, if authorization through Apple ID is allowed. */ allow_apple_id?: boolean; /** True, if authorization through Google ID is allowed. */ allow_google_id?: boolean; } /** TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateWaitEmailCode { '@type': 'authorizationStateWaitEmailCode'; /** True, if authorization through Apple ID is allowed. */ allow_apple_id?: boolean; /** True, if authorization through Google ID is allowed. */ allow_google_id?: boolean; /** Information about the sent authentication code. */ code_info: EmailAddressAuthenticationCodeInfo; /** Reset state of the email address; may be null if the email address can't be reset. */ email_address_reset_state: EmailAddressResetState; } /** TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateWaitCode { '@type': 'authorizationStateWaitCode'; /** Information about the authorization code that was sent. */ code_info: AuthenticationCodeInfo; } /** The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateWaitOtherDeviceConfirmation { '@type': 'authorizationStateWaitOtherDeviceConfirmation'; /** A tg:// URL for the QR code. The link will be updated frequently. */ link: string; } /** 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. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateWaitRegistration { '@type': 'authorizationStateWaitRegistration'; /** Telegram terms of service. */ terms_of_service: TermsOfService; } /** 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. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateWaitPassword { '@type': 'authorizationStateWaitPassword'; /** Hint for the password; may be empty. */ password_hint: string; /** True, if a recovery email address has been set up. */ has_recovery_email_address?: boolean; /** True, if some Telegram Passport elements were saved. */ has_passport_data?: boolean; /** Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent. */ recovery_email_address_pattern: string; } /** The user has been successfully authorized. TDLib is now ready to answer general requests. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateReady { '@type': 'authorizationStateReady'; } /** The user is currently logging out. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateLoggingOut { '@type': 'authorizationStateLoggingOut'; } /** TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateClosing { '@type': 'authorizationStateClosing'; } /** TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to with error code 500. To continue working, one must create a new instance of the TDLib client. Subtype of {@link AuthorizationState}. */ export interface AuthorizationStateClosed { '@type': 'authorizationStateClosed'; } /** Describes parameters to be used for device verification. Subtype of {@link FirebaseDeviceVerificationParameters}. */ export interface FirebaseDeviceVerificationParametersSafetyNet { '@type': 'firebaseDeviceVerificationParametersSafetyNet'; /** Nonce to pass to the SafetyNet Attestation API. */ nonce: string; } /** Device verification must be performed with the classic Play Integrity verification (https://developer.android.com/google/play/integrity/classic). Subtype of {@link FirebaseDeviceVerificationParameters}. */ export interface FirebaseDeviceVerificationParametersPlayIntegrity { '@type': 'firebaseDeviceVerificationParametersPlayIntegrity'; /** Base64url-encoded nonce to pass to the Play Integrity API. */ nonce: string; /** Cloud project number to pass to the Play Integrity API. */ cloud_project_number: string; } /** Represents the current state of 2-step verification. */ export interface PasswordState { '@type': 'passwordState'; /** True, if a 2-step verification password is set. */ has_password?: boolean; /** Hint for the password; may be empty. */ password_hint: string; /** True, if a recovery email is set. */ has_recovery_email_address?: boolean; /** True, if some Telegram Passport elements were saved. */ has_passport_data?: boolean; /** Information about the recovery email address to which the confirmation email was sent; may be null. */ recovery_email_address_code_info: EmailAddressAuthenticationCodeInfo; /** Pattern of the email address set up for logging in. */ login_email_address_pattern: string; /** If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword. */ pending_reset_date: number; } /** Contains information about the current recovery email address. */ export interface RecoveryEmailAddress { '@type': 'recoveryEmailAddress'; /** Recovery email address. */ recovery_email_address: string; } /** Returns information about the availability of a temporary password, which can be used for payments. */ export interface TemporaryPasswordState { '@type': 'temporaryPasswordState'; /** True, if a temporary password is available. */ has_password?: boolean; /** Time left before the temporary password expires, in seconds. */ valid_for: number; } /** Represents a local file. */ export interface LocalFile { '@type': 'localFile'; /** Local path to the locally available file part; may be empty. */ path: string; /** True, if it is possible to download or generate the file. */ can_be_downloaded?: boolean; /** True, if the file can be deleted. */ can_be_deleted?: boolean; /** True, if the file is currently being downloaded (or a local copy is being generated by some other means). */ is_downloading_active?: boolean; /** True, if the local copy is fully available. */ is_downloading_completed?: boolean; /** Download will be started from this offset. downloaded_prefix_size is calculated from this offset. */ download_offset: number; /** 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_prefix_size: number; /** 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. */ downloaded_size: number; } /** Represents a remote file. */ export interface RemoteFile { '@type': 'remoteFile'; /** 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; /** 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. */ unique_id: string; /** True, if the file is currently being uploaded (or a remote copy is being generated by some other means). */ is_uploading_active?: boolean; /** True, if a remote copy is fully available. */ is_uploading_completed?: boolean; /** Size of the remote available part of the file, in bytes; 0 if unknown. */ uploaded_size: number; } /** Represents a file. */ export interface File { '@type': 'file'; /** Unique file identifier. */ id: number; /** File size, in bytes; 0 if unknown. */ size: number; /** Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress. */ expected_size: number; /** Information about the local copy of the file. */ local: LocalFile; /** Information about the remote copy of the file. */ remote: RemoteFile; } /** Points to a file. Subtype of {@link InputFile}. */ export interface InputFileId { '@type': 'inputFileId'; /** Unique file identifier. */ id: number; } /** 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. Subtype of {@link InputFile}. */ export interface InputFileRemote { '@type': 'inputFileRemote'; /** Remote file identifier. */ id: string; } /** A file defined by a local path. Subtype of {@link InputFile}. */ export interface InputFileLocal { '@type': 'inputFileLocal'; /** Local path to the file. */ path: string; } /** A file generated by the application. The application must handle updates updateFileGenerationStart and updateFileGenerationStop to generate the file when asked by TDLib. Subtype of {@link InputFile}. */ export interface InputFileGenerated { '@type': 'inputFileGenerated'; /** Local path to a file from which the file is generated. The path doesn't have to be a valid path and is used by TDLib only to detect name and MIME type of the generated file. */ original_path: string; /** 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; /** Expected size of the generated file, in bytes; pass 0 if unknown. */ expected_size: number; } /** Describes an image in JPEG format. */ export interface PhotoSize { '@type': 'photoSize'; /** Image type (see https://core.telegram.org/constructor/photoSize). */ type: string; /** Information about the image file. */ photo: File; /** Image width. */ width: number; /** Image height. */ height: number; /** Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes. */ progressive_sizes: number[]; } /** Thumbnail image of a very poor quality and low resolution. */ export interface Minithumbnail { '@type': 'minithumbnail'; /** Thumbnail width, usually doesn't exceed 40. */ width: number; /** Thumbnail height, usually doesn't exceed 40. */ height: number; /** The thumbnail in JPEG format. */ data: string; } /** Describes format of a thumbnail. Subtype of {@link ThumbnailFormat}. */ export interface ThumbnailFormatJpeg { '@type': 'thumbnailFormatJpeg'; } /** The thumbnail is in static GIF format. It will be used only for some bot inline query results. Subtype of {@link ThumbnailFormat}. */ export interface ThumbnailFormatGif { '@type': 'thumbnailFormatGif'; } /** The thumbnail is in MPEG4 format. It will be used only for some animations and videos. Subtype of {@link ThumbnailFormat}. */ export interface ThumbnailFormatMpeg4 { '@type': 'thumbnailFormatMpeg4'; } /** The thumbnail is in PNG format. It will be used only for background patterns. Subtype of {@link ThumbnailFormat}. */ export interface ThumbnailFormatPng { '@type': 'thumbnailFormatPng'; } /** The thumbnail is in TGS format. It will be used only for sticker sets. Subtype of {@link ThumbnailFormat}. */ export interface ThumbnailFormatTgs { '@type': 'thumbnailFormatTgs'; } /** The thumbnail is in WEBM format. It will be used only for sticker sets. Subtype of {@link ThumbnailFormat}. */ export interface ThumbnailFormatWebm { '@type': 'thumbnailFormatWebm'; } /** The thumbnail is in WEBP format. It will be used only for some stickers and sticker sets. Subtype of {@link ThumbnailFormat}. */ export interface ThumbnailFormatWebp { '@type': 'thumbnailFormatWebp'; } /** Represents a thumbnail. */ export interface Thumbnail { '@type': 'thumbnail'; /** Thumbnail format. */ format: ThumbnailFormat; /** Thumbnail width. */ width: number; /** Thumbnail height. */ height: number; /** The thumbnail. */ file: File; } /** Part of the face, relative to which a mask is placed. Subtype of {@link MaskPoint}. */ export interface MaskPointForehead { '@type': 'maskPointForehead'; } /** The mask is placed relatively to the eyes. Subtype of {@link MaskPoint}. */ export interface MaskPointEyes { '@type': 'maskPointEyes'; } /** The mask is placed relatively to the mouth. Subtype of {@link MaskPoint}. */ export interface MaskPointMouth { '@type': 'maskPointMouth'; } /** The mask is placed relatively to the chin. Subtype of {@link MaskPoint}. */ export interface MaskPointChin { '@type': 'maskPointChin'; } /** Position on a photo where a mask is placed. */ export interface MaskPosition { '@type': 'maskPosition'; /** Part of the face, relative to which the mask is placed. */ point: MaskPoint; /** 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). */ x_shift: number; /** 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). */ y_shift: number; /** Mask scaling coefficient. (For example, 2.0 means a doubled size). */ scale: number; } /** Describes format of a sticker. Subtype of {@link StickerFormat}. */ export interface StickerFormatWebp { '@type': 'stickerFormatWebp'; } /** The sticker is an animation in TGS format. Subtype of {@link StickerFormat}. */ export interface StickerFormatTgs { '@type': 'stickerFormatTgs'; } /** The sticker is a video in WEBM format. Subtype of {@link StickerFormat}. */ export interface StickerFormatWebm { '@type': 'stickerFormatWebm'; } /** Describes type of sticker. Subtype of {@link StickerType}. */ export interface StickerTypeRegular { '@type': 'stickerTypeRegular'; } /** The sticker is a mask in WEBP format to be placed on photos or videos. Subtype of {@link StickerType}. */ export interface StickerTypeMask { '@type': 'stickerTypeMask'; } /** The sticker is a custom emoji to be used inside message text and caption. Subtype of {@link StickerType}. */ export interface StickerTypeCustomEmoji { '@type': 'stickerTypeCustomEmoji'; } /** Contains full information about sticker type. Subtype of {@link StickerFullType}. */ export interface StickerFullTypeRegular { '@type': 'stickerFullTypeRegular'; /** Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker. */ premium_animation: File; } /** The sticker is a mask in WEBP format to be placed on photos or videos. Subtype of {@link StickerFullType}. */ export interface StickerFullTypeMask { '@type': 'stickerFullTypeMask'; /** Position where the mask is placed; may be null. */ mask_position: MaskPosition; } /** The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji. Subtype of {@link StickerFullType}. */ export interface StickerFullTypeCustomEmoji { '@type': 'stickerFullTypeCustomEmoji'; /** Identifier of the custom emoji. */ custom_emoji_id: string; /** 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. */ needs_repainting?: boolean; } /** Represents a closed vector path. The path begins at the end point of the last command. The coordinate system origin is in the upper-left corner. */ export interface ClosedVectorPath { '@type': 'closedVectorPath'; /** List of vector path commands. */ commands: VectorPathCommand[]; } /** Represents outline of an image. */ export interface Outline { '@type': 'outline'; /** The list of closed vector paths. */ paths: ClosedVectorPath[]; } /** Describes one answer option of a poll. */ export interface PollOption { '@type': 'pollOption'; /** Option text; 1-100 characters. Only custom emoji entities are allowed. */ text: FormattedText; /** Number of voters for this option, available only for closed or voted polls. */ voter_count: number; /** The percentage of votes for this option; 0-100. */ vote_percentage: number; /** True, if the option was chosen by the user. */ is_chosen?: boolean; /** True, if the option is being chosen by a pending setPollAnswer request. */ is_being_chosen?: boolean; } /** Describes the type of poll. Subtype of {@link PollType}. */ export interface PollTypeRegular { '@type': 'pollTypeRegular'; /** True, if multiple answer options can be chosen simultaneously. */ allow_multiple_answers?: boolean; } /** A poll in quiz mode, which has exactly one correct answer option and can be answered only once. Subtype of {@link PollType}. */ export interface PollTypeQuiz { '@type': 'pollTypeQuiz'; /** 0-based identifier of the correct answer option; -1 for a yet unanswered poll. */ correct_option_id: number; /** Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll. */ explanation: FormattedText; } /** Describes an animation file. The animation must be encoded in GIF or MPEG4 format. */ export interface Animation { '@type': 'animation'; /** Duration of the animation, in seconds; as defined by the sender. */ duration: number; /** Width of the animation. */ width: number; /** Height of the animation. */ height: number; /** Original name of the file; as defined by the sender. */ file_name: string; /** MIME type of the file, usually "image/gif" or "video/mp4". */ mime_type: string; /** True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets. */ has_stickers?: boolean; /** Animation minithumbnail; may be null. */ minithumbnail: Minithumbnail; /** Animation thumbnail in JPEG or MPEG4 format; may be null. */ thumbnail: Thumbnail; /** File containing the animation. */ animation: File; } /** Describes an audio file. Audio is usually in MP3 or M4A format. */ export interface Audio { '@type': 'audio'; /** Duration of the audio, in seconds; as defined by the sender. */ duration: number; /** Title of the audio; as defined by the sender. */ title: string; /** Performer of the audio; as defined by the sender. */ performer: string; /** Original name of the file; as defined by the sender. */ file_name: string; /** The MIME type of the file; as defined by the sender. */ mime_type: string; /** The minithumbnail of the album cover; may be null. */ album_cover_minithumbnail: Minithumbnail; /** The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is expected to be extracted from the downloaded audio file; may be null. */ album_cover_thumbnail: Thumbnail; /** Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate. */ external_album_covers: Thumbnail[]; /** File containing the audio. */ audio: File; } /** Describes a document of any type. */ export interface Document { '@type': 'document'; /** Original name of the file; as defined by the sender. */ file_name: string; /** MIME type of the file; as defined by the sender. */ mime_type: string; /** Document minithumbnail; may be null. */ minithumbnail: Minithumbnail; /** Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null. */ thumbnail: Thumbnail; /** File containing the document. */ document: File; } /** Describes a photo. */ export interface Photo { '@type': 'photo'; /** True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets. */ has_stickers?: boolean; /** Photo minithumbnail; may be null. */ minithumbnail: Minithumbnail; /** Available variants of the photo, in different sizes. */ sizes: PhotoSize[]; } /** Describes a sticker. */ export interface Sticker { '@type': 'sticker'; /** Unique sticker identifier within the set; 0 if none. */ id: string; /** Identifier of the sticker set to which the sticker belongs; 0 if none. */ set_id: string; /** Sticker width; as defined by the sender. */ width: number; /** Sticker height; as defined by the sender. */ height: number; /** Emoji corresponding to the sticker. */ emoji: string; /** Sticker format. */ format: StickerFormat; /** Sticker's full type. */ full_type: StickerFullType; /** Sticker thumbnail in WEBP or JPEG format; may be null. */ thumbnail: Thumbnail; /** File containing the sticker. */ sticker: File; } /** Describes a video file. */ export interface Video { '@type': 'video'; /** Duration of the video, in seconds; as defined by the sender. */ duration: number; /** Video width; as defined by the sender. */ width: number; /** Video height; as defined by the sender. */ height: number; /** Original name of the file; as defined by the sender. */ file_name: string; /** MIME type of the file; as defined by the sender. */ mime_type: string; /** True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets. */ has_stickers?: boolean; /** True, if the video is expected to be streamed. */ supports_streaming?: boolean; /** Video minithumbnail; may be null. */ minithumbnail: Minithumbnail; /** Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null. */ thumbnail: Thumbnail; /** File containing the video. */ video: File; } /** Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format. */ export interface VideoNote { '@type': 'videoNote'; /** Duration of the video, in seconds; as defined by the sender. */ duration: number; /** A waveform representation of the video note's audio in 5-bit format; may be empty if unknown. */ waveform: string; /** Video width and height; as defined by the sender. */ length: number; /** Video minithumbnail; may be null. */ minithumbnail: Minithumbnail; /** Video thumbnail in JPEG format; as defined by the sender; may be null. */ thumbnail: Thumbnail; /** Result of speech recognition in the video note; may be null. */ speech_recognition_result: SpeechRecognitionResult; /** File containing the video. */ video: File; } /** Describes a voice note. */ export interface VoiceNote { '@type': 'voiceNote'; /** Duration of the voice note, in seconds; as defined by the sender. */ duration: number; /** A waveform representation of the voice note in 5-bit format. */ waveform: string; /** MIME type of the file; as defined by the sender. Usually, one of "audio/ogg" for Opus in an OGG container, "audio/mpeg" for an MP3 audio, or "audio/mp4" for an M4A audio. */ mime_type: string; /** Result of speech recognition in the voice note; may be null. */ speech_recognition_result: SpeechRecognitionResult; /** File containing the voice note. */ voice: File; } /** Describes an animated or custom representation of an emoji. */ export interface AnimatedEmoji { '@type': 'animatedEmoji'; /** Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, then it can have arbitrary format. */ sticker: Sticker; /** Expected width of the sticker, which can be used if the sticker is null. */ sticker_width: number; /** Expected height of the sticker, which can be used if the sticker is null. */ sticker_height: number; /** Emoji modifier fitzpatrick type; 0-6; 0 if none. */ fitzpatrick_type: number; /** 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; } /** Describes a user contact. */ export interface Contact { '@type': 'contact'; /** Phone number of the user. */ phone_number: string; /** First name of the user; 1-255 characters in length. */ first_name: string; /** Last name of the user. */ last_name: string; /** Additional data about the user in a form of vCard; 0-2048 bytes in length. */ vcard: string; /** Identifier of the user, if known; 0 otherwise. */ user_id: number; } /** Describes a location on planet Earth. */ export interface Location { '@type': 'location'; /** Latitude of the location in degrees; as defined by the sender. */ latitude: number; /** Longitude of the location, in degrees; as defined by the sender. */ longitude: number; /** The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown. */ horizontal_accuracy: number; } /** Describes a venue. */ export interface Venue { '@type': 'venue'; /** Venue location; as defined by the sender. */ location: Location; /** Venue name; as defined by the sender. */ title: string; /** Venue address; as defined by the sender. */ address: string; /** Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported. */ provider: string; /** Identifier of the venue in the provider database; as defined by the sender. */ id: string; /** Type of the venue in the provider database; as defined by the sender. */ type: string; } /** Describes a game. Use getInternalLink with internalLinkTypeGame to share the game. */ export interface Game { '@type': 'game'; /** Unique game identifier. */ id: string; /** Game short name. */ short_name: string; /** Game title. */ title: string; /** Game text, usually containing scoreboards for a game. */ text: FormattedText; /** Describes a game. Use getInternalLink with internalLinkTypeGame to share the game. */ description: string; /** Game photo. */ photo: Photo; /** Game animation; may be null. */ animation: Animation; } /** Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App. */ export interface WebApp { '@type': 'webApp'; /** Web App short name. */ short_name: string; /** Web App title. */ title: string; /** Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App. */ description: string; /** Web App photo. */ photo: Photo; /** Web App animation; may be null. */ animation: Animation; } /** Describes a poll. */ export interface Poll { '@type': 'poll'; /** Unique poll identifier. */ id: string; /** Poll question; 1-300 characters. Only custom emoji entities are allowed. */ question: FormattedText; /** List of poll answer options. */ options: PollOption[]; /** Total number of voters, participating in the poll. */ total_voter_count: number; /** Identifiers of recent voters, if the poll is non-anonymous. */ recent_voter_ids: MessageSender[]; /** True, if the poll is anonymous. */ is_anonymous?: boolean; /** Type of the poll. */ type: PollType; /** Amount of time the poll will be active after creation, in seconds. */ open_period: number; /** Point in time (Unix timestamp) when the poll will automatically be closed. */ close_date: number; /** True, if the poll is closed. */ is_closed?: boolean; } /** Describes an alternative re-encoded quality of a video file. */ export interface AlternativeVideo { '@type': 'alternativeVideo'; /** Unique identifier of the alternative video, which is used in the HLS file. */ id: string; /** Video width. */ width: number; /** Video height. */ height: number; /** Codec used for video file encoding, for example, "h264", "h265", or "av1". */ codec: string; /** HLS file describing the video. */ hls_file: File; /** File containing the video. */ video: File; } /** Describes a chat background. */ export interface Background { '@type': 'background'; /** Unique background identifier. */ id: string; /** True, if this is one of default backgrounds. */ is_default?: boolean; /** True, if the background is dark and is recommended to be used with dark theme. */ is_dark?: boolean; /** Unique background name. */ name: string; /** Document with the background; may be null. Null only for filled and chat theme backgrounds. */ document: Document; /** Type of the background. */ type: BackgroundType; } /** Contains a list of backgrounds. */ export interface Backgrounds { '@type': 'backgrounds'; /** A list of backgrounds. */ backgrounds: Background[]; } /** Describes a background set for a specific chat. */ export interface ChatBackground { '@type': 'chatBackground'; /** The background. */ background: Background; /** Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background. */ dark_theme_dimming: number; } /** Describes a user profile photo. */ export interface ProfilePhoto { '@type': 'profilePhoto'; /** Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos. */ id: string; /** A small (160x160) user profile photo. The file can be downloaded only before the photo is changed. */ small: File; /** A big (640x640) user profile photo. The file can be downloaded only before the photo is changed. */ big: File; /** User profile photo minithumbnail; may be null. */ minithumbnail: Minithumbnail; /** True, if the photo has animated variant. */ has_animation?: boolean; /** True, if the photo is visible only for the current user. */ is_personal?: boolean; } /** Contains basic information about the photo of a chat. */ export interface ChatPhotoInfo { '@type': 'chatPhotoInfo'; /** A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed. */ small: File; /** A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed. */ big: File; /** Chat photo minithumbnail; may be null. */ minithumbnail: Minithumbnail; /** True, if the photo has animated variant. */ has_animation?: boolean; /** True, if the photo is visible only for the current user. */ is_personal?: boolean; } /** Represents the type of user. The following types are possible: regular users, deleted users and bots. Subtype of {@link UserType}. */ export interface UserTypeRegular { '@type': 'userTypeRegular'; } /** 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. Subtype of {@link UserType}. */ export interface UserTypeDeleted { '@type': 'userTypeDeleted'; } /** A bot (see https://core.telegram.org/bots). Subtype of {@link UserType}. */ export interface UserTypeBot { '@type': 'userTypeBot'; /** 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_be_edited?: boolean; /** True, if the bot can be invited to basic group and supergroup chats. */ can_join_groups?: boolean; /** 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. */ can_read_all_group_messages?: boolean; /** True, if the bot has the main Web App. */ has_main_web_app?: boolean; /** True, if the bot supports inline queries. */ is_inline?: boolean; /** Placeholder for inline queries (displayed on the application input field). */ inline_query_placeholder: string; /** True, if the location of the user is expected to be sent with every inline query to this bot. */ need_location?: boolean; /** True, if the bot supports connection to Telegram Business accounts. */ can_connect_to_business?: boolean; /** True, if the bot can be added to attachment or side menu. */ can_be_added_to_attachment_menu?: boolean; /** The number of recently active users of the bot. */ active_user_count: number; } /** 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. Subtype of {@link UserType}. */ export interface UserTypeUnknown { '@type': 'userTypeUnknown'; } /** Represents a command supported by a bot. */ export interface BotCommand { '@type': 'botCommand'; /** Text of the bot command. */ command: string; /** Represents a command supported by a bot. */ description: string; } /** Contains a list of bot commands. */ export interface BotCommands { '@type': 'botCommands'; /** Bot's user identifier. */ bot_user_id: number; /** List of bot commands. */ commands: BotCommand[]; } /** Describes a button to be shown instead of bot commands menu button. */ export interface BotMenuButton { '@type': 'botMenuButton'; /** Text of the button. */ text: string; /** URL of a Web App to open when the button is pressed. If the link is of the type internalLinkTypeWebApp, then it must be processed accordingly. Otherwise, the link must be passed to openWebApp. */ url: string; } /** Describes parameters of verification that is provided by a bot. */ export interface BotVerificationParameters { '@type': 'botVerificationParameters'; /** Identifier of the custom emoji that is used as the verification sign. */ icon_custom_emoji_id: string; /** Name of the organization that provides verification. */ organization_name: string; /** Default custom description of verification reason to be used as placeholder in setMessageSenderBotVerification; may be null if none. */ default_custom_description: FormattedText; /** True, if the bot is allowed to provide custom description for verified entities. */ can_set_custom_description?: boolean; } /** Describes verification status provided by a bot. */ export interface BotVerification { '@type': 'botVerification'; /** Identifier of the bot that provided the verification. */ bot_user_id: number; /** Identifier of the custom emoji that is used as the verification sign. */ icon_custom_emoji_id: string; /** Custom description of verification reason set by the bot. Can contain only Mention, Hashtag, Cashtag, PhoneNumber, BankCardNumber, Url, and EmailAddress entities. */ custom_description: FormattedText; } /** Contains information about verification status of a chat or a user. */ export interface VerificationStatus { '@type': 'verificationStatus'; /** True, if the chat or the user is verified by Telegram. */ is_verified?: boolean; /** True, if the chat or the user is marked as scam by Telegram. */ is_scam?: boolean; /** True, if the chat or the user is marked as fake by Telegram. */ is_fake?: boolean; /** Identifier of the custom emoji to be shown as verification sign provided by a bot for the user; 0 if none. */ bot_verification_icon_custom_emoji_id: string; } /** Represents a location to which a chat is connected. */ export interface ChatLocation { '@type': 'chatLocation'; /** The location. */ location: Location; /** Location address; 1-64 characters, as defined by the chat owner. */ address: string; } /** Represents a birthdate of a user. */ export interface Birthdate { '@type': 'birthdate'; /** Day of the month; 1-31. */ day: number; /** Month of the year; 1-12. */ month: number; /** Birth year; 0 if unknown. */ year: number; } /** Describes a user that had or will have a birthday soon. */ export interface CloseBirthdayUser { '@type': 'closeBirthdayUser'; /** User identifier. */ user_id: number; /** Birthdate of the user. */ birthdate: Birthdate; } /** Describes conditions for sending of away messages by a Telegram Business account. Subtype of {@link BusinessAwayMessageSchedule}. */ export interface BusinessAwayMessageScheduleAlways { '@type': 'businessAwayMessageScheduleAlways'; } /** Send away messages outside of the business opening hours. Subtype of {@link BusinessAwayMessageSchedule}. */ export interface BusinessAwayMessageScheduleOutsideOfOpeningHours { '@type': 'businessAwayMessageScheduleOutsideOfOpeningHours'; } /** Send away messages only in the specified time span. Subtype of {@link BusinessAwayMessageSchedule}. */ export interface BusinessAwayMessageScheduleCustom { '@type': 'businessAwayMessageScheduleCustom'; /** Point in time (Unix timestamp) when the away messages will start to be sent. */ start_date: number; /** Point in time (Unix timestamp) when the away messages will stop to be sent. */ end_date: number; } /** Represents a location of a business. */ export interface BusinessLocation { '@type': 'businessLocation'; /** The location; may be null if not specified. */ location: Location; /** Location address; 1-96 characters. */ address: string; } /** Describes private chats chosen for automatic interaction with a business. */ export interface BusinessRecipients { '@type': 'businessRecipients'; /** Identifiers of selected private chats. */ chat_ids: number[]; /** Identifiers of private chats that are always excluded; for businessConnectedBot only. */ excluded_chat_ids: number[]; /** True, if all existing private chats are selected. */ select_existing_chats?: boolean; /** True, if all new private chats are selected. */ select_new_chats?: boolean; /** True, if all private chats with contacts are selected. */ select_contacts?: boolean; /** True, if all private c