go-tdlib/data/td_api.tl

8188 lines
551 KiB
Plaintext
Raw Normal View History

2018-08-30 14:55:42 +00:00
double ? = Double;
string ? = String;
int32 = Int32;
int53 = Int53;
int64 = Int64;
bytes = Bytes;
boolFalse = Bool;
boolTrue = Bool;
vector {t:Type} # [ t ] = Vector t;
//@description An object of this type can be returned on every function call, in case of an error
//@code 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
//@message Error message; subject to future changes
error code:int32 message:string = Error;
//@description An object of this type is returned on a successful function call for certain functions
ok = Ok;
//@class AuthenticationCodeType @description Provides information about the method by which an authentication code is delivered to the user
2022-12-30 18:28:59 +00:00
//@description An authentication code is delivered via a private Telegram message, which can be viewed from another active session
//@length Length of the code
2018-08-30 14:55:42 +00:00
authenticationCodeTypeTelegramMessage length:int32 = AuthenticationCodeType;
2022-12-30 18:28:59 +00:00
//@description An authentication code is delivered via an SMS message to the specified phone number
//@length Length of the code
2018-08-30 14:55:42 +00:00
authenticationCodeTypeSms length:int32 = AuthenticationCodeType;
2022-12-30 18:28:59 +00:00
//@description An authentication code is delivered via a phone call to the specified phone number
//@length Length of the code
2018-08-30 14:55:42 +00:00
authenticationCodeTypeCall length:int32 = AuthenticationCodeType;
2022-12-30 18:28:59 +00:00
//@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
2018-08-30 14:55:42 +00:00
authenticationCodeTypeFlashCall pattern:string = AuthenticationCodeType;
2022-12-30 18:28:59 +00:00
//@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
2021-12-30 05:55:02 +00:00
authenticationCodeTypeMissedCall phone_number_prefix:string length:int32 = AuthenticationCodeType;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2022-12-07 20:04:16 +00:00
authenticationCodeTypeFragment url:string length:int32 = AuthenticationCodeType;
2023-02-04 22:54:46 +00:00
//@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 applikation 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;
2021-12-30 05:55:02 +00:00
2022-12-30 18:28:59 +00:00
//@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
2018-08-30 14:55:42 +00:00
authenticationCodeInfo phone_number:string type:AuthenticationCodeType next_type:AuthenticationCodeType timeout:int32 = AuthenticationCodeInfo;
2022-12-30 18:28:59 +00:00
//@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
2018-09-05 21:45:29 +00:00
emailAddressAuthenticationCodeInfo email_address_pattern:string length:int32 = EmailAddressAuthenticationCodeInfo;
2022-09-18 01:34:29 +00:00
//@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;
2020-11-30 09:33:47 +00:00
//@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
2018-09-05 21:45:29 +00:00
textEntity offset:int32 length:int32 type:TextEntityType = TextEntity;
//@description Contains a list of text entities @entities List of text entities
textEntities entities:vector<textEntity> = TextEntities;
2020-02-03 12:56:20 +00:00
//@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.
2022-11-07 18:50:52 +00:00
//-Pre, Code and PreCode entities can't contain other 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
2018-09-05 21:45:29 +00:00
formattedText text:string entities:vector<textEntity> = FormattedText;
2022-03-13 04:04:12 +00:00
//@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
2018-09-05 21:45:29 +00:00
termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfService;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@class AuthorizationState @description Represents the current authorization state of the TDLib client
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Initializetion parameters are needed. Call setTdlibParameters to provide them
2018-08-30 14:55:42 +00:00
authorizationStateWaitTdlibParameters = AuthorizationState;
2022-12-30 18:28:59 +00:00
//@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
2018-08-30 14:55:42 +00:00
authorizationStateWaitPhoneNumber = AuthorizationState;
2022-12-30 18:28:59 +00:00
//@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
2022-09-18 01:34:29 +00:00
authorizationStateWaitEmailAddress allow_apple_id:Bool allow_google_id:Bool = AuthorizationState;
2022-12-30 18:28:59 +00:00
//@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
2022-09-18 01:34:29 +00:00
//@code_info Information about the sent authentication code
//@next_phone_number_authorization_date Point in time (Unix timestamp) when the user will be able to authorize with a code sent to the user's phone number; 0 if unknown
authorizationStateWaitEmailCode allow_apple_id:Bool allow_google_id:Bool code_info:emailAddressAuthenticationCodeInfo next_phone_number_authorization_date:int32 = AuthorizationState;
2022-12-30 18:28:59 +00:00
//@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
2019-09-10 12:36:54 +00:00
authorizationStateWaitCode code_info:authenticationCodeInfo = AuthorizationState;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@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;
2022-12-30 18:28:59 +00:00
//@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
2019-09-10 12:36:54 +00:00
authorizationStateWaitRegistration terms_of_service:termsOfService = AuthorizationState;
2022-12-30 18:28:59 +00:00
//@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
2018-08-30 14:55:42 +00:00
//@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;
2022-12-30 18:28:59 +00:00
//@description The user has been successfully authorized. TDLib is now ready to answer general requests
2018-08-30 14:55:42 +00:00
authorizationStateReady = AuthorizationState;
//@description The user is currently logging out
authorizationStateLoggingOut = AuthorizationState;
//@description 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
authorizationStateClosing = AuthorizationState;
//@description TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to
2021-12-30 05:55:02 +00:00
//-with error code 500. To continue working, one must create a new instance of the TDLib client
2018-08-30 14:55:42 +00:00
authorizationStateClosed = AuthorizationState;
2022-12-30 18:28:59 +00:00
//@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
2019-06-07 10:56:06 +00:00
//@recovery_email_address_code_info Information about the recovery email address to which the confirmation email was sent; may be null
2022-09-18 01:34:29 +00:00
//@login_email_address_pattern Pattern of the email address set up for logging in
2022-08-13 15:24:07 +00:00
//@pending_reset_date If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword
2022-09-18 01:34:29 +00:00
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;
2018-08-30 14:55:42 +00:00
//@description Contains information about the current recovery email address @recovery_email_address Recovery email address
recoveryEmailAddress recovery_email_address:string = RecoveryEmailAddress;
//@description Returns information about the availability of a temporary password, which can be used for payments @has_password True, if a temporary password is available @valid_for Time left before the temporary password expires, in seconds
temporaryPasswordState has_password:Bool valid_for:int32 = TemporaryPasswordState;
//@description Represents a local file
//@path Local path to the locally available file part; may be empty
2021-12-30 05:55:02 +00:00
//@can_be_downloaded True, if it is possible to download or generate the file
2018-08-30 14:55:42 +00:00
//@can_be_deleted True, if the file can be deleted
//@is_downloading_active True, if the file is currently being downloaded (or a local copy is being generated by some other means)
//@is_downloading_completed True, if the local copy is fully available
2019-06-07 10:56:06 +00:00
//@download_offset Download will be started from this offset. downloaded_prefix_size is calculated from this offset
2021-12-30 05:55:02 +00:00
//@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
2022-06-21 18:10:07 +00:00
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;
2018-08-30 14:55:42 +00:00
//@description Represents a remote file
2020-11-30 09:33:47 +00:00
//@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.
2020-02-03 12:56:20 +00:00
//-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.
2022-12-30 18:28:59 +00:00
//-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
2020-02-03 12:56:20 +00:00
//@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
2018-08-30 14:55:42 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@uploaded_size Size of the remote available part of the file, in bytes; 0 if unknown
2022-06-21 18:10:07 +00:00
remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_completed:Bool uploaded_size:int53 = RemoteFile;
2018-08-30 14:55:42 +00:00
//@description Represents a file
//@id Unique file identifier
2022-11-07 18:50:52 +00:00
//@dc_id File data center
2021-12-30 05:55:02 +00:00
//@size File size, in bytes; 0 if unknown
//@expected_size Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress
2018-08-30 14:55:42 +00:00
//@local Information about the local copy of the file
//@remote Information about the remote copy of the file
2022-06-21 18:10:07 +00:00
file id:int32 dc_id:int32 size:int53 expected_size:int53 local:localFile remote:remoteFile = File;
2018-08-30 14:55:42 +00:00
//@class InputFile @description Points to a file
//@description A file defined by its unique ID @id Unique file identifier
inputFileId id:int32 = InputFile;
2020-02-03 12:56:20 +00:00
//@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.
2020-11-30 09:33:47 +00:00
//-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
2020-02-03 12:56:20 +00:00
//@id Remote file identifier
2018-08-30 14:55:42 +00:00
inputFileRemote id:string = InputFile;
//@description A file defined by a local path @path Local path to the file
inputFileLocal path:string = InputFile;
2022-12-30 18:28:59 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@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
2022-06-21 18:10:07 +00:00
inputFileGenerated original_path:string conversion:string expected_size:int53 = InputFile;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@progressive_sizes Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes
2020-11-30 09:33:47 +00:00
photoSize type:string photo:file width:int32 height:int32 progressive_sizes:vector<int32> = PhotoSize;
2018-08-30 14:55:42 +00:00
2019-09-10 12:36:54 +00:00
//@description Thumbnail image of a very poor quality and low resolution @width Thumbnail width, usually doesn't exceed 40 @height Thumbnail height, usually doesn't exceed 40 @data The thumbnail in JPEG format
minithumbnail width:int32 height:int32 data:bytes = Minithumbnail;
2018-08-30 14:55:42 +00:00
2022-02-06 18:36:17 +00:00
//@class ThumbnailFormat @description Describes format of a thumbnail
2020-11-30 09:33:47 +00:00
//@description The thumbnail is in JPEG format
thumbnailFormatJpeg = ThumbnailFormat;
//@description The thumbnail is in static GIF format. It will be used only for some bot inline results
thumbnailFormatGif = ThumbnailFormat;
//@description The thumbnail is in MPEG4 format. It will be used only for some animations and videos
thumbnailFormatMpeg4 = ThumbnailFormat;
2022-02-06 18:36:17 +00:00
//@description The thumbnail is in PNG format. It will be used only for background patterns
thumbnailFormatPng = ThumbnailFormat;
//@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;
2020-11-30 09:33:47 +00:00
2022-12-30 18:28:59 +00:00
//@description Represents a thumbnail
//@format Thumbnail format
//@width Thumbnail width
//@height Thumbnail height
//@file The thumbnail
2020-11-30 09:33:47 +00:00
thumbnail format:ThumbnailFormat width:int32 height:int32 file:file = Thumbnail;
2021-12-30 05:55:02 +00:00
//@class MaskPoint @description Part of the face, relative to which a mask is placed
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description The mask is placed relatively to the forehead
2018-08-30 14:55:42 +00:00
maskPointForehead = MaskPoint;
2021-12-30 05:55:02 +00:00
//@description The mask is placed relatively to the eyes
2018-08-30 14:55:42 +00:00
maskPointEyes = MaskPoint;
2021-12-30 05:55:02 +00:00
//@description The mask is placed relatively to the mouth
2018-08-30 14:55:42 +00:00
maskPointMouth = MaskPoint;
2021-12-30 05:55:02 +00:00
//@description The mask is placed relatively to the chin
2018-08-30 14:55:42 +00:00
maskPointChin = MaskPoint;
2022-12-30 18:28:59 +00:00
//@description Position on a photo where a mask is placed
//@point Part of the face, relative to which the mask is placed
2018-08-30 14:55:42 +00:00
//@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;
2022-08-13 15:24:07 +00:00
//@class StickerFormat @description Describes format of a sticker
2022-02-06 18:36:17 +00:00
//@description The sticker is an image in WEBP format
2022-08-13 15:24:07 +00:00
stickerFormatWebp = StickerFormat;
2022-02-06 18:36:17 +00:00
//@description The sticker is an animation in TGS format
2022-08-13 15:24:07 +00:00
stickerFormatTgs = StickerFormat;
2022-02-06 18:36:17 +00:00
//@description The sticker is a video in WEBM format
2022-08-13 15:24:07 +00:00
stickerFormatWebm = StickerFormat;
//@class StickerType @description Describes type of a sticker
//@description The sticker is a regular sticker
stickerTypeRegular = StickerType;
2022-02-06 18:36:17 +00:00
2022-08-13 15:24:07 +00:00
//@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;
2022-02-06 18:36:17 +00:00
2022-12-30 18:28:59 +00:00
//@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
2023-02-04 22:54:46 +00:00
//@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, or another appropriate color in other places.
//-The sticker must not be repainted on chat photos
2022-12-30 18:28:59 +00:00
stickerFullTypeCustomEmoji custom_emoji_id:int64 needs_repainting:Bool = StickerFullType;
2021-12-30 05:55:02 +00:00
//@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<VectorPathCommand> = ClosedVectorPath;
2022-12-30 18:28:59 +00:00
//@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
2019-06-07 10:56:06 +00:00
pollOption text:string voter_count:int32 vote_percentage:int32 is_chosen:Bool is_being_chosen:Bool = PollOption;
2020-02-03 12:56:20 +00:00
//@class PollType @description Describes the type of a poll
//@description A regular poll @allow_multiple_answers True, if multiple answer options can be chosen simultaneously
pollTypeRegular allow_multiple_answers:Bool = PollType;
2020-11-30 09:33:47 +00:00
//@description A poll in quiz mode, which has exactly one correct answer option and can be answered only once
//@correct_option_id 0-based identifier of the correct answer option; -1 for a yet unanswered poll
2021-12-30 05:55:02 +00:00
//@explanation Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll
2020-11-30 09:33:47 +00:00
pollTypeQuiz correct_option_id:int32 explanation:formattedText = PollType;
2020-02-03 12:56:20 +00:00
2022-12-30 18:28:59 +00:00
//@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"
2020-11-30 09:33:47 +00:00
//@has_stickers True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets
2022-12-30 18:28:59 +00:00
//@minithumbnail Animation minithumbnail; may be null
//@thumbnail Animation thumbnail in JPEG or MPEG4 format; may be null
//@animation File containing the animation
2020-11-30 09:33:47 +00:00
animation duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool minithumbnail:minithumbnail thumbnail:thumbnail animation:file = Animation;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2022-08-13 15:24:07 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@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
2022-08-13 15:24:07 +00:00
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<thumbnail> audio:file = Audio;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2020-11-30 09:33:47 +00:00
document file_name:string mime_type:string minithumbnail:minithumbnail thumbnail:thumbnail document:file = Document;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2019-09-10 12:36:54 +00:00
photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector<photoSize> = Photo;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Describes a sticker
2023-02-04 22:54:46 +00:00
//@id Unique sticker identifier within the set; 0 if none
2022-12-30 18:28:59 +00:00
//@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
//@format Sticker format
//@full_type Sticker's full type
2022-08-13 15:24:07 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@thumbnail Sticker thumbnail in WEBP or JPEG format; may be null
//@sticker File containing the sticker
2023-02-04 22:54:46 +00:00
sticker id:int64 set_id:int64 width:int32 height:int32 emoji:string format:StickerFormat full_type:StickerFullType outline:vector<closedVectorPath> thumbnail:thumbnail sticker:file = Sticker;
2022-12-30 18:28:59 +00:00
//@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
2020-11-30 09:33:47 +00:00
//@has_stickers True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets
2022-12-30 18:28:59 +00:00
//@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
2020-11-30 09:33:47 +00:00
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;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2022-11-07 18:50:52 +00:00
videoNote duration:int32 waveform:bytes length:int32 minithumbnail:minithumbnail thumbnail:thumbnail speech_recognition_result:SpeechRecognitionResult video:file = VideoNote;
2018-08-30 14:55:42 +00:00
2022-06-21 18:10:07 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@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
2022-08-13 15:24:07 +00:00
voiceNote duration:int32 waveform:bytes mime_type:string speech_recognition_result:SpeechRecognitionResult voice:file = VoiceNote;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@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
2022-11-07 18:50:52 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none
2022-08-13 15:24:07 +00:00
//@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
2022-11-07 18:50:52 +00:00
animatedEmoji sticker:sticker sticker_width:int32 sticker_height:int32 fitzpatrick_type:int32 sound:file = AnimatedEmoji;
2021-12-30 05:55:02 +00:00
2022-12-30 18:28:59 +00:00
//@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
2023-02-04 22:54:46 +00:00
//@user_id Identifier of the user, if known; 0 otherwise
2021-12-30 05:55:02 +00:00
contact phone_number:string first_name:string last_name:string vcard:string user_id:int53 = Contact;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2020-11-30 09:33:47 +00:00
//@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;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2018-09-05 21:45:29 +00:00
venue location:location title:string address:string provider:string id:string type:string = Venue;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Describes a game
//@id Unique game identifier
//@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
2018-08-30 14:55:42 +00:00
game id:int64 short_name:string title:string text:formattedText description:string photo:photo animation:animation = Game;
2022-12-30 18:28:59 +00:00
//@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
2021-12-30 05:55:02 +00:00
poll id:int64 question:string options:vector<pollOption> total_voter_count:int32 recent_voter_user_ids:vector<int53> is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll;
2019-06-07 10:56:06 +00:00
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2020-11-30 09:33:47 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@minithumbnail User profile photo minithumbnail; may be null
2020-11-30 09:33:47 +00:00
//@has_animation True, if the photo has animated variant
2022-12-30 18:28:59 +00:00
//@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;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@minithumbnail Chat photo minithumbnail; may be null
2020-11-30 09:33:47 +00:00
//@has_animation True, if the photo has animated variant
2022-12-30 18:28:59 +00:00
//@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;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@class UserType @description Represents the type of a user. The following types are possible: regular users, deleted users and bots
2018-08-30 14:55:42 +00:00
//@description A regular user
userTypeRegular = UserType;
2020-02-03 12:56:20 +00:00
//@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
2018-08-30 14:55:42 +00:00
userTypeDeleted = UserType;
2022-04-24 20:33:39 +00:00
//@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
2018-08-30 14:55:42 +00:00
//@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
2022-04-24 20:33:39 +00:00
//@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 menu
userTypeBot 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;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@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
2018-08-30 14:55:42 +00:00
userTypeUnknown = UserType;
2020-11-30 09:33:47 +00:00
//@description Represents a command supported by a bot @command Text of the bot command @param_description Description of the bot command
2018-08-30 14:55:42 +00:00
botCommand command:string description:string = BotCommand;
2021-12-30 05:55:02 +00:00
//@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<botCommand> = BotCommands;
2018-08-30 14:55:42 +00:00
2022-04-24 20:33:39 +00:00
//@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;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@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;
2023-02-04 22:54:46 +00:00
//@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;
2020-11-30 09:33:47 +00:00
//@description Animated variant of a chat photo in MPEG4 format
//@length Animation width and height
//@file Information about the animation file
//@main_frame_timestamp Timestamp of the frame, used as a static chat photo
animatedChatPhoto length:int32 file:file main_frame_timestamp:double = AnimatedChatPhoto;
//@description Describes a chat or user profile photo
//@id Unique photo identifier
//@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
2023-02-04 22:54:46 +00:00
//@animation A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null
2022-06-21 18:10:07 +00:00
//@small_animation A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available
2023-02-04 22:54:46 +00:00
//@sticker Sticker-based version of the chat photo; may be null
chatPhoto id:int64 added_date:int32 minithumbnail:minithumbnail sizes:vector<photoSize> animation:animatedChatPhoto small_animation:animatedChatPhoto sticker:chatPhotoSticker = ChatPhoto;
2020-11-30 09:33:47 +00:00
//@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<chatPhoto> = ChatPhotos;
//@class InputChatPhoto @description Describes a photo to be set as a user profile or chat photo
2021-12-30 05:55:02 +00:00
//@description A previously used profile photo of the current user @chat_photo_id Identifier of the current user's profile photo to reuse
2020-11-30 09:33:47 +00:00
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;
2023-02-04 22:54:46 +00:00
//@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
2020-11-30 09:33:47 +00:00
//@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;
2023-02-04 22:54:46 +00:00
//@description A sticker on a custom background @sticker Information about the sticker
inputChatPhotoSticker sticker:chatPhotoSticker = InputChatPhoto;
2020-11-30 09:33:47 +00:00
2022-04-24 20:33:39 +00:00
//@description Describes actions that a user is allowed to take in a chat
2023-02-04 22:54:46 +00:00
//@can_send_messages True, if the user can send text messages, contacts, 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 audio photos
//@can_send_videos True, if the user can send audio 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
2022-04-24 20:33:39 +00:00
//@can_send_stickers True, if the user can send stickers. Implies can_send_messages permissions
//@can_send_animations True, if the user can send animations. Implies can_send_messages permissions
//@can_send_games True, if the user can send games. Implies can_send_messages permissions
//@can_use_inline_bots True, if the user can use inline bots. Implies can_send_messages permissions
2023-02-04 22:54:46 +00:00
//@can_add_web_page_previews True, if the user may add a web page preview to their messages
2022-04-24 20:33:39 +00:00
//@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
2022-11-07 18:50:52 +00:00
//@can_manage_topics True, if the user can manage topics
2023-02-04 22:54:46 +00:00
chatPermissions can_send_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_stickers:Bool can_send_animations:Bool can_send_games:Bool can_use_inline_bots:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool can_manage_topics:Bool = ChatPermissions;
2022-04-24 20:33:39 +00:00
//@description Describes rights of the administrator
//@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
2022-11-07 18:50:52 +00:00
//@can_manage_topics True, if the administrator can manage topics; applicable to forum supergroups only
2022-04-24 20:33:39 +00:00
//@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
2022-11-07 18:50:52 +00:00
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 is_anonymous:Bool = ChatAdministratorRights;
2022-04-24 20:33:39 +00:00
2022-09-18 01:34:29 +00:00
//@description Describes an option for buying Telegram Premium to a user
2022-08-13 15:24:07 +00:00
//@currency ISO 4217 currency code for Telegram Premium subscription payment
//@amount The amount to pay, in the smallest units of the currency
2022-09-18 01:34:29 +00:00
//@discount_percentage The discount associated with this option, as a percentage
2022-08-13 15:24:07 +00:00
//@month_count Number of month the Telegram Premium subscription will be active
//@store_product_id Identifier of the store product associated with the option
2022-09-18 01:34:29 +00:00
//@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;
2023-02-04 22:54:46 +00:00
//@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;
2022-11-07 18:50:52 +00:00
2022-12-30 18:28:59 +00:00
//@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
2022-09-18 01:34:29 +00:00
emojiStatus custom_emoji_id:int64 = EmojiStatus;
//@description Contains a list of emoji statuses @emoji_statuses The list of emoji statuses
emojiStatuses emoji_statuses:vector<emojiStatus> = EmojiStatuses;
2022-08-13 15:24:07 +00:00
2022-11-07 18:50:52 +00:00
//@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 or reorderSupergroupActiveUsernames
//@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive
//@editable_username The active username, which can be changed with setUsername/setSupergroupUsername
usernames active_usernames:vector<string> disabled_usernames:vector<string> editable_username:string = Usernames;
2020-11-30 09:33:47 +00:00
//@description Represents a user
//@id User identifier
2022-01-26 21:05:08 +00:00
//@access_hash User access hash
2020-11-30 09:33:47 +00:00
//@first_name First name of the user
//@last_name Last name of the user
2022-11-07 18:50:52 +00:00
//@usernames Usernames of the user; may be null
2020-11-30 09:33:47 +00:00
//@phone_number Phone number of the user
//@status Current online status of the user
//@profile_photo Profile photo of the user; may be null
2022-09-18 01:34:29 +00:00
//@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only
2020-02-03 12:56:20 +00:00
//@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
2020-11-30 09:33:47 +00:00
//@is_verified True, if the user is verified
2022-06-21 18:10:07 +00:00
//@is_premium True, if the user is a Telegram Premium user
2020-11-30 09:33:47 +00:00
//@is_support True, if the user is Telegram support account
2020-02-03 12:56:20 +00:00
//@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted
2019-09-10 12:36:54 +00:00
//@is_scam True, if many users reported this user as a scam
2021-12-30 05:55:02 +00:00
//@is_fake True, if many users reported this user as a fake account
2022-12-07 20:04:16 +00:00
//@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
2020-11-30 09:33:47 +00:00
//@type Type of the user
//@language_code IETF language tag of the user's language; only available to bots
2022-06-21 18:10:07 +00:00
//@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots
2022-12-30 18:28:59 +00:00
user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
2022-04-24 20:33:39 +00:00
//@description Contains information about a bot
//@share_text 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
2022-06-21 18:10:07 +00:00
//@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
2022-04-24 20:33:39 +00:00
//@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
2022-06-21 18:10:07 +00:00
botInfo share_text:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector<botCommand> default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo;
2020-11-30 09:33:47 +00:00
//@description Contains full information about a user
2023-02-04 22:54:46 +00:00
//@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
2020-11-30 09:33:47 +00:00
//@is_blocked True, if the user is blocked by the current user
//@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
2021-12-30 05:55:02 +00:00
//@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings
2022-08-13 15:24:07 +00:00
//@has_restricted_voice_and_video_note_messages True, if voice and video notes can't be sent or forwarded to the user
2020-02-03 12:56:20 +00:00
//@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
2022-06-21 18:10:07 +00:00
//@bio A short user bio; may be null for bots
2022-08-13 15:24:07 +00:00
//@premium_gift_options The list of available options for gifting Telegram Premium to the user
2020-11-30 09:33:47 +00:00
//@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
2022-04-24 20:33:39 +00:00
//@bot_info For bots, information about the bot; may be null
2022-12-30 18:28:59 +00:00
userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector<premiumPaymentOption> group_in_common_count:int32 bot_info:botInfo = UserFullInfo;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers
2021-12-30 05:55:02 +00:00
users total_count:int32 user_ids:vector<int53> = Users;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Contains information about a chat administrator @user_id User identifier of the administrator @custom_title Custom title of the administrator @is_owner True, if the user is the owner of the chat
2021-12-30 05:55:02 +00:00
chatAdministrator user_id:int53 custom_title:string is_owner:Bool = ChatAdministrator;
2020-02-03 12:56:20 +00:00
//@description Represents a list of chat administrators @administrators A list of chat administrators
chatAdministrators administrators:vector<chatAdministrator> = ChatAdministrators;
2018-08-30 14:55:42 +00:00
//@class ChatMemberStatus @description Provides information about the status of a member in a chat
2021-12-30 05:55:02 +00:00
//@description The user is the owner of the chat and has all the administrator privileges
2020-02-03 12:56:20 +00:00
//@custom_title A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only
2020-11-30 09:33:47 +00:00
//@is_anonymous True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only
2020-02-03 12:56:20 +00:00
//@is_member True, if the user is a member of the chat
2020-11-30 09:33:47 +00:00
chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = ChatMemberStatus;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2020-02-03 12:56:20 +00:00
//@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only
2018-08-30 14:55:42 +00:00
//@can_be_edited True, if the current user can edit the administrator privileges for the called user
2022-04-24 20:33:39 +00:00
//@rights Rights of the administrator
chatMemberStatusAdministrator custom_title:string can_be_edited:Bool rights:chatAdministratorRights = ChatMemberStatus;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description The user is a member of the chat, without any additional privileges or restrictions
2018-08-30 14:55:42 +00:00
chatMemberStatusMember = ChatMemberStatus;
//@description The user is under certain restrictions in the chat. Not supported in basic groups and channels
//@is_member True, if the user is a member of the chat
//@restricted_until_date Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever
2019-09-10 12:36:54 +00:00
//@permissions User permissions in the chat
chatMemberStatusRestricted is_member:Bool restricted_until_date:int32 permissions:chatPermissions = ChatMemberStatus;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description The user or the chat is not a chat member
2018-08-30 14:55:42 +00:00
chatMemberStatusLeft = ChatMemberStatus;
2021-12-30 05:55:02 +00:00
//@description The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat
//@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups
2018-08-30 14:55:42 +00:00
chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus;
2021-12-30 05:55:02 +00:00
//@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
2020-11-30 09:33:47 +00:00
//@inviter_user_id Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown
2022-12-07 20:04:16 +00:00
//@joined_chat_date Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat
2020-11-30 09:33:47 +00:00
//@status Status of the member in the chat
2021-12-30 05:55:02 +00:00
chatMember member_id:MessageSender inviter_user_id:int53 joined_chat_date:int32 status:ChatMemberStatus = ChatMember;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Contains a list of chat members @total_count Approximate total number of chat members found @members A list of chat members
2018-08-30 14:55:42 +00:00
chatMembers total_count:int32 members:vector<chatMember> = ChatMembers;
2018-09-05 21:45:29 +00:00
//@class ChatMembersFilter @description Specifies the kind of chat members to return in searchChatMembers
2019-09-10 12:36:54 +00:00
//@description Returns contacts of the user
chatMembersFilterContacts = ChatMembersFilter;
2020-02-03 12:56:20 +00:00
//@description Returns the owner and administrators
2018-09-05 21:45:29 +00:00
chatMembersFilterAdministrators = ChatMembersFilter;
//@description Returns all chat members, including restricted chat members
chatMembersFilterMembers = ChatMembersFilter;
2020-11-30 09:33:47 +00:00
//@description Returns users which can be mentioned in the chat @message_thread_id If non-zero, the identifier of the current message thread
chatMembersFilterMention message_thread_id:int53 = ChatMembersFilter;
2018-09-05 21:45:29 +00:00
//@description Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup
chatMembersFilterRestricted = ChatMembersFilter;
//@description Returns users banned from the chat; can be used only by administrators in a supergroup or in a channel
chatMembersFilterBanned = ChatMembersFilter;
//@description Returns bot members of the chat
chatMembersFilterBots = ChatMembersFilter;
2018-08-30 14:55:42 +00:00
//@class SupergroupMembersFilter @description Specifies the kind of chat members to return in getSupergroupMembers
//@description Returns recently active users in reverse chronological order
supergroupMembersFilterRecent = SupergroupMembersFilter;
2019-09-10 12:36:54 +00:00
//@description Returns contacts of the user, which are members of the supergroup or channel @query Query to search for
supergroupMembersFilterContacts query:string = SupergroupMembersFilter;
2020-02-03 12:56:20 +00:00
//@description Returns the owner and administrators
2018-08-30 14:55:42 +00:00
supergroupMembersFilterAdministrators = SupergroupMembersFilter;
//@description Used to search for supergroup or channel members via a (string) query @query Query to search for
supergroupMembersFilterSearch query:string = SupergroupMembersFilter;
//@description Returns restricted supergroup members; can be used only by administrators @query Query to search for
supergroupMembersFilterRestricted query:string = SupergroupMembersFilter;
//@description Returns users banned from the supergroup or channel; can be used only by administrators @query Query to search for
supergroupMembersFilterBanned query:string = SupergroupMembersFilter;
2020-11-30 09:33:47 +00:00
//@description Returns users which can be mentioned in the supergroup @query Query to search for @message_thread_id If non-zero, the identifier of the current message thread
supergroupMembersFilterMention query:string message_thread_id:int53 = SupergroupMembersFilter;
2018-08-30 14:55:42 +00:00
//@description Returns bot members of the supergroup or channel
supergroupMembersFilterBots = SupergroupMembersFilter;
2021-12-30 05:55:02 +00:00
//@description Contains a chat invite link
//@invite_link Chat invite link
//@name Name of the link
//@creator_user_id User identifier of an administrator created the link
//@date Point in time (Unix timestamp) when the link was created
//@edit_date Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown
//@expiration_date Point in time (Unix timestamp) when the link will expire; 0 if never
//@member_limit The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval
//@member_count Number of chat members, which joined the chat using the link
//@pending_join_request_count Number of pending join requests created using this link
//@creates_join_request True, if the link only creates join request. If true, total number of joining members will be unlimited
//@is_primary True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time
//@is_revoked True, if the link was revoked
chatInviteLink invite_link:string name:string creator_user_id:int53 date:int32 edit_date:int32 expiration_date:int32 member_limit:int32 member_count:int32 pending_join_request_count:int32 creates_join_request:Bool is_primary:Bool is_revoked:Bool = ChatInviteLink;
2022-03-13 04:04:12 +00:00
//@description Contains a list of chat invite links @total_count Approximate total number of chat invite links found @invite_links List of invite links
2021-12-30 05:55:02 +00:00
chatInviteLinks total_count:int32 invite_links:vector<chatInviteLink> = ChatInviteLinks;
//@description Describes a chat administrator with a number of active and revoked chat invite links
//@user_id Administrator's user identifier
//@invite_link_count Number of active invite links
//@revoked_invite_link_count Number of revoked invite links
chatInviteLinkCount user_id:int53 invite_link_count:int32 revoked_invite_link_count:int32 = ChatInviteLinkCount;
//@description Contains a list of chat invite link counts @invite_link_counts List of invite link counts
chatInviteLinkCounts invite_link_counts:vector<chatInviteLinkCount> = 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;
2022-03-13 04:04:12 +00:00
//@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
2021-12-30 05:55:02 +00:00
chatInviteLinkMembers total_count:int32 members:vector<chatInviteLinkMember> = ChatInviteLinkMembers;
//@description Contains information about a chat invite link
//@chat_id Chat identifier of the invite link; 0 if the user has no access to the chat before joining
//@accessible_for If non-zero, the amount of time for which read access to the chat will remain available, in seconds
//@type Type of the chat
//@title Title of the chat
//@photo Chat photo; may be null
//@param_description Chat description
//@member_count Number of members in the chat
//@member_user_ids User identifiers of some chat members that may be known to the current user
//@creates_join_request True, if the link only creates join request
//@is_public True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup
chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string photo:chatPhotoInfo description:string member_count:int32 member_user_ids:vector<int53> creates_join_request:Bool is_public:Bool = ChatInviteLinkInfo;
//@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user
chatJoinRequest user_id:int53 date:int32 bio:string = ChatJoinRequest;
2022-03-13 04:04:12 +00:00
//@description Contains a list of requests to join a chat @total_count Approximate total number of requests found @requests List of the requests
2021-12-30 05:55:02 +00:00
chatJoinRequests total_count:int32 requests:vector<chatJoinRequest> = ChatJoinRequests;
//@description Contains information about pending join requests for a chat @total_count Total number of pending join requests @user_ids Identifiers of at most 3 users sent the newest pending join requests
chatJoinRequestsInfo total_count:int32 user_ids:vector<int53> = ChatJoinRequestsInfo;
2018-08-30 14:55:42 +00:00
//@description Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)
//@id Group identifier
2022-01-26 21:05:08 +00:00
//@access_hash Group access hash
2018-08-30 14:55:42 +00:00
//@member_count Number of members in the group
//@status Status of the current user in the group
//@is_active True, if the group is active
//@upgraded_to_supergroup_id Identifier of the supergroup to which this group was upgraded; 0 if none
2022-01-26 21:05:08 +00:00
basicGroup id:int53 access_hash:int64 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int53 = BasicGroup;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Contains full information about a basic group
2022-11-07 18:50:52 +00:00
//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
2021-12-30 05:55:02 +00:00
//@param_description Group description. Updated only after the basic group is opened
2020-11-30 09:33:47 +00:00
//@creator_user_id User identifier of the creator of the group; 0 if unknown
//@members Group members
2022-12-30 18:28:59 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@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
2022-12-30 18:28:59 +00:00
basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 members:vector<chatMember> can_hide_members:Bool can_toggle_aggressive_anti_spam:Bool invite_link:chatInviteLink bot_commands:vector<botCommands> = BasicGroupFullInfo;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
2018-08-30 14:55:42 +00:00
//@id Supergroup or channel identifier
2022-01-26 21:05:08 +00:00
//@access_hash Supergroup or channel access hash
2022-11-07 18:50:52 +00:00
//@usernames Usernames of the supergroup or channel; may be null
2018-08-30 14:55:42 +00:00
//@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
2022-11-07 18:50:52 +00:00
//@status Status of the current user in the supergroup or channel; custom title will always be empty
2022-12-30 18:28:59 +00:00
//@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
2020-02-03 12:56:20 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@sign_messages True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels
2022-06-21 18:10:07 +00:00
//@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
2020-02-03 12:56:20 +00:00
//@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup
2018-08-30 14:55:42 +00:00
//@is_channel True, if the supergroup is a channel
2021-12-30 05:55:02 +00:00
//@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
2022-11-07 18:50:52 +00:00
//@is_forum True, if the supergroup must be shown as a forum by default
2018-08-30 14:55:42 +00:00
//@is_verified True, if the supergroup or channel is verified
2020-02-03 12:56:20 +00:00
//@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
2021-12-30 05:55:02 +00:00
//@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
2022-11-07 18:50:52 +00:00
supergroup id:int53 access_hash:int64 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 = Supergroup;
2018-08-30 14:55:42 +00:00
//@description Contains full information about a supergroup or channel
2022-11-07 18:50:52 +00:00
//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
2018-08-30 14:55:42 +00:00
//@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
//@restricted_count Number of restricted users in the supergroup; 0 if unknown
//@banned_count Number of users banned from chat; 0 if unknown
2020-02-03 12:56:20 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@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
2020-02-03 12:56:20 +00:00
//@can_set_username True, if the chat username can be changed
2018-08-30 14:55:42 +00:00
//@can_set_sticker_set True, if the supergroup sticker set can be changed
2020-02-03 12:56:20 +00:00
//@can_set_location True, if the supergroup location can be changed
2020-11-30 09:33:47 +00:00
//@can_get_statistics True, if the supergroup or channel statistics are available
2022-12-30 18:28:59 +00:00
//@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
2018-08-30 14:55:42 +00:00
//@sticker_set_id Identifier of the supergroup sticker set; 0 if none
2020-02-03 12:56:20 +00:00
//@location Location to which the supergroup is connected; may be null
2022-02-06 18:36:17 +00:00
//@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only
2021-12-30 05:55:02 +00:00
//@bot_commands List of commands of bots in the group
2018-08-30 14:55:42 +00:00
//@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
2022-12-30 18:28:59 +00:00
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_username: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 sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector<botCommands> upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo;
2018-08-30 14:55:42 +00:00
//@class SecretChatState @description Describes the current secret chat state
//@description The secret chat is not yet created; waiting for the other user to get online
secretChatStatePending = SecretChatState;
//@description The secret chat is ready to use
secretChatStateReady = SecretChatState;
//@description The secret chat is closed
secretChatStateClosed = SecretChatState;
//@description Represents a secret chat
//@id Secret chat identifier
//@user_id Identifier of the chat partner
//@state State of the secret chat
2023-02-04 22:54:46 +00:00
//@is_outbound True, if the chat was created by the current user; false otherwise
2020-02-03 12:56:20 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@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
2021-12-30 05:55:02 +00:00
secretChat id:int32 user_id:int53 state:SecretChatState is_outbound:Bool key_hash:bytes layer:int32 = SecretChat;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@class MessageSender @description Contains information about the sender of a message
//@description The message was sent by a known user @user_id Identifier of the user that sent the message
2021-12-30 05:55:02 +00:00
messageSenderUser user_id:int53 = MessageSender;
2020-11-30 09:33:47 +00:00
//@description The message was sent on behalf of a chat @chat_id Identifier of the chat that sent the message
messageSenderChat chat_id:int53 = MessageSender;
2022-03-13 04:04:12 +00:00
//@description Represents a list of message senders @total_count Approximate total number of messages senders found @senders List of message senders
2020-11-30 09:33:47 +00:00
messageSenders total_count:int32 senders:vector<MessageSender> = MessageSenders;
2022-11-07 18:50:52 +00:00
//@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<chatMessageSender> = ChatMessageSenders;
2019-06-07 10:56:06 +00:00
//@class MessageForwardOrigin @description Contains information about the origin of a forwarded message
2020-11-30 09:33:47 +00:00
//@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message
2021-12-30 05:55:02 +00:00
messageForwardOriginUser sender_user_id:int53 = MessageForwardOrigin;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description The message was originally sent on behalf of a chat
2020-11-30 09:33:47 +00:00
//@sender_chat_id Identifier of the chat that originally sent the message
2021-12-30 05:55:02 +00:00
//@author_signature For messages originally sent by an anonymous chat administrator, original message author signature
2020-11-30 09:33:47 +00:00
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
2019-06-07 10:56:06 +00:00
messageForwardOriginHiddenUser sender_name:string = MessageForwardOrigin;
2018-08-30 14:55:42 +00:00
2019-06-07 10:56:06 +00:00
//@description The message was originally a post in a channel
//@chat_id Identifier of the chat from which the message was originally forwarded
2020-11-30 09:33:47 +00:00
//@message_id Message identifier of the original message
2019-06-07 10:56:06 +00:00
//@author_signature Original post author signature
messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin;
2021-12-30 05:55:02 +00:00
//@description The message was imported from an exported message history @sender_name Name of the sender
messageForwardOriginMessageImport sender_name:string = MessageForwardOrigin;
2019-06-07 10:56:06 +00:00
2022-09-18 01:34:29 +00:00
//@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;
2019-06-07 10:56:06 +00:00
//@description Contains information about a forwarded message
//@origin Origin of a forwarded message
//@date Point in time (Unix timestamp) when the message was originally sent
2020-11-30 09:33:47 +00:00
//@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;
//@description Contains information about replies to a message
//@reply_count Number of times the message was directly or indirectly replied
2021-12-30 05:55:02 +00:00
//@recent_replier_ids Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available
2020-11-30 09:33:47 +00:00
//@last_read_inbox_message_id Identifier of the last read incoming reply to the message
//@last_read_outbox_message_id Identifier of the last read outgoing reply to the message
//@last_message_id Identifier of the last reply to the message
2021-12-30 05:55:02 +00:00
messageReplyInfo reply_count:int32 recent_replier_ids:vector<MessageSender> last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 last_message_id:int53 = MessageReplyInfo;
2020-11-30 09:33:47 +00:00
2022-02-06 18:36:17 +00:00
//@description Contains information about a reaction to a message
2022-09-18 01:34:29 +00:00
//@type Type of the reaction
2022-02-06 18:36:17 +00:00
//@total_count Number of times the reaction was added
//@is_chosen True, if the reaction is chosen by the current user
2022-04-24 20:33:39 +00:00
//@recent_sender_ids Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats
2022-09-18 01:34:29 +00:00
messageReaction type:ReactionType total_count:int32 is_chosen:Bool recent_sender_ids:vector<MessageSender> = MessageReaction;
2022-02-06 18:36:17 +00:00
2020-11-30 09:33:47 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@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
2022-02-06 18:36:17 +00:00
//@reactions The list of reactions added to the message
messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo reactions:vector<messageReaction> = MessageInteractionInfo;
//@description Contains information about an unread reaction to a message
2022-09-18 01:34:29 +00:00
//@type Type of the reaction
2022-02-06 18:36:17 +00:00
//@sender_id Identifier of the sender, added the reaction
//@is_big True, if the reaction was added with a big animation
2022-09-18 01:34:29 +00:00
unreadReaction type:ReactionType sender_id:MessageSender is_big:Bool = UnreadReaction;
2018-08-30 14:55:42 +00:00
//@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;
2022-12-30 18:28:59 +00:00
//@description The message failed to be sent
//@error_code An error code; 0 if unknown
//@error_message Error message
2021-12-30 05:55:02 +00:00
//@can_retry True, if the message can be re-sent
//@need_another_sender True, if the message can be re-sent only on behalf of a different sender
//@retry_after Time left before the message can be re-sent, in seconds. No update is sent when this field changes
messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool need_another_sender:Bool retry_after:double = MessageSendingState;
2018-08-30 14:55:42 +00:00
//@description Describes a message
2020-11-30 09:33:47 +00:00
//@id Message identifier; unique for the chat to which the message belongs
2021-12-30 05:55:02 +00:00
//@sender_id Identifier of the sender of the message
2018-08-30 14:55:42 +00:00
//@chat_id Chat identifier
2021-12-30 05:55:02 +00:00
//@sending_state The sending state of the message; may be null
//@scheduling_state The scheduling state of the message; may be null
2018-08-30 14:55:42 +00:00
//@is_outgoing True, if the message is outgoing
2020-11-30 09:33:47 +00:00
//@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
2018-08-30 14:55:42 +00:00
//@can_be_forwarded True, if the message can be forwarded
2021-12-30 05:55:02 +00:00
//@can_be_saved True, if content of the message can be saved locally or copied
2018-08-30 14:55:42 +00:00
//@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
2022-02-06 18:36:17 +00:00
//@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
2022-08-13 15:24:07 +00:00
//@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory
2021-12-30 05:55:02 +00:00
//@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers
2022-02-06 18:36:17 +00:00
//@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
2022-09-18 01:34:29 +00:00
//@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions
2021-12-30 05:55:02 +00:00
//@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message
2018-08-30 14:55:42 +00:00
//@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
2022-11-07 18:50:52 +00:00
//@is_topic_message True, if the message is a forum topic message
2018-08-30 14:55:42 +00:00
//@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
2020-11-30 09:33:47 +00:00
//@interaction_info Information about interactions with the message; may be null
2022-02-06 18:36:17 +00:00
//@unread_reactions Information about unread reactions added to the message
2020-11-30 09:33:47 +00:00
//@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
2018-08-30 14:55:42 +00:00
//@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
2020-11-30 09:33:47 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@self_destruct_time The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires
//@self_destruct_in Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field
//@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. TDLib will send updateDeleteMessages or updateMessageContent once the time expires
2018-08-30 14:55:42 +00:00
//@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent
2020-11-30 09:33:47 +00:00
//@author_signature For channel posts and anonymous group messages, optional author signature
2021-12-30 05:55:02 +00:00
//@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums
2020-02-03 12:56:20 +00:00
//@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted
2018-08-30 14:55:42 +00:00
//@content Content of the message
//@reply_markup Reply markup for the message; may be null
2022-12-30 18:28:59 +00:00
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_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 interaction_info:messageInteractionInfo unread_reactions:vector<unreadReaction> reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 self_destruct_time:int32 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;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null
2018-08-30 14:55:42 +00:00
messages total_count:int32 messages:vector<message> = Messages;
2022-03-13 04:04:12 +00:00
//@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
2020-11-30 09:33:47 +00:00
foundMessages total_count:int32 messages:vector<message> next_offset:string = FoundMessages;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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<message> next_from_message_id:int53 = FoundChatMessages;
2021-12-30 05:55:02 +00:00
//@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;
2022-03-13 04:04:12 +00:00
//@description Contains a list of message positions @total_count Total number of messages found @positions List of message positions
2021-12-30 05:55:02 +00:00
messagePositions total_count:int32 positions:vector<messagePosition> = MessagePositions;
//@description Contains information about found messages sent on a specific day @total_count Total number of found messages sent on the day @message First message sent on the day
messageCalendarDay total_count:int32 message:message = MessageCalendarDay;
//@description Contains information about found messages, split by days according to the option "utc_time_offset" @total_count Total number of found messages @days Information about messages sent
messageCalendar total_count:int32 days:vector<messageCalendarDay> = MessageCalendar;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@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
2022-06-21 18:10:07 +00:00
//@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored"
2022-01-26 21:05:08 +00:00
//@sponsor_chat_id Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link
//@sponsor_chat_info Information about the sponsor chat; may be null unless sponsor_chat_id == 0
2022-11-07 18:50:52 +00:00
//@show_chat_photo True, if the sponsor's chat photo must be shown
2022-04-24 20:33:39 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@content Content of the message. Currently, can be only of the type messageText
2022-11-07 18:50:52 +00:00
sponsoredMessage message_id:int53 is_recommended:Bool sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo show_chat_photo:Bool link:InternalLinkType content:MessageContent = 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<sponsoredMessage> messages_between:int32 = SponsoredMessages;
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
//@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<fileDownload> next_offset:string = FoundFileDownloads;
2021-12-30 05:55:02 +00:00
//@class NotificationSettingsScope @description Describes the types of chats to which notification settings are relevant
2018-08-30 14:55:42 +00:00
2018-09-05 21:45:29 +00:00
//@description Notification settings applied to all private and secret chats when the corresponding chat setting has a default value
2018-08-30 14:55:42 +00:00
notificationSettingsScopePrivateChats = NotificationSettingsScope;
2022-04-24 20:33:39 +00:00
//@description Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value
2018-09-05 21:45:29 +00:00
notificationSettingsScopeGroupChats = NotificationSettingsScope;
2018-08-30 14:55:42 +00:00
2022-04-24 20:33:39 +00:00
//@description Notification settings applied to all channel chats when the corresponding chat setting has a default value
2019-06-07 10:56:06 +00:00
notificationSettingsScopeChannelChats = NotificationSettingsScope;
2018-08-30 14:55:42 +00:00
2022-12-07 20:04:16 +00:00
//@description Contains information about notification settings for a chat or a froum topic
2022-12-30 18:28:59 +00:00
//@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; 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_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
2022-04-24 20:33:39 +00:00
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_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings;
2018-08-30 14:55:42 +00:00
2019-06-07 10:56:06 +00:00
//@description Contains information about notification settings for several chats
//@mute_for Time left before notifications will be unmuted, in seconds
2022-04-24 20:33:39 +00:00
//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled
2021-12-30 05:55:02 +00:00
//@show_preview True, if message content must be displayed in notifications
2019-06-07 10:56:06 +00:00
//@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
2022-04-24 20:33:39 +00:00
scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Contains information about a message draft
2022-04-24 20:33:39 +00:00
//@reply_to_message_id Identifier of the replied message; 0 if none
2020-11-30 09:33:47 +00:00
//@date Point in time (Unix timestamp) when the draft was created
2021-12-30 05:55:02 +00:00
//@input_message_text Content of the message draft; must be of the type inputMessageText
2020-11-30 09:33:47 +00:00
draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage;
2018-08-30 14:55:42 +00:00
//@class ChatType @description Describes the type of a chat
//@description An ordinary chat with a user @user_id User identifier
2021-12-30 05:55:02 +00:00
chatTypePrivate user_id:int53 = ChatType;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A basic group (a chat with 0-200 other users) @basic_group_id Basic group identifier
chatTypeBasicGroup basic_group_id:int53 = ChatType;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A supergroup or channel (with unlimited members) @supergroup_id Supergroup or channel identifier @is_channel True, if the supergroup is a channel
chatTypeSupergroup supergroup_id:int53 is_channel:Bool = ChatType;
2018-08-30 14:55:42 +00:00
//@description A secret chat with a user @secret_chat_id Secret chat identifier @user_id User identifier of the secret chat peer
2021-12-30 05:55:02 +00:00
chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Represents a filter of user chats
//@title The title of the filter; 1-12 characters without line feeds
2022-12-30 18:28:59 +00:00
//@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", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette".
2020-11-30 09:33:47 +00:00
//-If empty, use getChatFilterDefaultIconName to get default icon name for the filter
2022-12-07 20:04:16 +00:00
//@pinned_chat_ids The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption("chat_filter_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 filtered chat list. There can be up to getOption("chat_filter_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 filtered chat list. There can be up to getOption("chat_filter_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
2020-11-30 09:33:47 +00:00
//@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
//@include_contacts True, if contacts need to be included
//@include_non_contacts True, if non-contact users need to be included
//@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<int53> included_chat_ids:vector<int53> excluded_chat_ids:vector<int53> 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;
//@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
2022-12-30 18:28:59 +00:00
//@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", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette"
2020-11-30 09:33:47 +00:00
chatFilterInfo id:int32 title:string icon_name:string = ChatFilterInfo;
//@description Describes a recommended chat filter @filter The chat filter @param_description Chat filter description
recommendedChatFilter filter:chatFilter description:string = RecommendedChatFilter;
//@description Contains a list of recommended chat filters @chat_filters List of recommended chat filters
recommendedChatFilters chat_filters:vector<recommendedChatFilter> = RecommendedChatFilters;
2020-02-03 12:56:20 +00:00
//@class ChatList @description Describes a list of chats
//@description A main list of chats
chatListMain = ChatList;
//@description A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives
chatListArchive = ChatList;
2020-11-30 09:33:47 +00:00
//@description A list of chats belonging to a chat filter @chat_filter_id Chat filter identifier
chatListFilter chat_filter_id:int32 = ChatList;
//@description Contains a list of chat lists @chat_lists List of chat lists
chatLists chat_lists:vector<ChatList> = ChatLists;
//@class ChatSource @description Describes a reason why an external chat is shown in a chat list
//@description The chat is sponsored by the user's MTProxy server
chatSourceMtprotoProxy = ChatSource;
//@description The chat contains a public service announcement @type The type of the announcement @text The text of the announcement
chatSourcePublicServiceAnnouncement type:string text:string = ChatSource;
//@description Describes a position of a chat in a chat list
//@list The chat list
//@order A parameter used to determine order of the chat in the chat list. Chats must be sorted by the pair (order, chat.id) in descending order
//@is_pinned True, if the chat is pinned in the chat list
//@source Source of the chat in the chat list; may be null
chatPosition list:ChatList order:int64 is_pinned:Bool source:ChatSource = ChatPosition;
2020-02-03 12:56:20 +00:00
2022-09-18 01:34:29 +00:00
//@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<ReactionType> = ChatAvailableReactions;
2021-12-30 05:55:02 +00:00
//@description Describes a video chat
//@group_call_id Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall
//@has_participants True, if the video chat has participants
//@default_participant_id Default group call participant identifier to join the video chat; may be null
videoChat group_call_id:int32 has_participants:Bool default_participant_id:MessageSender = VideoChat;
2018-08-30 14:55:42 +00:00
//@description A chat. (Can be a private chat, basic group, supergroup, or secret chat)
//@id Chat unique identifier
//@type Type of the chat
//@title Chat title
//@photo Chat photo; may be null
2019-09-10 12:36:54 +00:00
//@permissions Actions that non-administrator chat members are allowed to take in the chat
2018-08-30 14:55:42 +00:00
//@last_message Last message in the chat; may be null
2020-11-30 09:33:47 +00:00
//@positions Positions of the chat in chat lists
2021-12-30 05:55:02 +00:00
//@message_sender_id Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender
//@has_protected_content True, if chat content can't be saved locally, forwarded, or copied
2023-02-04 22:54:46 +00:00
//@is_translatable True, if translation of all messages in the chat must be suggested to the user
2018-09-05 21:45:29 +00:00
//@is_marked_as_unread True, if the chat is marked as unread
2020-11-30 09:33:47 +00:00
//@is_blocked True, if the chat is blocked by the current user and private messages from the chat can't be received
2020-02-03 12:56:20 +00:00
//@has_scheduled_messages True, if the chat has scheduled messages
2019-06-07 10:56:06 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@can_be_reported True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto
2018-09-05 21:45:29 +00:00
//@default_disable_notification Default value of the disable_notification parameter, used when a message is sent to the chat
2018-08-30 14:55:42 +00:00
//@unread_count Number of unread messages in the chat
//@last_read_inbox_message_id Identifier of the last read incoming message
//@last_read_outbox_message_id Identifier of the last read outgoing message
//@unread_mention_count Number of unread messages with a mention/reply in the chat
2022-02-06 18:36:17 +00:00
//@unread_reaction_count Number of messages with unread reactions in the chat
//@notification_settings Notification settings for the chat
2022-09-18 01:34:29 +00:00
//@available_reactions Types of reaction, available in the chat
2022-12-30 18:28:59 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@theme_name If non-empty, name of a theme, set for the chat
//@action_bar Information about actions which must be possible to do through the chat action bar; may be null
//@video_chat Information about video chat of the chat
//@pending_join_requests Information about pending join requests; may be null
2018-08-30 14:55:42 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@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
2023-02-04 22:54:46 +00:00
chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector<chatPosition> message_sender_id:MessageSender has_protected_content:Bool is_translatable: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 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time: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;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers
2020-11-30 09:33:47 +00:00
chats total_count:int32 chat_ids:vector<int53> = Chats;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Describes a chat located nearby @chat_id Chat identifier @distance Distance to the chat location, in meters
2020-02-03 12:56:20 +00:00
chatNearby chat_id:int53 distance:int32 = ChatNearby;
//@description Represents a list of chats located nearby @users_nearby List of users nearby @supergroups_nearby List of location-based supergroups nearby
chatsNearby users_nearby:vector<chatNearby> supergroups_nearby:vector<chatNearby> = ChatsNearby;
//@class PublicChatType @description Describes a type of public chats
2022-11-07 18:50:52 +00:00
//@description The chat is public, because it has an active username
2020-02-03 12:56:20 +00:00
publicChatTypeHasUsername = PublicChatType;
//@description The chat is public, because it is a location-based supergroup
publicChatTypeIsLocationBased = PublicChatType;
2021-12-30 05:55:02 +00:00
//@class ChatActionBar @description Describes actions which must be possible to do through a chat action bar
2020-02-03 12:56:20 +00:00
2022-11-07 18:50:52 +00:00
//@description The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
2020-11-30 09:33:47 +00:00
//@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
chatActionBarReportSpam can_unarchive:Bool = ChatActionBar;
2020-02-03 12:56:20 +00:00
//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation
chatActionBarReportUnrelatedLocation = ChatActionBar;
2021-12-30 05:55:02 +00:00
//@description The chat is a recently created group chat to which new members can be invited
chatActionBarInviteMembers = ChatActionBar;
2022-12-30 18:28:59 +00:00
//@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. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
2020-11-30 09:33:47 +00:00
//@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
//@distance If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users
chatActionBarReportAddBlock can_unarchive:Bool distance:int32 = ChatActionBar;
2020-02-03 12:56:20 +00:00
//@description The chat is a private or secret chat and the other user can be added to the contact list using the method addContact
chatActionBarAddContact = ChatActionBar;
//@description The chat is a private or secret chat with a mutual contact and the user's phone number can be shared with the other user using the method sharePhoneNumber
chatActionBarSharePhoneNumber = ChatActionBar;
2021-12-30 05:55:02 +00:00
//@description The chat is a private chat with an administrator of a chat to which the user sent join request
//@title Title of the chat to which the join request was sent
//@is_channel True, if the join request was sent to a channel chat
//@request_date Point in time (Unix timestamp) when the join request was sent
chatActionBarJoinRequest title:string is_channel:Bool request_date:int32 = ChatActionBar;
2020-02-03 12:56:20 +00:00
2018-08-30 14:55:42 +00:00
//@class KeyboardButtonType @description Describes a keyboard button type
2021-12-30 05:55:02 +00:00
//@description A simple button, with text that must be sent when the button is pressed
2018-08-30 14:55:42 +00:00
keyboardButtonTypeText = KeyboardButtonType;
//@description A button that sends the user's phone number when pressed; available only in private chats
keyboardButtonTypeRequestPhoneNumber = KeyboardButtonType;
//@description A button that sends the user's location when pressed; available only in private chats
keyboardButtonTypeRequestLocation = KeyboardButtonType;
2020-02-03 12:56:20 +00:00
//@description A button that allows the user to create and send a poll when pressed; available only in private chats @force_regular If true, only regular polls must be allowed to create @force_quiz If true, only polls in quiz mode must be allowed to create
keyboardButtonTypeRequestPoll force_regular:Bool force_quiz:Bool = KeyboardButtonType;
2023-02-04 22:54:46 +00:00
//@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
//@id Unique button identifier
//@restrict_user_is_bot True, if the shared user must or must not be a bot
//@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
//@restrict_user_is_premium True, if the shared user must or must not be a Telegram Premium user
//@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
keyboardButtonTypeRequestUser id:int32 restrict_user_is_bot:Bool user_is_bot:Bool restrict_user_is_premium:Bool user_is_premium:Bool = KeyboardButtonType;
//@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
//@id Unique button identifier
//@chat_is_channel True, if the chat must be a channel; otherwise, a basic group or a supergroup chat is shared
//@restrict_chat_is_forum True, if the chat must or must not be a forum supergroup
//@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
//@restrict_chat_has_username True, if the chat must or must not have a username
//@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
//@chat_is_created True, if the chat must be created by the current user
//@user_administrator_rights Expected user administrator rights in the chat; may be null if they aren't restricted
//@bot_administrator_rights Expected bot administrator rights in the chat; may be null if they aren't restricted
//@bot_is_member True, if the bot must be a member of the chat; for basic group and supergroup chats only
keyboardButtonTypeRequestChat id:int32 chat_is_channel:Bool restrict_chat_is_forum:Bool chat_is_forum:Bool restrict_chat_has_username:Bool chat_has_username:Bool chat_is_created:Bool user_administrator_rights:chatAdministratorRights bot_administrator_rights:chatAdministratorRights bot_is_member:Bool = KeyboardButtonType;
2022-06-21 18:10:07 +00:00
//@description A button that opens a Web App by calling getWebAppUrl @url An HTTP URL to pass to getWebAppUrl
2022-04-24 20:33:39 +00:00
keyboardButtonTypeWebApp url:string = KeyboardButtonType;
2018-08-30 14:55:42 +00:00
//@description Represents a single button in a bot keyboard @text Text of the button @type Type of the button
keyboardButton text:string type:KeyboardButtonType = KeyboardButton;
//@class InlineKeyboardButtonType @description Describes the type of an inline keyboard button
2018-09-05 21:45:29 +00:00
//@description A button that opens a specified URL @url HTTP or tg:// URL to open
2018-08-30 14:55:42 +00:00
inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType;
2022-04-24 20:33:39 +00:00
//@description A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo @url An HTTP URL to pass to getLoginUrlInfo @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages
2021-12-30 05:55:02 +00:00
inlineKeyboardButtonTypeLoginUrl url:string id:int53 forward_text:string = InlineKeyboardButtonType;
2019-09-10 12:36:54 +00:00
2022-06-21 18:10:07 +00:00
//@description A button that opens a Web App by calling openWebApp @url An HTTP URL to pass to openWebApp
2022-04-24 20:33:39 +00:00
inlineKeyboardButtonTypeWebApp url:string = InlineKeyboardButtonType;
2020-11-30 09:33:47 +00:00
//@description A button that sends a callback query to a bot @data Data to be sent to the bot via a callback query
2018-08-30 14:55:42 +00:00
inlineKeyboardButtonTypeCallback data:bytes = InlineKeyboardButtonType;
2022-08-13 15:24:07 +00:00
//@description A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot @data Data to be sent to the bot via a callback query
2020-11-30 09:33:47 +00:00
inlineKeyboardButtonTypeCallbackWithPassword data:bytes = InlineKeyboardButtonType;
//@description A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame
2018-08-30 14:55:42 +00:00
inlineKeyboardButtonTypeCallbackGame = InlineKeyboardButtonType;
2021-12-30 05:55:02 +00:00
//@description A button that forces an inline query to the bot to be inserted in the input field @query Inline query to be sent to the bot @in_current_chat True, if the inline query must be sent from the current chat
2018-08-30 14:55:42 +00:00
inlineKeyboardButtonTypeSwitchInline query:string in_current_chat:Bool = InlineKeyboardButtonType;
//@description A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice
inlineKeyboardButtonTypeBuy = InlineKeyboardButtonType;
2021-12-30 05:55:02 +00:00
//@description A button with a user reference to be handled in the same way as textEntityTypeMentionName entities @user_id User identifier
inlineKeyboardButtonTypeUser user_id:int53 = InlineKeyboardButtonType;
2018-08-30 14:55:42 +00:00
//@description Represents a single button in an inline keyboard @text Text of the button @type Type of the button
inlineKeyboardButton text:string type:InlineKeyboardButtonType = InlineKeyboardButton;
//@class ReplyMarkup @description Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots
2022-12-07 20:04:16 +00:00
//@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
2018-08-30 14:55:42 +00:00
//@is_personal True, if the keyboard is removed only for the mentioned users or the target user of a reply
replyMarkupRemoveKeyboard is_personal:Bool = ReplyMarkup;
2020-11-30 09:33:47 +00:00
//@description Instructs application to force a reply to this message
2018-08-30 14:55:42 +00:00
//@is_personal True, if a forced reply must automatically be shown to the current user. For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user of a reply
2021-12-30 05:55:02 +00:00
//@input_field_placeholder If non-empty, the placeholder to be shown in the input field when the reply is active; 0-64 characters
replyMarkupForceReply is_personal:Bool input_field_placeholder:string = ReplyMarkup;
2018-08-30 14:55:42 +00:00
//@description Contains a custom keyboard layout to quickly reply to bots
//@rows A list of rows of bot keyboard buttons
2023-02-04 22:54:46 +00:00
//@is_persistent True, if the keyboard is supposed to always be shown when the ordinary keyboard is hidden
2020-11-30 09:33:47 +00:00
//@resize_keyboard True, if the application needs to resize the keyboard vertically
//@one_time True, if the application needs to hide the keyboard after use
2018-08-30 14:55:42 +00:00
//@is_personal True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply
2021-12-30 05:55:02 +00:00
//@input_field_placeholder If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters
2022-12-30 18:28:59 +00:00
replyMarkupShowKeyboard rows:vector<vector<keyboardButton>> is_persistent:Bool resize_keyboard:Bool one_time:Bool is_personal:Bool input_field_placeholder:string = ReplyMarkup;
2018-08-30 14:55:42 +00:00
//@description Contains an inline keyboard layout
//@rows A list of rows of inline keyboard buttons
replyMarkupInlineKeyboard rows:vector<vector<inlineKeyboardButton>> = ReplyMarkup;
2020-02-03 12:56:20 +00:00
//@class LoginUrlInfo @description Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl
2023-02-04 22:54:46 +00:00
//@description An HTTP URL needs to be open @url The URL to open @skip_confirm True, if there is no need to show an ordinary open URL confirm
2020-02-03 12:56:20 +00:00
loginUrlInfoOpen url:string skip_confirm:Bool = LoginUrlInfo;
2022-12-30 18:28:59 +00:00
//@description An authorization confirmation dialog needs to be shown to the user
//@url An HTTP URL to be opened
//@domain A domain of the URL
//@bot_user_id User identifier of a bot linked with the website
//@request_write_access True, if the user needs to be requested to give the permission to the bot to send them messages
2021-12-30 05:55:02 +00:00
loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 request_write_access:Bool = LoginUrlInfo;
2020-02-03 12:56:20 +00:00
2022-06-21 18:10:07 +00:00
//@description Contains information about a Web App @launch_id Unique identifier for the Web App launch @url A Web App URL to open in a web view
2022-04-24 20:33:39 +00:00
webAppInfo launch_id:int64 url:string = WebAppInfo;
2020-11-30 09:33:47 +00:00
//@description Contains information about a message thread
//@chat_id Identifier of the chat to which the message thread belongs
//@message_thread_id Message thread identifier, unique within the chat
2022-11-07 18:50:52 +00:00
//@reply_info Information about the message thread; may be null for forum topic threads
2021-12-30 05:55:02 +00:00
//@unread_message_count Approximate number of unread messages in the message thread
2020-11-30 09:33:47 +00:00
//@messages The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)
//@draft_message A draft of a message in the message thread; may be null
2021-12-30 05:55:02 +00:00
messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector<message> draft_message:draftMessage = MessageThreadInfo;
2020-11-30 09:33:47 +00:00
2022-11-07 18:50:52 +00:00
//@description Describes a forum topic icon @color Color of the topic icon in RGB format @custom_emoji_id Unique identifier of the custom emoji shown on the topic icon; 0 if none
forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon;
//@description Contains basic information about a forum topic
//@message_thread_id Message thread identifier of the topic
//@name Name of the topic
//@icon Icon of the topic
//@creation_date Date the topic was created
//@creator_id Identifier of the creator of the topic
2022-12-07 20:04:16 +00:00
//@is_general True, if the topic is the General topic list
2022-11-07 18:50:52 +00:00
//@is_outgoing True, if the topic was created by the current user
//@is_closed True, if the topic is closed
2022-12-07 20:04:16 +00:00
//@is_hidden True, if the topic is hidden above the topic list and closed; for General topic only
forumTopicInfo message_thread_id:int53 name:string icon:forumTopicIcon creation_date:int32 creator_id:MessageSender is_general:Bool is_outgoing:Bool is_closed:Bool is_hidden:Bool = ForumTopicInfo;
2022-11-07 18:50:52 +00:00
//@description Describes a forum topic
//@info Basic information about the topic
2022-12-07 20:04:16 +00:00
//@last_message Last message in the topic; may be null if unknown
2022-11-07 18:50:52 +00:00
//@is_pinned True, if the topic is pinned in the topic list
//@unread_count Number of unread messages in the topic
//@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 topic
//@unread_reaction_count Number of messages with unread reactions in the topic
//@notification_settings Notification settings for the topic
//@draft_message A draft of a message in the topic; may be null
forumTopic info:forumTopicInfo last_message:message is_pinned: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 draft_message:draftMessage = ForumTopic;
2022-12-07 20:04:16 +00:00
//@description Describes a list of forum topics
//@total_count Approximate total number of forum topics found
//@topics List of forum topics
//@next_offset_date Offset date for the next getForumTopics request
//@next_offset_message_id Offset message identifier for the next getForumTopics request
//@next_offset_message_thread_id Offset message thread identifier for the next getForumTopics request
forumTopics total_count:int32 topics:vector<forumTopic> next_offset_date:int32 next_offset_message_id:int53 next_offset_message_thread_id:int53 = ForumTopics;
2022-11-07 18:50:52 +00:00
2018-08-30 14:55:42 +00:00
//@class RichText @description Describes a text object inside an instant-view web page
//@description A plain text @text Text
richTextPlain text:string = RichText;
//@description A bold rich text @text Text
richTextBold text:RichText = RichText;
//@description An italicized rich text @text Text
richTextItalic text:RichText = RichText;
//@description An underlined rich text @text Text
richTextUnderline text:RichText = RichText;
2020-02-03 12:56:20 +00:00
//@description A strikethrough rich text @text Text
2018-08-30 14:55:42 +00:00
richTextStrikethrough text:RichText = RichText;
//@description A fixed-width rich text @text Text
richTextFixed text:RichText = RichText;
2020-02-03 12:56:20 +00:00
//@description A rich text URL link @text Text @url URL @is_cached True, if the URL has cached instant view server-side
richTextUrl text:RichText url:string is_cached:Bool = RichText;
2018-08-30 14:55:42 +00:00
//@description A rich text email link @text Text @email_address Email address
richTextEmailAddress text:RichText email_address:string = RichText;
2019-06-07 10:56:06 +00:00
//@description A subscript rich text @text Text
richTextSubscript text:RichText = RichText;
//@description A superscript rich text @text Text
richTextSuperscript text:RichText = RichText;
//@description A marked rich text @text Text
richTextMarked text:RichText = RichText;
//@description A rich text phone number @text Text @phone_number Phone number
richTextPhoneNumber text:RichText phone_number:string = RichText;
2022-12-30 18:28:59 +00:00
//@description A small image inside the text
//@document The image represented as a document. The image can be in GIF, JPEG or PNG format
2021-12-30 05:55:02 +00:00
//@width Width of a bounding box in which the image must be shown; 0 if unknown
//@height Height of a bounding box in which the image must be shown; 0 if unknown
2019-06-07 10:56:06 +00:00
richTextIcon document:document width:int32 height:int32 = RichText;
2020-11-30 09:33:47 +00:00
//@description A reference to a richTexts object on the same web page @text The text @anchor_name The name of a richTextAnchor object, which is the first element of the target richTexts object @url An HTTP URL, opening the reference
richTextReference text:RichText anchor_name:string url:string = RichText;
//@description An anchor @name Anchor name
richTextAnchor name:string = RichText;
2021-12-30 05:55:02 +00:00
//@description A link to an anchor on the same web page @text The link text @anchor_name The anchor name. If the name is empty, the link must bring back to top @url An HTTP URL, opening the anchor
2020-11-30 09:33:47 +00:00
richTextAnchorLink text:RichText anchor_name:string url:string = RichText;
2019-06-07 10:56:06 +00:00
2018-08-30 14:55:42 +00:00
//@description A concatenation of rich texts @texts Texts
richTexts texts:vector<RichText> = RichText;
2019-06-07 10:56:06 +00:00
//@description Contains a caption of an instant view web page block, consisting of a text and a trailing credit @text Content of the caption @credit Block credit (like HTML tag <cite>)
pageBlockCaption text:RichText credit:RichText = PageBlockCaption;
//@description Describes an item of a list page block @label Item label @page_blocks Item blocks
pageBlockListItem label:string page_blocks:vector<PageBlock> = PageBlockListItem;
//@class PageBlockHorizontalAlignment @description Describes a horizontal alignment of a table cell content
2021-12-30 05:55:02 +00:00
//@description The content must be left-aligned
2019-06-07 10:56:06 +00:00
pageBlockHorizontalAlignmentLeft = PageBlockHorizontalAlignment;
2021-12-30 05:55:02 +00:00
//@description The content must be center-aligned
2019-06-07 10:56:06 +00:00
pageBlockHorizontalAlignmentCenter = PageBlockHorizontalAlignment;
2021-12-30 05:55:02 +00:00
//@description The content must be right-aligned
2019-06-07 10:56:06 +00:00
pageBlockHorizontalAlignmentRight = PageBlockHorizontalAlignment;
//@class PageBlockVerticalAlignment @description Describes a Vertical alignment of a table cell content
2021-12-30 05:55:02 +00:00
//@description The content must be top-aligned
2019-06-07 10:56:06 +00:00
pageBlockVerticalAlignmentTop = PageBlockVerticalAlignment;
2021-12-30 05:55:02 +00:00
//@description The content must be middle-aligned
2019-06-07 10:56:06 +00:00
pageBlockVerticalAlignmentMiddle = PageBlockVerticalAlignment;
2021-12-30 05:55:02 +00:00
//@description The content must be bottom-aligned
2019-06-07 10:56:06 +00:00
pageBlockVerticalAlignmentBottom = PageBlockVerticalAlignment;
2022-12-30 18:28:59 +00:00
//@description Represents a cell of a table
//@text Cell text; may be null. If the text is null, then the cell must be invisible
//@is_header True, if it is a header cell
//@colspan The number of columns the cell spans
//@rowspan The number of rows the cell spans
//@align Horizontal cell content alignment
//@valign Vertical cell content alignment
2019-06-07 10:56:06 +00:00
pageBlockTableCell text:RichText is_header:Bool colspan:int32 rowspan:int32 align:PageBlockHorizontalAlignment valign:PageBlockVerticalAlignment = PageBlockTableCell;
2022-12-30 18:28:59 +00:00
//@description Contains information about a related article
//@url Related article URL
//@title Article title; may be empty
//@param_description Article description; may be empty
//@photo Article photo; may be null
//@author Article author; may be empty
//@publish_date Point in time (Unix timestamp) when the article was published; 0 if unknown
2019-06-07 10:56:06 +00:00
pageBlockRelatedArticle url:string title:string description:string photo:photo author:string publish_date:int32 = PageBlockRelatedArticle;
2018-08-30 14:55:42 +00:00
//@class PageBlock @description Describes a block of an instant view web page
//@description The title of a page @title Title
pageBlockTitle title:RichText = PageBlock;
//@description The subtitle of a page @subtitle Subtitle
pageBlockSubtitle subtitle:RichText = PageBlock;
//@description The author and publishing date of a page @author Author @publish_date Point in time (Unix timestamp) when the article was published; 0 if unknown
pageBlockAuthorDate author:RichText publish_date:int32 = PageBlock;
//@description A header @header Header
pageBlockHeader header:RichText = PageBlock;
//@description A subheader @subheader Subheader
pageBlockSubheader subheader:RichText = PageBlock;
2019-06-07 10:56:06 +00:00
//@description A kicker @kicker Kicker
pageBlockKicker kicker:RichText = PageBlock;
2018-08-30 14:55:42 +00:00
//@description A text paragraph @text Paragraph text
pageBlockParagraph text:RichText = PageBlock;
2021-12-30 05:55:02 +00:00
//@description A preformatted text paragraph @text Paragraph text @language Programming language for which the text needs to be formatted
2018-08-30 14:55:42 +00:00
pageBlockPreformatted text:RichText language:string = PageBlock;
//@description The footer of a page @footer Footer
pageBlockFooter footer:RichText = PageBlock;
//@description An empty block separating a page
pageBlockDivider = PageBlock;
//@description An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor @name Name of the anchor
pageBlockAnchor name:string = PageBlock;
2019-06-07 10:56:06 +00:00
//@description A list of data blocks @items The items of the list
pageBlockList items:vector<pageBlockListItem> = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A block quote
//@text Quote text
//@credit Quote credit
2019-06-07 10:56:06 +00:00
pageBlockBlockQuote text:RichText credit:RichText = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A pull quote
//@text Quote text
//@credit Quote credit
2019-06-07 10:56:06 +00:00
pageBlockPullQuote text:RichText credit:RichText = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description An animation
//@animation Animation file; may be null
//@caption Animation caption
//@need_autoplay True, if the animation must be played automatically
2019-06-07 10:56:06 +00:00
pageBlockAnimation animation:animation caption:pageBlockCaption need_autoplay:Bool = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description An audio file
//@audio Audio file; may be null
//@caption Audio file caption
2019-06-07 10:56:06 +00:00
pageBlockAudio audio:audio caption:pageBlockCaption = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A photo
//@photo Photo file; may be null
//@caption Photo caption
//@url URL that needs to be opened when the photo is clicked
2019-06-07 10:56:06 +00:00
pageBlockPhoto photo:photo caption:pageBlockCaption url:string = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A video
//@video Video file; may be null
//@caption Video caption
//@need_autoplay True, if the video must be played automatically
//@is_looped True, if the video must be looped
2019-06-07 10:56:06 +00:00
pageBlockVideo video:video caption:pageBlockCaption need_autoplay:Bool is_looped:Bool = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A voice note
//@voice_note Voice note; may be null
//@caption Voice note caption
2020-02-03 12:56:20 +00:00
pageBlockVoiceNote voice_note:voiceNote caption:pageBlockCaption = PageBlock;
2022-12-30 18:28:59 +00:00
//@description A page cover
//@cover Cover
2018-08-30 14:55:42 +00:00
pageBlockCover cover:PageBlock = PageBlock;
2022-12-30 18:28:59 +00:00
//@description An embedded web page
//@url Web page URL, if available
//@html HTML-markup of the embedded page
//@poster_photo Poster photo, if available; may be null
//@width Block width; 0 if unknown
//@height Block height; 0 if unknown
//@caption Block caption
//@is_full_width True, if the block must be full width
//@allow_scrolling True, if scrolling needs to be allowed
2019-06-07 10:56:06 +00:00
pageBlockEmbedded url:string html:string poster_photo:photo width:int32 height:int32 caption:pageBlockCaption is_full_width:Bool allow_scrolling:Bool = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description An embedded post
//@url Web page URL
//@author Post author
//@author_photo Post author photo; may be null
//@date Point in time (Unix timestamp) when the post was created; 0 if unknown
//@page_blocks Post content
//@caption Post caption
2019-06-07 10:56:06 +00:00
pageBlockEmbeddedPost url:string author:string author_photo:photo date:int32 page_blocks:vector<PageBlock> caption:pageBlockCaption = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A collage
//@page_blocks Collage item contents
//@caption Block caption
2019-06-07 10:56:06 +00:00
pageBlockCollage page_blocks:vector<PageBlock> caption:pageBlockCaption = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A slideshow
//@page_blocks Slideshow item contents
//@caption Block caption
2019-06-07 10:56:06 +00:00
pageBlockSlideshow page_blocks:vector<PageBlock> caption:pageBlockCaption = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A link to a chat
//@title Chat title
//@photo Chat photo; may be null
//@username Chat username by which all other information about the chat can be resolved
2020-11-30 09:33:47 +00:00
pageBlockChatLink title:string photo:chatPhotoInfo username:string = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A table
//@caption Table caption
//@cells Table cells
//@is_bordered True, if the table is bordered
//@is_striped True, if the table is striped
2019-06-07 10:56:06 +00:00
pageBlockTable caption:RichText cells:vector<vector<pageBlockTableCell>> is_bordered:Bool is_striped:Bool = PageBlock;
2022-12-30 18:28:59 +00:00
//@description A collapsible block
//@header Always visible heading for the block
//@page_blocks Block contents
//@is_open True, if the block is open by default
2019-06-07 10:56:06 +00:00
pageBlockDetails header:RichText page_blocks:vector<PageBlock> is_open:Bool = PageBlock;
2022-12-30 18:28:59 +00:00
//@description Related articles
//@header Block header
//@articles List of related articles
2019-06-07 10:56:06 +00:00
pageBlockRelatedArticles header:RichText articles:vector<pageBlockRelatedArticle> = PageBlock;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A map
//@location Location of the map center
//@zoom Map zoom level
//@width Map width
//@height Map height
//@caption Block caption
2019-06-07 10:56:06 +00:00
pageBlockMap location:location zoom:int32 width:int32 height:int32 caption:pageBlockCaption = PageBlock;
2020-11-30 09:33:47 +00:00
//@description Describes an instant view page for a web page
//@page_blocks Content of the web page
//@view_count Number of the instant view views; 0 if unknown
2021-12-30 05:55:02 +00:00
//@version Version of the instant view; currently, can be 1 or 2
2019-06-07 10:56:06 +00:00
//@is_rtl True, if the instant view must be shown from right to left
//@is_full True, if the instant view contains the full page. A network request might be needed to get the full web page instant view
2021-12-30 05:55:02 +00:00
//@feedback_link An internal link to be opened to leave feedback about the instant view
webPageInstantView page_blocks:vector<PageBlock> view_count:int32 version:int32 is_rtl:Bool is_full:Bool feedback_link:InternalLinkType = WebPageInstantView;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Describes a web page preview
//@url Original URL of the link
//@display_url URL to display
2018-08-30 14:55:42 +00:00
//@type Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else
2020-02-03 12:56:20 +00:00
//@site_name Short name of the site (e.g., Google Docs, App Store)
//@title Title of the content
//@param_description Description of the content
2018-08-30 14:55:42 +00:00
//@photo Image representing the content; may be null
//@embed_url URL to show in the embedded preview
//@embed_type MIME type of the embedded preview, (e.g., text/html or video/mp4)
//@embed_width Width of the embedded preview
//@embed_height Height of the embedded preview
//@duration Duration of the content, in seconds
//@author Author of the content
//@animation Preview of the content as an animation, if available; may be null
//@audio Preview of the content as an audio file, if available; may be null
2021-12-30 05:55:02 +00:00
//@document Preview of the content as a document, if available; may be null
2018-08-30 14:55:42 +00:00
//@sticker Preview of the content as a sticker for small WEBP files, if available; may be null
//@video Preview of the content as a video, if available; may be null
//@video_note Preview of the content as a video note, if available; may be null
//@voice_note Preview of the content as a voice note, if available; may be null
2022-12-30 18:28:59 +00:00
//@instant_view_version Version of web page instant view (currently, can be 1 or 2); 0 if none
2020-11-30 09:33:47 +00:00
webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote instant_view_version:int32 = WebPage;
//@description Contains information about a country
//@country_code A two-letter ISO 3166-1 alpha-2 country code
//@name Native name of the country
//@english_name English name of the country
2021-12-30 05:55:02 +00:00
//@is_hidden True, if the country must be hidden from the list of all countries
2020-11-30 09:33:47 +00:00
//@calling_codes List of country calling codes
countryInfo country_code:string name:string english_name:string is_hidden:Bool calling_codes:vector<string> = CountryInfo;
//@description Contains information about countries @countries The list of countries
countries countries:vector<countryInfo> = Countries;
//@description Contains information about a phone number
//@country Information about the country to which the phone number belongs; may be null
//@country_calling_code The part of the phone number denoting country calling code or its part
2021-12-30 05:55:02 +00:00
//@formatted_phone_number The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user
2022-12-30 18:28:59 +00:00
//@is_anonymous True, if the phone number was bought on Fragment and isn't tied to a SIM card
phoneNumberInfo country:countryInfo country_calling_code:string formatted_phone_number:string is_anonymous:Bool = PhoneNumberInfo;
2020-11-30 09:33:47 +00:00
//@description Describes an action associated with a bank card number @text Action text @url The URL to be opened
bankCardActionOpenUrl text:string url:string = BankCardActionOpenUrl;
//@description Information about a bank card @title Title of the bank card description @actions Actions that can be done with the bank card number
bankCardInfo title:string actions:vector<bankCardActionOpenUrl> = BankCardInfo;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Describes an address
//@country_code A two-letter ISO 3166-1 alpha-2 country code
//@state State, if applicable
//@city City
//@street_line1 First line of the address
//@street_line2 Second line of the address
//@postal_code Address postal code
2018-09-05 21:45:29 +00:00
address country_code:string state:string city:string street_line1:string street_line2:string postal_code:string = Address;
2022-12-30 18:28:59 +00:00
//@description Contains parameters of the application theme
//@background_color A color of the background in the RGB24 format
//@secondary_background_color A secondary color for the background in the RGB24 format
//@text_color A color of text in the RGB24 format
//@hint_color A color of hints in the RGB24 format
//@link_color A color of links in the RGB24 format
//@button_color A color of the buttons in the RGB24 format
2022-04-24 20:33:39 +00:00
//@button_text_color A color of text on the buttons in the RGB24 format
2022-06-21 18:10:07 +00:00
themeParameters background_color:int32 secondary_background_color:int32 text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters;
2022-04-24 20:33:39 +00:00
2021-12-30 05:55:02 +00:00
//@description Portion of the price of a product (e.g., "delivery cost", "tax amount") @label Label for this portion of the product price @amount Currency amount in the smallest units of the currency
2018-08-30 14:55:42 +00:00
labeledPricePart label:string amount:int53 = LabeledPricePart;
2022-06-21 18:10:07 +00:00
//@description Product invoice
//@currency ISO 4217 currency code
2021-12-30 05:55:02 +00:00
//@price_parts A list of objects used to calculate the total price of the product
//@max_tip_amount The maximum allowed amount of tip in the smallest units of the currency
//@suggested_tip_amounts Suggested amounts of tip in the smallest units of the currency
2022-06-21 18:10:07 +00:00
//@recurring_payment_terms_of_service_url 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
2021-12-30 05:55:02 +00:00
//@is_test True, if the payment is a test payment
//@need_name True, if the user's name is needed for payment
//@need_phone_number True, if the user's phone number is needed for payment
//@need_email_address True, if the user's email address is needed for payment
//@need_shipping_address True, if the user's shipping address is needed for payment
//@send_phone_number_to_provider True, if the user's phone number will be sent to the provider
//@send_email_address_to_provider True, if the user's email address will be sent to the provider
//@is_flexible True, if the total price depends on the shipping method
2022-06-21 18:10:07 +00:00
invoice currency:string price_parts:vector<labeledPricePart> max_tip_amount:int53 suggested_tip_amounts:vector<int53> recurring_payment_terms_of_service_url:string is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Order information
//@name Name of the user
//@phone_number Phone number of the user
//@email_address Email address of the user
//@shipping_address Shipping address for this order; may be null
2018-09-05 21:45:29 +00:00
orderInfo name:string phone_number:string email_address:string shipping_address:address = OrderInfo;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description One shipping option
//@id Shipping option identifier
//@title Option title
//@price_parts A list of objects used to calculate the total shipping costs
2018-08-30 14:55:42 +00:00
shippingOption id:string title:string price_parts:vector<labeledPricePart> = ShippingOption;
2022-08-13 15:24:07 +00:00
//@description Contains information about saved payment credentials @id Unique identifier of the saved credentials @title Title of the saved credentials
2018-08-30 14:55:42 +00:00
savedCredentials id:string title:string = SavedCredentials;
2022-06-21 18:10:07 +00:00
2018-08-30 14:55:42 +00:00
//@class InputCredentials @description Contains information about the payment method chosen by the user
//@description Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password @saved_credentials_id Identifier of the saved credentials
inputCredentialsSaved saved_credentials_id:string = InputCredentials;
2021-12-30 05:55:02 +00:00
//@description Applies if a user enters new credentials on a payment provider website @data JSON-encoded data with the credential identifier from the payment provider @allow_save True, if the credential identifier can be saved on the server side
2018-08-30 14:55:42 +00:00
inputCredentialsNew data:string allow_save:Bool = InputCredentials;
//@description Applies if a user enters new credentials using Apple Pay @data JSON-encoded data with the credential identifier
inputCredentialsApplePay data:string = InputCredentials;
2021-12-30 05:55:02 +00:00
//@description Applies if a user enters new credentials using Google Pay @data JSON-encoded data with the credential identifier
inputCredentialsGooglePay data:string = InputCredentials;
2022-06-21 18:10:07 +00:00
//@class PaymentProvider @description Contains information about a payment provider
//@description Smart Glocal payment provider @public_token Public payment token
paymentProviderSmartGlocal public_token:string = PaymentProvider;
2022-12-30 18:28:59 +00:00
//@description Stripe payment provider
//@publishable_key Stripe API publishable key
//@need_country True, if the user country must be provided
//@need_postal_code True, if the user ZIP/postal code must be provided
//@need_cardholder_name True, if the cardholder name must be provided
2022-06-21 18:10:07 +00:00
paymentProviderStripe publishable_key:string need_country:Bool need_postal_code:Bool need_cardholder_name:Bool = PaymentProvider;
//@description Some other payment provider, for which a web payment form must be shown @url Payment form URL
paymentProviderOther url:string = PaymentProvider;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@description Describes an additional payment option @title Title for the payment option @url Payment form URL to be opened in a web view
paymentOption title:string url:string = PaymentOption;
2021-12-30 05:55:02 +00:00
//@description Contains information about an invoice payment form
//@id The payment form identifier
2022-06-21 18:10:07 +00:00
//@invoice Full information about the invoice
2021-12-30 05:55:02 +00:00
//@seller_bot_user_id User identifier of the seller bot
2022-06-21 18:10:07 +00:00
//@payment_provider_user_id User identifier of the payment provider bot
//@payment_provider Information about the payment provider
2022-08-13 15:24:07 +00:00
//@additional_payment_options The list of additional payment options
2021-12-30 05:55:02 +00:00
//@saved_order_info Saved server-side order information; may be null
2022-08-13 15:24:07 +00:00
//@saved_credentials The list of saved payment credentials
2021-12-30 05:55:02 +00:00
//@can_save_credentials True, if the user can choose to save credentials
2022-08-13 15:24:07 +00:00
//@need_password True, if the user will be able to save credentials, if sets up a 2-step verification password
2022-06-21 18:10:07 +00:00
//@product_title Product title
//@product_description Product description
//@product_photo Product photo; may be null
2022-08-13 15:24:07 +00:00
paymentForm id:int64 invoice:invoice seller_bot_user_id:int53 payment_provider_user_id:int53 payment_provider:PaymentProvider additional_payment_options:vector<paymentOption> saved_order_info:orderInfo saved_credentials:vector<savedCredentials> can_save_credentials:Bool need_password:Bool product_title:string product_description:formattedText product_photo:photo = PaymentForm;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@description Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options @order_info_id Temporary identifier of the order information @shipping_options Available shipping options
2018-08-30 14:55:42 +00:00
validatedOrderInfo order_info_id:string shipping_options:vector<shippingOption> = ValidatedOrderInfo;
2023-02-04 22:54:46 +00:00
//@description Contains the result of a payment request @success True, if the payment request was successful; otherwise, the verification_url will be non-empty @verification_url URL for additional payment credentials verification
2018-08-30 14:55:42 +00:00
paymentResult success:Bool verification_url:string = PaymentResult;
2021-12-30 05:55:02 +00:00
//@description Contains information about a successful payment
//@title Product title
//@param_description Product description
//@photo Product photo; may be null
//@date Point in time (Unix timestamp) when the payment was made
//@seller_bot_user_id User identifier of the seller bot
2022-06-21 18:10:07 +00:00
//@payment_provider_user_id User identifier of the payment provider bot
2021-12-30 05:55:02 +00:00
//@invoice Information about the invoice
//@order_info Order information; may be null
//@shipping_option Chosen shipping option; may be null
//@credentials_title Title of the saved credentials chosen by the buyer
//@tip_amount The amount of tip chosen by the buyer in the smallest units of the currency
2022-06-21 18:10:07 +00:00
paymentReceipt title:string description:formattedText photo:photo date:int32 seller_bot_user_id:int53 payment_provider_user_id:int53 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceipt;
2022-11-07 18:50:52 +00:00
//@class InputInvoice @description Describes an invoice to process
2022-06-21 18:10:07 +00:00
//@description An invoice from a message of the type messageInvoice @chat_id Chat identifier of the message @message_id Message identifier
inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice;
//@description An invoice from a link of the type internalLinkTypeInvoice @name Name of the invoice
inputInvoiceName name:string = InputInvoice;
2018-08-30 14:55:42 +00:00
2022-11-07 18:50:52 +00:00
//@class MessageExtendedMedia @description Describes a media, which is attached to an invoice
//@description The media is hidden until the invoice is paid
//@width Media width; 0 if unknown
//@height Media height; 0 if unknown
//@duration Media duration; 0 if unknown
//@minithumbnail Media minithumbnail; may be null
//@caption Media caption
messageExtendedMediaPreview width:int32 height:int32 duration:int32 minithumbnail:minithumbnail caption:formattedText = MessageExtendedMedia;
//@description The media is a photo @photo The photo @caption Photo caption
messageExtendedMediaPhoto photo:photo caption:formattedText = MessageExtendedMedia;
//@description The media is a video @video The video @caption Photo caption
messageExtendedMediaVideo video:video caption:formattedText = MessageExtendedMedia;
//@description The media is unuspported @caption Media caption
messageExtendedMediaUnsupported caption:formattedText = MessageExtendedMedia;
2018-09-05 21:45:29 +00:00
//@description File with the date it was uploaded @file The file @date Point in time (Unix timestamp) when the file was uploaded
datedFile file:file date:int32 = DatedFile;
//@class PassportElementType @description Contains the type of a Telegram Passport element
//@description A Telegram Passport element containing the user's personal details
passportElementTypePersonalDetails = PassportElementType;
//@description A Telegram Passport element containing the user's passport
passportElementTypePassport = PassportElementType;
//@description A Telegram Passport element containing the user's driver license
passportElementTypeDriverLicense = PassportElementType;
//@description A Telegram Passport element containing the user's identity card
passportElementTypeIdentityCard = PassportElementType;
//@description A Telegram Passport element containing the user's internal passport
passportElementTypeInternalPassport = PassportElementType;
//@description A Telegram Passport element containing the user's address
passportElementTypeAddress = PassportElementType;
//@description A Telegram Passport element containing the user's utility bill
passportElementTypeUtilityBill = PassportElementType;
//@description A Telegram Passport element containing the user's bank statement
passportElementTypeBankStatement = PassportElementType;
//@description A Telegram Passport element containing the user's rental agreement
passportElementTypeRentalAgreement = PassportElementType;
//@description A Telegram Passport element containing the registration page of the user's passport
passportElementTypePassportRegistration = PassportElementType;
//@description A Telegram Passport element containing the user's temporary registration
passportElementTypeTemporaryRegistration = PassportElementType;
//@description A Telegram Passport element containing the user's phone number
passportElementTypePhoneNumber = PassportElementType;
//@description A Telegram Passport element containing the user's email address
passportElementTypeEmailAddress = PassportElementType;
2021-12-30 05:55:02 +00:00
//@description Represents a date according to the Gregorian calendar @day Day of the month; 1-31 @month Month; 1-12 @year Year; 1-9999
2018-09-05 21:45:29 +00:00
date day:int32 month:int32 year:int32 = Date;
//@description Contains the user's personal details
2022-12-30 18:28:59 +00:00
//@first_name First name of the user written in English; 1-255 characters
//@middle_name Middle name of the user written in English; 0-255 characters
//@last_name Last name of the user written in English; 1-255 characters
//@native_first_name Native first name of the user; 1-255 characters
//@native_middle_name Native middle name of the user; 0-255 characters
//@native_last_name Native last name of the user; 1-255 characters
//@birthdate Birthdate of the user
//@gender Gender of the user, "male" or "female"
//@country_code A two-letter ISO 3166-1 alpha-2 country code of the user's country
//@residence_country_code A two-letter ISO 3166-1 alpha-2 country code of the user's residence country
2018-09-05 21:45:29 +00:00
personalDetails first_name:string middle_name:string last_name:string native_first_name:string native_middle_name:string native_last_name:string birthdate:date gender:string country_code:string residence_country_code:string = PersonalDetails;
2022-12-30 18:28:59 +00:00
//@description An identity document
//@number Document number; 1-24 characters
//@expiry_date Document expiry date; may be null if not applicable
//@front_side Front side of the document
//@reverse_side Reverse side of the document; only for driver license and identity card; may be null
//@selfie Selfie with the document; may be null
//@translation List of files containing a certified English translation of the document
2018-09-05 21:45:29 +00:00
identityDocument number:string expiry_date:date front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector<datedFile> = IdentityDocument;
2022-12-30 18:28:59 +00:00
//@description An identity document to be saved to Telegram Passport
//@number Document number; 1-24 characters
//@expiry_date Document expiry date; pass null if not applicable
//@front_side Front side of the document
//@reverse_side Reverse side of the document; only for driver license and identity card; pass null otherwise
//@selfie Selfie with the document; pass null if unavailable
//@translation List of files containing a certified English translation of the document
2018-09-05 21:45:29 +00:00
inputIdentityDocument number:string expiry_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translation:vector<InputFile> = InputIdentityDocument;
//@description A personal document, containing some information about a user @files List of files containing the pages of the document @translation List of files containing a certified English translation of the document
personalDocument files:vector<datedFile> translation:vector<datedFile> = PersonalDocument;
//@description A personal document to be saved to Telegram Passport @files List of files containing the pages of the document @translation List of files containing a certified English translation of the document
inputPersonalDocument files:vector<InputFile> translation:vector<InputFile> = InputPersonalDocument;
//@class PassportElement @description Contains information about a Telegram Passport element
//@description A Telegram Passport element containing the user's personal details @personal_details Personal details of the user
passportElementPersonalDetails personal_details:personalDetails = PassportElement;
//@description A Telegram Passport element containing the user's passport @passport Passport
passportElementPassport passport:identityDocument = PassportElement;
//@description A Telegram Passport element containing the user's driver license @driver_license Driver license
passportElementDriverLicense driver_license:identityDocument = PassportElement;
//@description A Telegram Passport element containing the user's identity card @identity_card Identity card
passportElementIdentityCard identity_card:identityDocument = PassportElement;
//@description A Telegram Passport element containing the user's internal passport @internal_passport Internal passport
passportElementInternalPassport internal_passport:identityDocument = PassportElement;
//@description A Telegram Passport element containing the user's address @address Address
passportElementAddress address:address = PassportElement;
//@description A Telegram Passport element containing the user's utility bill @utility_bill Utility bill
passportElementUtilityBill utility_bill:personalDocument = PassportElement;
//@description A Telegram Passport element containing the user's bank statement @bank_statement Bank statement
passportElementBankStatement bank_statement:personalDocument = PassportElement;
//@description A Telegram Passport element containing the user's rental agreement @rental_agreement Rental agreement
passportElementRentalAgreement rental_agreement:personalDocument = PassportElement;
//@description A Telegram Passport element containing the user's passport registration pages @passport_registration Passport registration pages
passportElementPassportRegistration passport_registration:personalDocument = PassportElement;
//@description A Telegram Passport element containing the user's temporary registration @temporary_registration Temporary registration
passportElementTemporaryRegistration temporary_registration:personalDocument = PassportElement;
//@description A Telegram Passport element containing the user's phone number @phone_number Phone number
passportElementPhoneNumber phone_number:string = PassportElement;
//@description A Telegram Passport element containing the user's email address @email_address Email address
passportElementEmailAddress email_address:string = PassportElement;
//@class InputPassportElement @description Contains information about a Telegram Passport element to be saved
//@description A Telegram Passport element to be saved containing the user's personal details @personal_details Personal details of the user
inputPassportElementPersonalDetails personal_details:personalDetails = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's passport @passport The passport to be saved
inputPassportElementPassport passport:inputIdentityDocument = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's driver license @driver_license The driver license to be saved
inputPassportElementDriverLicense driver_license:inputIdentityDocument = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's identity card @identity_card The identity card to be saved
inputPassportElementIdentityCard identity_card:inputIdentityDocument = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's internal passport @internal_passport The internal passport to be saved
inputPassportElementInternalPassport internal_passport:inputIdentityDocument = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's address @address The address to be saved
inputPassportElementAddress address:address = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's utility bill @utility_bill The utility bill to be saved
inputPassportElementUtilityBill utility_bill:inputPersonalDocument = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's bank statement @bank_statement The bank statement to be saved
inputPassportElementBankStatement bank_statement:inputPersonalDocument = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's rental agreement @rental_agreement The rental agreement to be saved
inputPassportElementRentalAgreement rental_agreement:inputPersonalDocument = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's passport registration @passport_registration The passport registration page to be saved
inputPassportElementPassportRegistration passport_registration:inputPersonalDocument = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's temporary registration @temporary_registration The temporary registration document to be saved
inputPassportElementTemporaryRegistration temporary_registration:inputPersonalDocument = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's phone number @phone_number The phone number to be saved
inputPassportElementPhoneNumber phone_number:string = InputPassportElement;
//@description A Telegram Passport element to be saved containing the user's email address @email_address The email address to be saved
inputPassportElementEmailAddress email_address:string = InputPassportElement;
//@description Contains information about saved Telegram Passport elements @elements Telegram Passport elements
passportElements elements:vector<PassportElement> = PassportElements;
//@class PassportElementErrorSource @description Contains the description of an error in a Telegram Passport element
//@description The element contains an error in an unspecified place. The error will be considered resolved when new data is added
passportElementErrorSourceUnspecified = PassportElementErrorSource;
//@description One of the data fields contains an error. The error will be considered resolved when the value of the field changes @field_name Field name
passportElementErrorSourceDataField field_name:string = PassportElementErrorSource;
//@description The front side of the document contains an error. The error will be considered resolved when the file with the front side changes
passportElementErrorSourceFrontSide = PassportElementErrorSource;
//@description The reverse side of the document contains an error. The error will be considered resolved when the file with the reverse side changes
passportElementErrorSourceReverseSide = PassportElementErrorSource;
//@description The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes
passportElementErrorSourceSelfie = PassportElementErrorSource;
2019-06-07 10:56:06 +00:00
//@description One of files with the translation of the document contains an error. The error will be considered resolved when the file changes @file_index Index of a file with the error
passportElementErrorSourceTranslationFile file_index:int32 = PassportElementErrorSource;
2018-09-05 21:45:29 +00:00
//@description The translation of the document contains an error. The error will be considered resolved when the list of translation files changes
passportElementErrorSourceTranslationFiles = PassportElementErrorSource;
2019-06-07 10:56:06 +00:00
//@description The file contains an error. The error will be considered resolved when the file changes @file_index Index of a file with the error
passportElementErrorSourceFile file_index:int32 = PassportElementErrorSource;
2018-09-05 21:45:29 +00:00
//@description The list of attached files contains an error. The error will be considered resolved when the list of files changes
passportElementErrorSourceFiles = PassportElementErrorSource;
//@description Contains the description of an error in a Telegram Passport element @type Type of the Telegram Passport element which has the error @message Error message @source Error source
passportElementError type:PassportElementType message:string source:PassportElementErrorSource = PassportElementError;
2022-12-30 18:28:59 +00:00
//@description Contains information about a Telegram Passport element that was requested by a service
//@type Type of the element
//@is_selfie_required True, if a selfie is required with the identity document
//@is_translation_required True, if a certified English translation is required with the document
//@is_native_name_required True, if personal details must include the user's name in the language of their country of residence
2018-09-05 21:45:29 +00:00
passportSuitableElement type:PassportElementType is_selfie_required:Bool is_translation_required:Bool is_native_name_required:Bool = PassportSuitableElement;
//@description Contains a description of the required Telegram Passport element that was requested by a service @suitable_elements List of Telegram Passport elements any of which is enough to provide
passportRequiredElement suitable_elements:vector<passportSuitableElement> = PassportRequiredElement;
2022-12-30 18:28:59 +00:00
//@description Contains information about a Telegram Passport authorization form that was requested
//@id Unique identifier of the authorization form
2021-12-30 05:55:02 +00:00
//@required_elements Telegram Passport elements that must be provided to complete the form
2019-06-07 10:56:06 +00:00
//@privacy_policy_url URL for the privacy policy of the service; may be empty
passportAuthorizationForm id:int32 required_elements:vector<passportRequiredElement> privacy_policy_url:string = PassportAuthorizationForm;
//@description Contains information about a Telegram Passport elements and corresponding errors @elements Telegram Passport elements @errors Errors in the elements that are already available
passportElementsWithErrors elements:vector<PassportElement> errors:vector<passportElementError> = PassportElementsWithErrors;
2018-09-05 21:45:29 +00:00
//@description Contains encrypted Telegram Passport data credentials @data The encrypted credentials @hash The decrypted data hash @secret Secret for data decryption, encrypted with the service's public key
encryptedCredentials data:bytes hash:bytes secret:bytes = EncryptedCredentials;
2022-12-30 18:28:59 +00:00
//@description Contains information about an encrypted Telegram Passport element; for bots only
//@type Type of Telegram Passport element
//@data Encrypted JSON-encoded data about the user
//@front_side The front side of an identity document
//@reverse_side The reverse side of an identity document; may be null
//@selfie Selfie with the document; may be null
//@translation List of files containing a certified English translation of the document
//@files List of attached files
//@value Unencrypted data, phone number or email address
//@hash Hash of the entire element
2018-09-05 21:45:29 +00:00
encryptedPassportElement type:PassportElementType data:bytes front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector<datedFile> files:vector<datedFile> value:string hash:string = EncryptedPassportElement;
//@class InputPassportElementErrorSource @description Contains the description of an error in a Telegram Passport element; for bots only
//@description The element contains an error in an unspecified place. The error will be considered resolved when new data is added @element_hash Current hash of the entire element
inputPassportElementErrorSourceUnspecified element_hash:bytes = InputPassportElementErrorSource;
//@description A data field contains an error. The error is considered resolved when the field's value changes @field_name Field name @data_hash Current data hash
inputPassportElementErrorSourceDataField field_name:string data_hash:bytes = InputPassportElementErrorSource;
//@description The front side of the document contains an error. The error is considered resolved when the file with the front side of the document changes @file_hash Current hash of the file containing the front side
inputPassportElementErrorSourceFrontSide file_hash:bytes = InputPassportElementErrorSource;
//@description The reverse side of the document contains an error. The error is considered resolved when the file with the reverse side of the document changes @file_hash Current hash of the file containing the reverse side
inputPassportElementErrorSourceReverseSide file_hash:bytes = InputPassportElementErrorSource;
//@description The selfie contains an error. The error is considered resolved when the file with the selfie changes @file_hash Current hash of the file containing the selfie
inputPassportElementErrorSourceSelfie file_hash:bytes = InputPassportElementErrorSource;
//@description One of the files containing the translation of the document contains an error. The error is considered resolved when the file with the translation changes @file_hash Current hash of the file containing the translation
inputPassportElementErrorSourceTranslationFile file_hash:bytes = InputPassportElementErrorSource;
//@description The translation of the document contains an error. The error is considered resolved when the list of files changes @file_hashes Current hashes of all files with the translation
inputPassportElementErrorSourceTranslationFiles file_hashes:vector<bytes> = InputPassportElementErrorSource;
//@description The file contains an error. The error is considered resolved when the file changes @file_hash Current hash of the file which has the error
inputPassportElementErrorSourceFile file_hash:bytes = InputPassportElementErrorSource;
//@description The list of attached files contains an error. The error is considered resolved when the file list changes @file_hashes Current hashes of all attached files
inputPassportElementErrorSourceFiles file_hashes:vector<bytes> = InputPassportElementErrorSource;
//@description Contains the description of an error in a Telegram Passport element; for bots only @type Type of Telegram Passport element that has the error @message Error message @source Error source
inputPassportElementError type:PassportElementType message:string source:InputPassportElementErrorSource = InputPassportElementError;
2018-08-30 14:55:42 +00:00
//@class MessageContent @description Contains the content of a message
//@description A text message @text Text of the message @web_page A preview of the web page that's mentioned in the text; may be null
messageText text:formattedText web_page:webPage = MessageContent;
2022-12-30 18:28:59 +00:00
//@description An animation message (GIF-style).
//@animation The animation description
//@caption Animation caption
//@has_spoiler True, if the animation preview must be covered by a spoiler animation
//@is_secret True, if the animation thumbnail must be blurred and the animation must be shown only while tapped
messageAnimation animation:animation caption:formattedText has_spoiler:Bool is_secret:Bool = MessageContent;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description An audio message @audio The audio description @caption Audio caption
2018-08-30 14:55:42 +00:00
messageAudio audio:audio caption:formattedText = MessageContent;
2020-02-03 12:56:20 +00:00
//@description A document message (general file) @document The document description @caption Document caption
2018-08-30 14:55:42 +00:00
messageDocument document:document caption:formattedText = MessageContent;
2022-12-30 18:28:59 +00:00
//@description A photo message
//@photo The photo
//@caption Photo caption
//@has_spoiler True, if the photo preview must be covered by a spoiler animation
//@is_secret True, if the photo must be blurred and must be shown only while tapped
messagePhoto photo:photo caption:formattedText has_spoiler:Bool is_secret:Bool = MessageContent;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A self-destructed photo message
2018-08-30 14:55:42 +00:00
messageExpiredPhoto = MessageContent;
2022-06-21 18:10:07 +00:00
//@description A sticker message @sticker The sticker description @is_premium True, if premium animation of the sticker must be played
messageSticker sticker:sticker is_premium:Bool = MessageContent;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A video message
//@video The video description
//@caption Video caption
//@has_spoiler True, if the video preview must be covered by a spoiler animation
//@is_secret True, if the video thumbnail must be blurred and the video must be shown only while tapped
messageVideo video:video caption:formattedText has_spoiler:Bool is_secret:Bool = MessageContent;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A self-destructed video message
2018-08-30 14:55:42 +00:00
messageExpiredVideo = MessageContent;
2020-02-03 12:56:20 +00:00
//@description A video note message @video_note The video note description @is_viewed True, if at least one of the recipients has viewed the video note @is_secret True, if the video note thumbnail must be blurred and the video note must be shown only while tapped
2018-08-30 14:55:42 +00:00
messageVideoNote video_note:videoNote is_viewed:Bool is_secret:Bool = MessageContent;
2020-02-03 12:56:20 +00:00
//@description A voice note message @voice_note The voice note description @caption Voice note caption @is_listened True, if at least one of the recipients has listened to the voice note
2018-08-30 14:55:42 +00:00
messageVoiceNote voice_note:voiceNote caption:formattedText is_listened:Bool = MessageContent;
2022-12-30 18:28:59 +00:00
//@description A message with a location
//@location The location description
//@live_period Time relative to the message send date, for which the location can be updated, in seconds
2018-08-30 14:55:42 +00:00
//@expires_in Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes
2020-11-30 09:33:47 +00:00
//@heading For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown
2022-12-30 18:28:59 +00:00
//@proximity_alert_radius 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
2020-11-30 09:33:47 +00:00
messageLocation location:location live_period:int32 expires_in:int32 heading:int32 proximity_alert_radius:int32 = MessageContent;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description A message with information about a venue @venue The venue description
2018-08-30 14:55:42 +00:00
messageVenue venue:venue = MessageContent;
2020-02-03 12:56:20 +00:00
//@description A message with a user contact @contact The contact description
2018-08-30 14:55:42 +00:00
messageContact contact:contact = MessageContent;
2021-12-30 05:55:02 +00:00
//@description A message with an animated emoji @animated_emoji The animated emoji @emoji The corresponding emoji
messageAnimatedEmoji animated_emoji:animatedEmoji emoji:string = MessageContent;
2020-11-30 09:33:47 +00:00
//@description A dice message. The dice value is randomly generated by the server
//@initial_state The animated stickers with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
//@final_state The animated stickers with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
//@emoji Emoji on which the dice throw animation is based
//@value The dice value. If the value is 0, the dice don't have final state yet
//@success_animation_frame_number Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded
messageDice initial_state:DiceStickers final_state:DiceStickers emoji:string value:int32 success_animation_frame_number:int32 = MessageContent;
2020-02-03 12:56:20 +00:00
//@description A message with a game @game The game description
2018-08-30 14:55:42 +00:00
messageGame game:game = MessageContent;
2020-02-03 12:56:20 +00:00
//@description A message with a poll @poll The poll description
2019-06-07 10:56:06 +00:00
messagePoll poll:poll = MessageContent;
2022-12-30 18:28:59 +00:00
//@description A message with an invoice from a bot
//@title Product title
//@param_description Product description
//@photo Product photo; may be null
//@currency Currency for the product price
//@total_amount Product total price in the smallest units of the currency
//@start_parameter Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter}
//@is_test True, if the invoice is a test invoice
//@need_shipping_address True, if the shipping address must be specified
//@receipt_message_id The identifier of the message with the receipt, after the product has been purchased
2022-11-07 18:50:52 +00:00
//@extended_media Extended media attached to the invoice; may be null
messageInvoice title:string description:formattedText photo:photo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 extended_media:MessageExtendedMedia = MessageContent;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description A message with information about an ended call @is_video True, if the call was a video call @discard_reason Reason why the call was discarded @duration Call duration, in seconds
messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = MessageContent;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A new video chat was scheduled @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator
messageVideoChatScheduled group_call_id:int32 start_date:int32 = MessageContent;
//@description A newly created video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall
messageVideoChatStarted group_call_id:int32 = MessageContent;
//@description A message with information about an ended video chat @duration Call duration, in seconds
messageVideoChatEnded duration:int32 = MessageContent;
//@description A message with information about an invite to a video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @user_ids Invited user identifiers
messageInviteVideoChatParticipants group_call_id:int32 user_ids:vector<int53> = MessageContent;
2018-08-30 14:55:42 +00:00
//@description A newly created basic group @title Title of the basic group @member_user_ids User identifiers of members in the basic group
2021-12-30 05:55:02 +00:00
messageBasicGroupChatCreate title:string member_user_ids:vector<int53> = MessageContent;
2018-08-30 14:55:42 +00:00
//@description A newly created supergroup or channel @title Title of the supergroup or channel
messageSupergroupChatCreate title:string = MessageContent;
//@description An updated chat title @title New chat title
messageChatChangeTitle title:string = MessageContent;
//@description An updated chat photo @photo New chat photo
2020-11-30 09:33:47 +00:00
messageChatChangePhoto photo:chatPhoto = MessageContent;
2018-08-30 14:55:42 +00:00
//@description A deleted chat photo
messageChatDeletePhoto = MessageContent;
//@description New chat members were added @member_user_ids User identifiers of the new members
2021-12-30 05:55:02 +00:00
messageChatAddMembers member_user_ids:vector<int53> = MessageContent;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A new member joined the chat via an invite link
2018-08-30 14:55:42 +00:00
messageChatJoinByLink = MessageContent;
2021-12-30 05:55:02 +00:00
//@description A new member was accepted to the chat by an administrator
messageChatJoinByRequest = MessageContent;
2018-08-30 14:55:42 +00:00
//@description A chat member was deleted @user_id User identifier of the deleted chat member
2021-12-30 05:55:02 +00:00
messageChatDeleteMember user_id:int53 = MessageContent;
2018-08-30 14:55:42 +00:00
//@description A basic group was upgraded to a supergroup and was deactivated as the result @supergroup_id Identifier of the supergroup to which the basic group was upgraded
2021-12-30 05:55:02 +00:00
messageChatUpgradeTo supergroup_id:int53 = MessageContent;
2018-08-30 14:55:42 +00:00
//@description A supergroup has been created from a basic group @title Title of the newly created supergroup @basic_group_id The identifier of the original basic group
2021-12-30 05:55:02 +00:00
messageChatUpgradeFrom title:string basic_group_id:int53 = MessageContent;
2018-08-30 14:55:42 +00:00
2019-06-07 10:56:06 +00:00
//@description A message has been pinned @message_id Identifier of the pinned message, can be an identifier of a deleted message or 0
2018-08-30 14:55:42 +00:00
messagePinMessage message_id:int53 = MessageContent;
//@description A screenshot of a message in the chat has been taken
messageScreenshotTaken = MessageContent;
2023-02-04 22:54:46 +00:00
//@description A theme in the chat has been changed @theme_name If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one
2021-12-30 05:55:02 +00:00
messageChatSetTheme theme_name:string = MessageContent;
2022-12-30 18:28:59 +00:00
//@description The auto-delete or self-destruct timer for messages in the chat has been changed @message_auto_delete_time New value auto-delete or self-destruct time, in seconds; 0 if disabled @from_user_id If not 0, a user identifier, which default setting was automatically applied
messageChatSetMessageAutoDeleteTime message_auto_delete_time:int32 from_user_id:int53 = MessageContent;
2018-08-30 14:55:42 +00:00
2022-11-07 18:50:52 +00:00
//@description A forum topic has been created @name Name of the topic @icon Icon of the topic
messageForumTopicCreated name:string icon:forumTopicIcon = MessageContent;
2022-12-30 18:28:59 +00:00
//@description A forum topic has been edited
//@name If non-empty, the new name of the topic
//@edit_icon_custom_emoji_id True, if icon's custom_emoji_id is changed
//@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
2022-11-07 18:50:52 +00:00
messageForumTopicEdited name:string edit_icon_custom_emoji_id:Bool icon_custom_emoji_id:int64 = MessageContent;
2023-02-04 22:54:46 +00:00
//@description A forum topic has been closed or opened @is_closed True, if the topic was closed; otherwise, the topic was reopened
2022-11-07 18:50:52 +00:00
messageForumTopicIsClosedToggled is_closed:Bool = MessageContent;
2023-02-04 22:54:46 +00:00
//@description A General forum topic has been hidden or unhidden @is_hidden True, if the topic was hidden; otherwise, the topic was unhidden
2022-12-07 20:04:16 +00:00
messageForumTopicIsHiddenToggled is_hidden:Bool = MessageContent;
2022-12-30 18:28:59 +00:00
//@description A profile photo was suggested to a user in a private chat @photo The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo
messageSuggestProfilePhoto photo:chatPhoto = MessageContent;
2018-08-30 14:55:42 +00:00
//@description A non-standard action has happened in the chat @text Message text to be shown in the chat
messageCustomServiceAction text:string = MessageContent;
2019-06-07 10:56:06 +00:00
//@description A new high score was achieved in a game @game_message_id Identifier of the message with the game, can be an identifier of a deleted message @game_id Identifier of the game; may be different from the games presented in the message with the game @score New score
2018-08-30 14:55:42 +00:00
messageGameScore game_message_id:int53 game_id:int64 score:int32 = MessageContent;
2022-12-30 18:28:59 +00:00
//@description A payment has been completed
//@invoice_chat_id Identifier of the chat, containing the corresponding invoice message
//@invoice_message_id Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message
//@currency Currency for the price of the product
//@total_amount Total price for the product, in the smallest units of the currency
//@is_recurring True, if this is a recurring payment
//@is_first_recurring True, if this is the first recurring payment
//@invoice_name Name of the invoice; may be empty if unknown
2022-06-21 18:10:07 +00:00
messagePaymentSuccessful invoice_chat_id:int53 invoice_message_id:int53 currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_name:string = MessageContent;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A payment has been completed; for bots only
//@currency Currency for price of the product
//@total_amount Total price for the product, in the smallest units of the currency
//@is_recurring True, if this is a recurring payment
//@is_first_recurring True, if this is the first recurring payment
//@invoice_payload Invoice payload
//@shipping_option_id Identifier of the shipping option chosen by the user; may be empty if not applicable
//@order_info Information about the order; may be null
//@telegram_payment_charge_id Telegram payment identifier
//@provider_payment_charge_id Provider payment identifier
2022-06-21 18:10:07 +00:00
messagePaymentSuccessfulBot currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Telegram Premium was gifted to the user
//@currency Currency for the paid amount
//@amount The paid amount, in the smallest units of the currency
//@month_count Number of month the Telegram Premium subscription will be active
2022-08-13 15:24:07 +00:00
//@sticker A sticker to be shown in the message; may be null if unknown
messageGiftedPremium currency:string amount:int53 month_count:int32 sticker:sticker = MessageContent;
2018-08-30 14:55:42 +00:00
//@description A contact has registered with Telegram
messageContactRegistered = MessageContent;
2023-02-04 22:54:46 +00:00
//@description The current user shared a user, which was requested by the bot @user_id Identifier of the shared user @button_id Identifier of the keyboard button with the request
messageUserShared user_id:int53 button_id:int32 = MessageContent;
//@description The current user shared a chat, which was requested by the bot @chat_id Identifier of the shared chat @button_id Identifier of the keyboard button with the request
messageChatShared chat_id:int53 button_id:int32 = MessageContent;
2018-08-30 14:55:42 +00:00
//@description The current user has connected a website by logging in using Telegram Login Widget on it @domain_name Domain name of the connected website
messageWebsiteConnected domain_name:string = MessageContent;
2022-12-30 18:28:59 +00:00
//@description The user allowed the bot to send messages
messageBotWriteAccessAllowed = MessageContent;
2022-06-21 18:10:07 +00:00
//@description Data from a Web App has been sent to a bot @button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App
2022-04-24 20:33:39 +00:00
messageWebAppDataSent button_text:string = MessageContent;
2022-06-21 18:10:07 +00:00
//@description Data from a Web App has been received; for bots only @button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App @data Received data
2022-04-24 20:33:39 +00:00
messageWebAppDataReceived button_text:string data:string = MessageContent;
//@description Telegram Passport data has been sent to a bot @types List of Telegram Passport element types sent
2018-09-05 21:45:29 +00:00
messagePassportDataSent types:vector<PassportElementType> = MessageContent;
//@description Telegram Passport data has been received; for bots only @elements List of received Telegram Passport elements @credentials Encrypted data credentials
messagePassportDataReceived elements:vector<encryptedPassportElement> credentials:encryptedCredentials = MessageContent;
2021-12-30 05:55:02 +00:00
//@description A user in the chat came within proximity alert range @traveler_id The identifier of a user or chat that triggered the proximity alert @watcher_id The identifier of a user or chat that subscribed for the proximity alert @distance The distance between the users
messageProximityAlertTriggered traveler_id:MessageSender watcher_id:MessageSender distance:int32 = MessageContent;
2020-11-30 09:33:47 +00:00
//@description Message content that is not supported in the current TDLib version
2018-08-30 14:55:42 +00:00
messageUnsupported = MessageContent;
//@class TextEntityType @description Represents a part of the text which must be formatted differently
2022-11-07 18:50:52 +00:00
//@description A mention of a user, a supergroup, or a channel by their username
2018-08-30 14:55:42 +00:00
textEntityTypeMention = TextEntityType;
//@description A hashtag text, beginning with "#"
textEntityTypeHashtag = TextEntityType;
2021-12-30 05:55:02 +00:00
//@description A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD")
2018-08-30 14:55:42 +00:00
textEntityTypeCashtag = TextEntityType;
2021-12-30 05:55:02 +00:00
//@description A bot command, beginning with "/"
2018-08-30 14:55:42 +00:00
textEntityTypeBotCommand = TextEntityType;
//@description An HTTP URL
textEntityTypeUrl = TextEntityType;
//@description An email address
textEntityTypeEmailAddress = TextEntityType;
2020-02-03 12:56:20 +00:00
//@description A phone number
textEntityTypePhoneNumber = TextEntityType;
2020-11-30 09:33:47 +00:00
//@description A bank card number. The getBankCardInfo method can be used to get information about the bank card
textEntityTypeBankCardNumber = TextEntityType;
2018-08-30 14:55:42 +00:00
//@description A bold text
textEntityTypeBold = TextEntityType;
//@description An italic text
textEntityTypeItalic = TextEntityType;
2020-02-03 12:56:20 +00:00
//@description An underlined text
textEntityTypeUnderline = TextEntityType;
//@description A strikethrough text
textEntityTypeStrikethrough = TextEntityType;
2022-08-13 15:24:07 +00:00
//@description A spoiler text
2022-01-26 21:05:08 +00:00
textEntityTypeSpoiler = TextEntityType;
2018-08-30 14:55:42 +00:00
//@description Text that must be formatted as if inside a code HTML tag
textEntityTypeCode = TextEntityType;
//@description Text that must be formatted as if inside a pre HTML tag
textEntityTypePre = TextEntityType;
//@description Text that must be formatted as if inside pre, and code HTML tags @language Programming language of the code; as defined by the sender
textEntityTypePreCode language:string = TextEntityType;
2018-09-05 21:45:29 +00:00
//@description A text description shown instead of a raw URL @url HTTP or tg:// URL to be opened when the link is clicked
2018-08-30 14:55:42 +00:00
textEntityTypeTextUrl url:string = TextEntityType;
//@description A text shows instead of a raw mention of the user (e.g., when the user has no username) @user_id Identifier of the mentioned user
2021-12-30 05:55:02 +00:00
textEntityTypeMentionName user_id:int53 = TextEntityType;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@description A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji @custom_emoji_id Unique identifier of the custom emoji
textEntityTypeCustomEmoji custom_emoji_id:int64 = TextEntityType;
2021-12-30 05:55:02 +00:00
//@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message
textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size
//@thumbnail Thumbnail file to send. Sending thumbnails by file_id is currently not supported
//@width Thumbnail width, usually shouldn't exceed 320. Use 0 if unknown
//@height Thumbnail height, usually shouldn't exceed 320. Use 0 if unknown
2018-08-30 14:55:42 +00:00
inputThumbnail thumbnail:InputFile width:int32 height:int32 = InputThumbnail;
2020-02-03 12:56:20 +00:00
//@class MessageSchedulingState @description Contains information about the time when a scheduled message will be sent
//@description The message will be sent at the specified date @send_date Date the message will be sent. The date must be within 367 days in the future
messageSchedulingStateSendAtDate send_date:int32 = MessageSchedulingState;
//@description The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known
messageSchedulingStateSendWhenOnline = MessageSchedulingState;
2020-11-30 09:33:47 +00:00
//@description Options to be used when a message is sent
//@disable_notification Pass true to disable notification for the message
2020-02-03 12:56:20 +00:00
//@from_background Pass true if the message is sent from the background
2022-01-26 21:05:08 +00:00
//@protect_content Pass true if the content of the message must be protected from forwarding and saving; for bots only
2022-09-18 01:34:29 +00:00
//@update_order_of_installed_sticker_sets Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum
2021-12-30 05:55:02 +00:00
//@scheduling_state Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled
2022-09-18 01:34:29 +00:00
messageSendOptions disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState = MessageSendOptions;
2020-11-30 09:33:47 +00:00
2021-12-30 05:55:02 +00:00
//@description Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied
//@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local
2020-11-30 09:33:47 +00:00
//@replace_caption True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false
2021-12-30 05:55:02 +00:00
//@new_caption New message caption; pass null to copy message without caption. Ignored if replace_caption is false
2020-11-30 09:33:47 +00:00
messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText = MessageCopyOptions;
2020-02-03 12:56:20 +00:00
2018-08-30 14:55:42 +00:00
//@class InputMessageContent @description The content of a message to send
2022-12-30 18:28:59 +00:00
//@description A text message
//@text Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually
//@disable_web_page_preview True, if rich web page previews for URLs in the message text must be disabled
//@clear_draft True, if a chat message draft must be deleted
2018-08-30 14:55:42 +00:00
inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent;
2022-12-30 18:28:59 +00:00
//@description An animation message (GIF-style).
//@animation Animation file to be sent
//@thumbnail Animation thumbnail; pass null to skip thumbnail uploading
//@added_sticker_file_ids File identifiers of the stickers added to the animation, if applicable
//@duration Duration of the animation, in seconds
//@width Width of the animation; may be replaced by the server
//@height Height of the animation; may be replaced by the server
//@caption Animation caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
//@has_spoiler True, if the animation preview must be covered by a spoiler animation; not supported in secret chats
inputMessageAnimation animation:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> duration:int32 width:int32 height:int32 caption:formattedText has_spoiler:Bool = InputMessageContent;
//@description An audio message
//@audio Audio file to be sent
//@album_cover_thumbnail Thumbnail of the cover for the album; pass null to skip thumbnail uploading
//@duration Duration of the audio, in seconds; may be replaced by the server
//@title Title of the audio; 0-64 characters; may be replaced by the server
//@performer Performer of the audio; 0-64 characters, may be replaced by the server
//@caption Audio caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
2018-08-30 14:55:42 +00:00
inputMessageAudio audio:InputFile album_cover_thumbnail:inputThumbnail duration:int32 title:string performer:string caption:formattedText = InputMessageContent;
2022-12-30 18:28:59 +00:00
//@description A document message (general file)
//@document Document to be sent
//@thumbnail Document thumbnail; pass null to skip thumbnail uploading
//@disable_content_type_detection If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats
//@caption Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
2020-11-30 09:33:47 +00:00
inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content_type_detection:Bool caption:formattedText = InputMessageContent;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A photo message
//@photo 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
//@thumbnail Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats
//@added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable
//@width Photo width
//@height Photo height
//@caption Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
//@self_destruct_time Photo self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats
//@has_spoiler True, if the photo preview must be covered by a spoiler animation; not supported in secret chats
inputMessagePhoto photo:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> width:int32 height:int32 caption:formattedText self_destruct_time:int32 has_spoiler:Bool = InputMessageContent;
//@description A sticker message
//@sticker Sticker to be sent
//@thumbnail Sticker thumbnail; pass null to skip thumbnail uploading
//@width Sticker width
//@height Sticker height
//@emoji Emoji used to choose the sticker
2021-12-30 05:55:02 +00:00
inputMessageSticker sticker:InputFile thumbnail:inputThumbnail width:int32 height:int32 emoji:string = InputMessageContent;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A video message
//@video Video to be sent
//@thumbnail Video thumbnail; pass null to skip thumbnail uploading
//@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable
//@duration Duration of the video, in seconds
//@width Video width
//@height Video height
//@supports_streaming True, if the video is supposed to be streamed
//@caption Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
//@self_destruct_time Video self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats
//@has_spoiler True, if the video preview must be covered by a spoiler animation; not supported in secret chats
inputMessageVideo video:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> duration:int32 width:int32 height:int32 supports_streaming:Bool caption:formattedText self_destruct_time:int32 has_spoiler:Bool = InputMessageContent;
//@description A video note message
//@video_note Video note to be sent
//@thumbnail Video thumbnail; pass null to skip thumbnail uploading
//@duration Duration of the video, in seconds
//@length Video width and height; must be positive and not greater than 640
2018-08-30 14:55:42 +00:00
inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int32 length:int32 = InputMessageContent;
2022-12-30 18:28:59 +00:00
//@description A voice note message
//@voice_note Voice note to be sent
//@duration Duration of the voice note, in seconds
//@waveform Waveform representation of the voice note in 5-bit format
//@caption Voice note caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
2018-08-30 14:55:42 +00:00
inputMessageVoiceNote voice_note:InputFile duration:int32 waveform:bytes caption:formattedText = InputMessageContent;
2022-12-30 18:28:59 +00:00
//@description A message with a location
//@location Location to be sent
//@live_period Period for which the location can be updated, in seconds; must be between 60 and 86400 for a live location and 0 otherwise
2020-11-30 09:33:47 +00:00
//@heading For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown
//@proximity_alert_radius For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can't be enabled in channels and Saved Messages
inputMessageLocation location:location live_period:int32 heading:int32 proximity_alert_radius:int32 = InputMessageContent;
2018-08-30 14:55:42 +00:00
//@description A message with information about a venue @venue Venue to send
inputMessageVenue venue:venue = InputMessageContent;
//@description A message containing a user contact @contact Contact to send
inputMessageContact contact:contact = InputMessageContent;
2021-12-30 05:55:02 +00:00
//@description A dice message @emoji Emoji on which the dice throw animation is based @clear_draft True, if the chat message draft must be deleted
2020-11-30 09:33:47 +00:00
inputMessageDice emoji:string clear_draft:Bool = InputMessageContent;
2018-08-30 14:55:42 +00:00
//@description A message with a game; not supported for channels or secret chats @bot_user_id User identifier of the bot that owns the game @game_short_name Short name of the game
2021-12-30 05:55:02 +00:00
inputMessageGame bot_user_id:int53 game_short_name:string = InputMessageContent;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A message with an invoice; can be used only by bots
//@invoice Invoice
//@title Product title; 1-32 characters
//@param_description Product description; 0-255 characters
//@photo_url Product photo URL; optional
//@photo_size Product photo size
//@photo_width Product photo width
//@photo_height Product photo height
//@payload The invoice payload
//@provider_token Payment provider token
//@provider_data JSON-encoded data about the invoice, which will be shared with the payment provider
2021-12-30 05:55:02 +00:00
//@start_parameter Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message
2022-11-07 18:50:52 +00:00
//@extended_media_content 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
inputMessageInvoice invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string extended_media_content:InputMessageContent = InputMessageContent;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot
//@question Poll question; 1-255 characters (up to 300 characters for bots)
//@options List of poll answer options, 2-10 strings 1-100 characters each
//@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels
//@type Type of the poll
2020-11-30 09:33:47 +00:00
//@open_period Amount of time the poll will be active after creation, in seconds; for bots only
2021-12-30 05:55:02 +00:00
//@close_date Point in time (Unix timestamp) when the poll will automatically be closed; for bots only
2020-11-30 09:33:47 +00:00
//@is_closed True, if the poll needs to be sent already closed; for bots only
inputMessagePoll question:string options:vector<string> is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = InputMessageContent;
2019-06-07 10:56:06 +00:00
2022-12-30 18:28:59 +00:00
//@description A forwarded message
//@from_chat_id Identifier for the chat this forwarded message came from
//@message_id Identifier of the message to forward
2021-12-30 05:55:02 +00:00
//@in_game_share True, if a game message is being shared from a launched game; applies only to game messages
//@copy_options Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual
2020-11-30 09:33:47 +00:00
inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool copy_options:messageCopyOptions = InputMessageContent;
2018-08-30 14:55:42 +00:00
//@class SearchMessagesFilter @description Represents a filter for message search results
//@description Returns all found messages, no filter is applied
searchMessagesFilterEmpty = SearchMessagesFilter;
//@description Returns only animation messages
searchMessagesFilterAnimation = SearchMessagesFilter;
//@description Returns only audio messages
searchMessagesFilterAudio = SearchMessagesFilter;
//@description Returns only document messages
searchMessagesFilterDocument = SearchMessagesFilter;
//@description Returns only photo messages
searchMessagesFilterPhoto = SearchMessagesFilter;
//@description Returns only video messages
searchMessagesFilterVideo = SearchMessagesFilter;
//@description Returns only voice note messages
searchMessagesFilterVoiceNote = SearchMessagesFilter;
//@description Returns only photo and video messages
searchMessagesFilterPhotoAndVideo = SearchMessagesFilter;
//@description Returns only messages containing URLs
searchMessagesFilterUrl = SearchMessagesFilter;
//@description Returns only messages containing chat photos
searchMessagesFilterChatPhoto = SearchMessagesFilter;
//@description Returns only video note messages
searchMessagesFilterVideoNote = SearchMessagesFilter;
//@description Returns only voice and video note messages
searchMessagesFilterVoiceAndVideoNote = SearchMessagesFilter;
//@description Returns only messages with mentions of the current user, or messages that are replies to their messages
searchMessagesFilterMention = SearchMessagesFilter;
2020-11-30 09:33:47 +00:00
//@description Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user
2018-08-30 14:55:42 +00:00
searchMessagesFilterUnreadMention = SearchMessagesFilter;
2022-02-06 18:36:17 +00:00
//@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
searchMessagesFilterUnreadReaction = SearchMessagesFilter;
2020-11-30 09:33:47 +00:00
//@description Returns only failed to send messages. This filter can be used only if the message database is used
searchMessagesFilterFailedToSend = SearchMessagesFilter;
//@description Returns only pinned messages
searchMessagesFilterPinned = SearchMessagesFilter;
2018-08-30 14:55:42 +00:00
//@class ChatAction @description Describes the different types of activity in a chat
//@description The user is typing a message
chatActionTyping = ChatAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The user is recording a video
chatActionRecordingVideo = ChatAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The user is uploading a video @progress Upload progress, as a percentage
chatActionUploadingVideo progress:int32 = ChatAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The user is recording a voice note
chatActionRecordingVoiceNote = ChatAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The user is uploading a voice note @progress Upload progress, as a percentage
chatActionUploadingVoiceNote progress:int32 = ChatAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The user is uploading a photo @progress Upload progress, as a percentage
chatActionUploadingPhoto progress:int32 = ChatAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The user is uploading a document @progress Upload progress, as a percentage
chatActionUploadingDocument progress:int32 = ChatAction;
2021-12-30 05:55:02 +00:00
//@description The user is picking a sticker to send
chatActionChoosingSticker = ChatAction;
2018-08-30 14:55:42 +00:00
//@description The user is picking a location or venue to send
chatActionChoosingLocation = ChatAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The user is picking a contact to send
chatActionChoosingContact = ChatAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The user has started to play a game
chatActionStartPlayingGame = ChatAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The user is recording a video note
chatActionRecordingVideoNote = ChatAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The user is uploading a video note @progress Upload progress, as a percentage
chatActionUploadingVideoNote progress:int32 = ChatAction;
2021-12-30 05:55:02 +00:00
//@description The user is watching animations sent by the other party by clicking on an animated emoji @emoji The animated emoji
chatActionWatchingAnimations emoji:string = ChatAction;
//@description The user has canceled the previous action
2018-08-30 14:55:42 +00:00
chatActionCancel = ChatAction;
//@class UserStatus @description Describes the last time the user was online
//@description The user status was never changed
userStatusEmpty = UserStatus;
//@description The user is online @expires Point in time (Unix timestamp) when the user's online status will expire
userStatusOnline expires:int32 = UserStatus;
//@description The user is offline @was_online Point in time (Unix timestamp) when the user was last online
userStatusOffline was_online:int32 = UserStatus;
//@description The user was online recently
userStatusRecently = UserStatus;
//@description The user is offline, but was online last week
userStatusLastWeek = UserStatus;
//@description The user is offline, but was online last month
userStatusLastMonth = UserStatus;
//@description Represents a list of stickers @stickers List of stickers
stickers stickers:vector<sticker> = Stickers;
2019-09-10 12:36:54 +00:00
//@description Represents a list of emoji @emojis List of emojis
emojis emojis:vector<string> = Emojis;
2018-08-30 14:55:42 +00:00
2019-09-10 12:36:54 +00:00
//@description Represents a sticker set
2022-12-30 18:28:59 +00:00
//@id Identifier of the sticker set
//@title Title of the sticker set
//@name Name of the sticker set
//@thumbnail 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
2021-12-30 05:55:02 +00:00
//@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
2022-12-30 18:28:59 +00:00
//@is_installed True, if the sticker set has been installed by the current user
//@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
//@is_official True, if the sticker set is official
//@sticker_format Format of the stickers in the set
//@sticker_type Type of the stickers in the set
//@is_viewed True for already viewed trending sticker sets
//@stickers List of stickers in this set
//@emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object
2022-08-13 15:24:07 +00:00
stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector<closedVectorPath> is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType is_viewed:Bool stickers:vector<sticker> emojis:vector<emojis> = StickerSet;
2018-08-30 14:55:42 +00:00
2019-09-10 12:36:54 +00:00
//@description Represents short information about a sticker set
2022-12-30 18:28:59 +00:00
//@id Identifier of the sticker set
//@title Title of the sticker set
//@name Name of the sticker set
//@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null
2021-12-30 05:55:02 +00:00
//@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
2022-12-30 18:28:59 +00:00
//@is_installed True, if the sticker set has been installed by the current user
//@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
//@is_official True, if the sticker set is official
//@sticker_format Format of the stickers in the set
//@sticker_type Type of the stickers in the set
//@is_viewed True for already viewed trending sticker sets
//@size Total number of stickers in the set
//@covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested
2022-08-13 15:24:07 +00:00
stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector<closedVectorPath> is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType is_viewed:Bool size:int32 covers:vector<sticker> = StickerSetInfo;
2018-08-30 14:55:42 +00:00
//@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets
stickerSets total_count:int32 sets:vector<stickerSetInfo> = StickerSets;
2022-06-21 18:10:07 +00:00
//@description Represents a list of trending sticker sets @total_count Approximate total number of trending sticker sets @sets List of trending sticker sets @is_premium True, if the list contains sticker sets with premium stickers
trendingStickerSets total_count:int32 sets:vector<stickerSetInfo> is_premium:Bool = TrendingStickerSets;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@description Contains a list of similar emoji to search for in getStickers and searchStickers
//@name Name of the category
//@icon_custom_emoji_id Unique identifier of the custom emoji, which represents icon of the category
//@emojis List of emojis in the category
emojiCategory name:string icon_custom_emoji_id:int64 emojis:vector<string> = EmojiCategory;
//@description Represents a list of emoji categories @categories List of categories
emojiCategories categories:vector<emojiCategory> = EmojiCategories;
//@class EmojiCategoryType @description Describes type of an emoji category
//@description The category must be used by default
emojiCategoryTypeDefault = EmojiCategoryType;
//@description The category must be used for emoji status selection
emojiCategoryTypeEmojiStatus = EmojiCategoryType;
//@description The category must be used for chat photo emoji selection
emojiCategoryTypeChatPhoto = EmojiCategoryType;
2018-08-30 14:55:42 +00:00
//@class CallDiscardReason @description Describes the reason why a call was discarded
//@description The call wasn't discarded, or the reason is unknown
callDiscardReasonEmpty = CallDiscardReason;
2021-12-30 05:55:02 +00:00
//@description The call was ended before the conversation started. It was canceled by the caller or missed by the other party
2018-08-30 14:55:42 +00:00
callDiscardReasonMissed = CallDiscardReason;
//@description The call was ended before the conversation started. It was declined by the other party
callDiscardReasonDeclined = CallDiscardReason;
//@description The call was ended during the conversation because the users were disconnected
callDiscardReasonDisconnected = CallDiscardReason;
//@description The call was ended because one of the parties hung up
callDiscardReasonHungUp = CallDiscardReason;
2020-11-30 09:33:47 +00:00
//@description Specifies the supported call protocols
//@udp_p2p True, if UDP peer-to-peer connections are supported
//@udp_reflector True, if connection through UDP reflectors is supported
//@min_layer The minimum supported API layer; use 65
//@max_layer The maximum supported API layer; use 65
2021-12-30 05:55:02 +00:00
//@library_versions List of supported tgcalls versions
2020-11-30 09:33:47 +00:00
callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 library_versions:vector<string> = CallProtocol;
//@class CallServerType @description Describes the type of a call server
2022-06-21 18:10:07 +00:00
//@description A Telegram call reflector @peer_tag A peer tag to be used with the reflector @is_tcp True, if the server uses TCP instead of UDP
callServerTypeTelegramReflector peer_tag:bytes is_tcp:Bool = CallServerType;
2020-11-30 09:33:47 +00:00
2022-12-30 18:28:59 +00:00
//@description A WebRTC server
//@username Username to be used for authentication
//@password Authentication password
//@supports_turn True, if the server supports TURN
//@supports_stun True, if the server supports STUN
2020-11-30 09:33:47 +00:00
callServerTypeWebrtc username:string password:string supports_turn:Bool supports_stun:Bool = CallServerType;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
2022-12-30 18:28:59 +00:00
//@description Describes a server for relaying call data
//@id Server identifier
//@ip_address Server IPv4 address
//@ipv6_address Server IPv6 address
//@port Server port number
//@type Server type
2020-11-30 09:33:47 +00:00
callServer id:int64 ip_address:string ipv6_address:string port:int32 type:CallServerType = CallServer;
2018-08-30 14:55:42 +00:00
//@description Contains the call identifier @id Call identifier
callId id:int32 = CallId;
2021-12-30 05:55:02 +00:00
//@description Contains the group call identifier @id Group call identifier
groupCallId id:int32 = GroupCallId;
2018-08-30 14:55:42 +00:00
//@class CallState @description Describes the current call state
//@description The call is pending, waiting to be accepted by a user @is_created True, if the call has already been created by the server @is_received True, if the call has already been received by the other party
callStatePending is_created:Bool is_received:Bool = CallState;
//@description The call has been answered and encryption keys are being exchanged
callStateExchangingKeys = CallState;
2022-12-30 18:28:59 +00:00
//@description The call is ready to use
//@protocol Call protocols supported by the peer
//@servers List of available call servers
//@config A JSON-encoded call config
//@encryption_key Call encryption key
//@emojis Encryption key emojis fingerprint
//@allow_p2p True, if peer-to-peer connection is allowed by users privacy settings
2020-11-30 09:33:47 +00:00
callStateReady protocol:callProtocol servers:vector<callServer> config:string encryption_key:bytes emojis:vector<string> allow_p2p:Bool = CallState;
2018-08-30 14:55:42 +00:00
//@description The call is hanging up after discardCall has been called
callStateHangingUp = CallState;
2022-12-30 18:28:59 +00:00
//@description The call has ended successfully
//@reason The reason, why the call has ended
//@need_rating True, if the call rating must be sent to the server
//@need_debug_information True, if the call debug information must be sent to the server
//@need_log True, if the call log must be sent to the server
2022-05-09 11:35:19 +00:00
callStateDiscarded reason:CallDiscardReason need_rating:Bool need_debug_information:Bool need_log:Bool = CallState;
2018-08-30 14:55:42 +00:00
//@description The call has ended with an error @error Error. An error with the code 4005000 will be returned if an outgoing call is missed because of an expired timeout
callStateError error:error = CallState;
2021-12-30 05:55:02 +00:00
//@class GroupCallVideoQuality @description Describes the quality of a group call video
//@description The worst available video quality
groupCallVideoQualityThumbnail = GroupCallVideoQuality;
//@description The medium video quality
groupCallVideoQualityMedium = GroupCallVideoQuality;
//@description The best available video quality
groupCallVideoQualityFull = GroupCallVideoQuality;
2022-03-13 04:04:12 +00:00
//@description Describes an available stream in a group call
//@channel_id Identifier of an audio/video channel
//@scale Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds
//@time_offset Point in time when the stream currently ends; Unix timestamp in milliseconds
groupCallStream channel_id:int32 scale:int32 time_offset:int53 = GroupCallStream;
//@description Represents a list of group call streams @streams A list of group call streams
groupCallStreams streams:vector<groupCallStream> = GroupCallStreams;
2023-02-04 22:54:46 +00:00
//@description Represents an RTMP URL @url The URL @stream_key Stream key
2022-03-13 04:04:12 +00:00
rtmpUrl url:string stream_key:string = RtmpUrl;
2021-12-30 05:55:02 +00:00
//@description Describes a recently speaking participant in a group call @participant_id Group call participant identifier @is_speaking True, is the user has spoken recently
groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCallRecentSpeaker;
//@description Describes a group call
//@id Group call identifier
//@title Group call title
//@scheduled_start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended
//@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call will start
//@is_active True, if the call is active
2022-03-13 04:04:12 +00:00
//@is_rtmp_stream True, if the chat is an RTMP stream instead of an ordinary video chat
2021-12-30 05:55:02 +00:00
//@is_joined True, if the call is joined
//@need_rejoin True, if user was kicked from the call because of network loss and the call needs to be rejoined
//@can_be_managed True, if the current user can manage the group call
//@participant_count Number of participants in the group call
2022-03-13 04:04:12 +00:00
//@has_hidden_listeners True, if group call participants, which are muted, aren't returned in participant list
2021-12-30 05:55:02 +00:00
//@loaded_all_participants True, if all group call participants are loaded
//@recent_speakers At most 3 recently speaking users in the group call
//@is_my_video_enabled True, if the current user's video is enabled
//@is_my_video_paused True, if the current user's video is paused
//@can_enable_video True, if the current user can broadcast video or share screen
//@mute_new_participants True, if only group call administrators can unmute new participants
//@can_toggle_mute_new_participants True, if the current user can enable or disable mute_new_participants setting
//@record_duration Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on
//@is_video_recorded True, if a video file is being recorded for the call
//@duration Call duration, in seconds; for ended calls only
2022-03-13 04:04:12 +00:00
groupCall id:int32 title:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_rtmp_stream:Bool is_joined:Bool need_rejoin:Bool can_be_managed:Bool participant_count:int32 has_hidden_listeners:Bool loaded_all_participants:Bool recent_speakers:vector<groupCallRecentSpeaker> is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall;
2021-12-30 05:55:02 +00:00
//@description Describes a group of video synchronization source identifiers @semantics The semantics of sources, one of "SIM" or "FID" @source_ids The list of synchronization source identifiers
groupCallVideoSourceGroup semantics:string source_ids:vector<int32> = GroupCallVideoSourceGroup;
2022-12-30 18:28:59 +00:00
//@description Contains information about a group call participant's video channel
//@source_groups List of synchronization source groups of the video
//@endpoint_id Video channel endpoint identifier
2022-12-07 20:04:16 +00:00
//@is_paused True, if the video is paused. This flag needs to be ignored, if new video frames are received
2021-12-30 05:55:02 +00:00
groupCallParticipantVideoInfo source_groups:vector<groupCallVideoSourceGroup> endpoint_id:string is_paused:Bool = GroupCallParticipantVideoInfo;
//@description Represents a group call participant
//@participant_id Identifier of the group call participant
//@audio_source_id User's audio channel synchronization source identifier
//@screen_sharing_audio_source_id User's screen sharing audio channel synchronization source identifier
//@video_info Information about user's video channel; may be null if there is no active video
//@screen_sharing_video_info Information about user's screen sharing video channel; may be null if there is no active screen sharing video
//@bio The participant user's bio or the participant chat's description
//@is_current_user True, if the participant is the current user
//@is_speaking True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking
//@is_hand_raised True, if the participant hand is raised
//@can_be_muted_for_all_users True, if the current user can mute the participant for all other group call participants
//@can_be_unmuted_for_all_users True, if the current user can allow the participant to unmute themselves or unmute the participant (if the participant is the current user)
//@can_be_muted_for_current_user True, if the current user can mute the participant only for self
//@can_be_unmuted_for_current_user True, if the current user can unmute the participant for self
//@is_muted_for_all_users True, if the participant is muted for all users
//@is_muted_for_current_user True, if the participant is muted for the current user
//@can_unmute_self True, if the participant is muted for all users, but can unmute themselves
//@volume_level Participant's volume level; 1-20000 in hundreds of percents
//@order User's order in the group call participant list. Orders must be compared lexicographically. The bigger is order, the higher is user in the list. If order is empty, the user must be removed from the participant list
groupCallParticipant participant_id:MessageSender audio_source_id:int32 screen_sharing_audio_source_id:int32 video_info:groupCallParticipantVideoInfo screen_sharing_video_info:groupCallParticipantVideoInfo bio:string is_current_user:Bool is_speaking:Bool is_hand_raised:Bool can_be_muted_for_all_users:Bool can_be_unmuted_for_all_users:Bool can_be_muted_for_current_user:Bool can_be_unmuted_for_current_user:Bool is_muted_for_all_users:Bool is_muted_for_current_user:Bool can_unmute_self:Bool volume_level:int32 order:string = GroupCallParticipant;
2019-09-10 12:36:54 +00:00
//@class CallProblem @description Describes the exact type of a problem with a call
//@description The user heard their own voice
callProblemEcho = CallProblem;
//@description The user heard background noise
callProblemNoise = CallProblem;
//@description The other side kept disappearing
callProblemInterruptions = CallProblem;
//@description The speech was distorted
callProblemDistortedSpeech = CallProblem;
//@description The user couldn't hear the other side
callProblemSilentLocal = CallProblem;
//@description The other side couldn't hear the user
callProblemSilentRemote = CallProblem;
//@description The call ended unexpectedly
callProblemDropped = CallProblem;
2020-11-30 09:33:47 +00:00
//@description The video was distorted
callProblemDistortedVideo = CallProblem;
//@description The video was pixelated
callProblemPixelatedVideo = CallProblem;
2019-09-10 12:36:54 +00:00
2022-12-30 18:28:59 +00:00
//@description Describes a call
//@id Call identifier, not persistent
//@user_id Peer user identifier
//@is_outgoing True, if the call is outgoing
//@is_video True, if the call is a video call
//@state Call state
2021-12-30 05:55:02 +00:00
call id:int32 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState = Call;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@class FirebaseAuthenticationSettings @description Contains settings for Firebase Authentication in the official applications
//@description Settings for Firebase Authentication in the official Android application
firebaseAuthenticationSettingsAndroid = FirebaseAuthenticationSettings;
//@description Settings for Firebase Authentication in the official iOS application @device_token Device token from Apple Push Notification service @is_app_sandbox True, if App Sandbox is enabled
firebaseAuthenticationSettingsIos device_token:string is_app_sandbox:Bool = FirebaseAuthenticationSettings;
2019-09-10 12:36:54 +00:00
//@description Contains settings for the authentication of the user's phone number
2021-12-30 05:55:02 +00:00
//@allow_flash_call Pass true if the authentication code may be sent via a flash call to the specified phone number
//@allow_missed_call Pass true if the authentication code may be sent via a missed call to the specified phone number
2019-09-10 12:36:54 +00:00
//@is_current_phone_number Pass true if the authenticated phone number is used on the current device
2020-11-30 09:33:47 +00:00
//@allow_sms_retriever_api For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details
2023-02-04 22:54:46 +00:00
//@firebase_authentication_settings For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication
2021-12-30 05:55:02 +00:00
//@authentication_tokens List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions
2023-02-04 22:54:46 +00:00
phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool is_current_phone_number:Bool allow_sms_retriever_api:Bool firebase_authentication_settings:FirebaseAuthenticationSettings authentication_tokens:vector<string> = PhoneNumberAuthenticationSettings;
2019-09-10 12:36:54 +00:00
2022-09-18 01:34:29 +00:00
//@description Represents a reaction applied to a message @type Type of the reaction @sender_id Identifier of the chat member, applied the reaction
addedReaction type:ReactionType sender_id:MessageSender = AddedReaction;
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
//@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, there are no more results
2022-02-06 18:36:17 +00:00
addedReactions total_count:int32 reactions:vector<addedReaction> next_offset:string = AddedReactions;
2022-09-18 01:34:29 +00:00
//@description Represents an available reaction @type Type of the reaction @needs_premium True, if Telegram Premium is needed to send the reaction
availableReaction type:ReactionType needs_premium:Bool = AvailableReaction;
2022-02-06 18:36:17 +00:00
2022-09-18 01:34:29 +00:00
//@description Represents a list of reactions that can be added to a message
//@top_reactions List of reactions to be shown at the top
//@recent_reactions List of recently used reactions
//@popular_reactions List of popular reactions
//@allow_custom_emoji True, if custom emoji reactions could be added by Telegram Premium subscribers
availableReactions top_reactions:vector<availableReaction> recent_reactions:vector<availableReaction> popular_reactions:vector<availableReaction> allow_custom_emoji:Bool = AvailableReactions;
2022-02-06 18:36:17 +00:00
2022-09-18 01:34:29 +00:00
//@description Contains information about a emoji reaction
//@emoji Text representation of the reaction
2022-02-06 18:36:17 +00:00
//@title Reaction title
//@is_active True, if the reaction can be added to new messages and enabled in chats
//@static_icon Static icon for the reaction
//@appear_animation Appear animation for the reaction
//@select_animation Select animation for the reaction
//@activate_animation Activate animation for the reaction
//@effect_animation Effect animation for the reaction
//@around_animation Around animation for the reaction; may be null
//@center_animation Center animation for the reaction; may be null
2022-09-18 01:34:29 +00:00
emojiReaction emoji:string title:string is_active:Bool static_icon:sticker appear_animation:sticker select_animation:sticker activate_animation:sticker effect_animation:sticker around_animation:sticker center_animation:sticker = EmojiReaction;
2022-02-06 18:36:17 +00:00
2018-08-30 14:55:42 +00:00
//@description Represents a list of animations @animations List of animations
animations animations:vector<animation> = Animations;
2021-12-30 05:55:02 +00:00
//@class DiceStickers @description Contains animated stickers which must be used for dice animation rendering
2020-11-30 09:33:47 +00:00
//@description A regular animated sticker @sticker The animated sticker with the dice animation
diceStickersRegular sticker:sticker = DiceStickers;
//@description Animated stickers to be combined into a slot machine
//@background The animated sticker with the slot machine background. The background animation must start playing after all reel animations finish
//@lever The animated sticker with the lever animation. The lever animation must play once in the initial dice state
//@left_reel The animated sticker with the left reel
//@center_reel The animated sticker with the center reel
//@right_reel The animated sticker with the right reel
diceStickersSlotMachine background:sticker lever:sticker left_reel:sticker center_reel:sticker right_reel:sticker = DiceStickers;
2022-12-30 18:28:59 +00:00
//@description Represents the result of an importContacts request
//@user_ids User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user
2018-08-30 14:55:42 +00:00
//@importer_count The number of users that imported the corresponding contact; 0 for already registered users or if unavailable
2021-12-30 05:55:02 +00:00
importedContacts user_ids:vector<int53> importer_count:vector<int32> = ImportedContacts;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@class SpeechRecognitionResult @description Describes result of speech recognition in a voice note
//@description The speech recognition is ongoing @partial_text Partially recognized text
speechRecognitionResultPending partial_text:string = SpeechRecognitionResult;
//@description The speech recognition successfully finished @text Recognized text
speechRecognitionResultText text:string = SpeechRecognitionResult;
//@description The speech recognition failed @error Received error
speechRecognitionResultError error:error = SpeechRecognitionResult;
2022-04-24 20:33:39 +00:00
//@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB24 format for light themes @dark_color Color in the RGB24 format for dark themes
attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotColor;
2022-12-30 18:28:59 +00:00
//@description Represents a bot, which can be added to attachment menu
2022-04-24 20:33:39 +00:00
//@bot_user_id User identifier of the bot added to attachment menu
2022-06-21 18:10:07 +00:00
//@supports_self_chat True, if the bot supports opening from attachment menu in the chat with the bot
//@supports_user_chats True, if the bot supports opening from attachment menu in private chats with ordinary users
//@supports_bot_chats True, if the bot supports opening from attachment menu in private chats with other bots
//@supports_group_chats True, if the bot supports opening from attachment menu in basic group and supergroup chats
//@supports_channel_chats True, if the bot supports opening from attachment menu in channel chats
//@supports_settings True, if the bot supports "settings_button_pressed" event
2022-12-30 18:28:59 +00:00
//@request_write_access True, if the user needs to be requested to give the permission to the bot to send them messages
2022-04-24 20:33:39 +00:00
//@name Name for the bot in attachment menu
//@name_color Color to highlight selected name of the bot if appropriate; may be null
//@default_icon Default attachment menu icon for the bot in SVG format; may be null
//@ios_static_icon Attachment menu icon for the bot in SVG format for the official iOS app; may be null
//@ios_animated_icon Attachment menu icon for the bot in TGS format for the official iOS app; may be null
//@android_icon Attachment menu icon for the bot in TGS format for the official Android app; may be null
//@macos_icon Attachment menu icon for the bot in TGS format for the official native macOS app; may be null
//@icon_color Color to highlight selected icon of the bot if appropriate; may be null
2022-06-21 18:10:07 +00:00
//@web_app_placeholder Default placeholder for opened Web Apps in SVG format; may be null
2022-12-30 18:28:59 +00:00
attachmentMenuBot bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool supports_settings:Bool request_write_access:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file android_icon:file macos_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot;
2022-04-24 20:33:39 +00:00
//@description Information about the message sent by answerWebAppQuery @inline_message_id Identifier of the sent inline message, if known
sentWebAppMessage inline_message_id:string = SentWebAppMessage;
2019-06-07 10:56:06 +00:00
//@description Contains an HTTP URL @url The URL
httpUrl url:string = HttpUrl;
2022-12-07 20:04:16 +00:00
//@description Contains an HTTPS URL, which can be used to get information about a user @url The URL @expires_in Left time for which the link is valid, in seconds; 0 if the link is a public username link
userLink url:string expires_in:int32 = UserLink;
2018-08-30 14:55:42 +00:00
//@class InputInlineQueryResult @description Represents a single result of an inline query; for bots only
2021-12-30 05:55:02 +00:00
//@description Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video
2022-12-30 18:28:59 +00:00
//@id Unique identifier of the query result
//@title Title of the query result
//@thumbnail_url URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists
//@thumbnail_mime_type MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4"
//@video_url The URL of the video file (file size must not exceed 1MB)
//@video_mime_type MIME type of the video file. Must be one of "image/gif" and "video/mp4"
//@video_duration Duration of the video, in seconds
//@video_width Width of the video
//@video_height Height of the video
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2020-11-30 09:33:47 +00:00
inputInlineQueryResultAnimation id:string title:string thumbnail_url:string thumbnail_mime_type:string video_url:string video_mime_type:string video_duration:int32 video_width:int32 video_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Represents a link to an article or web page
//@id Unique identifier of the query result
//@url URL of the result, if it exists
//@hide_url True, if the URL must be not shown
//@title Title of the result
//@param_description A short description of the result
//@thumbnail_url URL of the result thumbnail, if it exists
//@thumbnail_width Thumbnail width, if known
//@thumbnail_height Thumbnail height, if known
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2018-08-30 14:55:42 +00:00
inputInlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a link to an MP3 audio file
//@id Unique identifier of the query result
//@title Title of the audio file
//@performer Performer of the audio file
//@audio_url The URL of the audio file
//@audio_duration Audio file duration, in seconds
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAudio, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2018-08-30 14:55:42 +00:00
inputInlineQueryResultAudio id:string title:string performer:string audio_url:string audio_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a user contact
//@id Unique identifier of the query result
//@contact User contact
//@thumbnail_url URL of the result thumbnail, if it exists
//@thumbnail_width Thumbnail width, if known
//@thumbnail_height Thumbnail height, if known
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2018-08-30 14:55:42 +00:00
inputInlineQueryResultContact id:string contact:contact thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a link to a file
//@id Unique identifier of the query result
//@title Title of the resulting file
//@param_description Short description of the result, if known
//@document_url URL of the file
//@mime_type MIME type of the file content; only "application/pdf" and "application/zip" are currently allowed
//@thumbnail_url The URL of the file thumbnail, if it exists
//@thumbnail_width Width of the thumbnail
//@thumbnail_height Height of the thumbnail
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageDocument, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2018-08-30 14:55:42 +00:00
inputInlineQueryResultDocument id:string title:string description:string document_url:string mime_type:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a game
//@id Unique identifier of the query result
//@game_short_name Short name of the game
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
2018-08-30 14:55:42 +00:00
inputInlineQueryResultGame id:string game_short_name:string reply_markup:ReplyMarkup = InputInlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a point on the map
//@id Unique identifier of the query result
//@location Location result
2020-11-30 09:33:47 +00:00
//@live_period Amount of time relative to the message sent time until the location can be updated, in seconds
2022-12-30 18:28:59 +00:00
//@title Title of the result
//@thumbnail_url URL of the result thumbnail, if it exists
//@thumbnail_width Thumbnail width, if known
//@thumbnail_height Thumbnail height, if known
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2018-08-30 14:55:42 +00:00
inputInlineQueryResultLocation id:string location:location live_period:int32 title:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents link to a JPEG image
//@id Unique identifier of the query result
//@title Title of the result, if known
//@param_description A short description of the result, if known
//@thumbnail_url URL of the photo thumbnail, if it exists
//@photo_url The URL of the JPEG photo (photo size must not exceed 5MB)
//@photo_width Width of the photo
//@photo_height Height of the photo
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2018-08-30 14:55:42 +00:00
inputInlineQueryResultPhoto id:string title:string description:string thumbnail_url:string photo_url:string photo_width:int32 photo_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a link to a WEBP, TGS, or WEBM sticker
//@id Unique identifier of the query result
//@thumbnail_url URL of the sticker thumbnail, if it exists
//@sticker_url The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB)
//@sticker_width Width of the sticker
//@sticker_height Height of the sticker
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2018-08-30 14:55:42 +00:00
inputInlineQueryResultSticker id:string thumbnail_url:string sticker_url:string sticker_width:int32 sticker_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents information about a venue
//@id Unique identifier of the query result
//@venue Venue result
//@thumbnail_url URL of the result thumbnail, if it exists
//@thumbnail_width Thumbnail width, if known
//@thumbnail_height Thumbnail height, if known
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2018-08-30 14:55:42 +00:00
inputInlineQueryResultVenue id:string venue:venue thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a link to a page containing an embedded video player or a video file
//@id Unique identifier of the query result
//@title Title of the result
//@param_description A short description of the result, if known
//@thumbnail_url The URL of the video thumbnail (JPEG), if it exists
//@video_url URL of the embedded video player or video file
//@mime_type MIME type of the content of the video URL, only "text/html" or "video/mp4" are currently supported
//@video_width Width of the video
//@video_height Height of the video
//@video_duration Video duration, in seconds
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVideo, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2018-08-30 14:55:42 +00:00
inputInlineQueryResultVideo id:string title:string description:string thumbnail_url:string video_url:string mime_type:string video_width:int32 video_height:int32 video_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a link to an opus-encoded audio file within an OGG container, single channel audio
//@id Unique identifier of the query result
//@title Title of the voice note
//@voice_note_url The URL of the voice note file
//@voice_note_duration Duration of the voice note, in seconds
2021-12-30 05:55:02 +00:00
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVoiceNote, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
2018-08-30 14:55:42 +00:00
inputInlineQueryResultVoiceNote id:string title:string voice_note_url:string voice_note_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
//@class InlineQueryResult @description Represents a single result of an inline query
2022-12-30 18:28:59 +00:00
//@description Represents a link to an article or web page
//@id Unique identifier of the query result
//@url URL of the result, if it exists
//@hide_url True, if the URL must be not shown
//@title Title of the result
//@param_description A short description of the result
//@thumbnail Result thumbnail in JPEG format; may be null
2020-11-30 09:33:47 +00:00
inlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumbnail:thumbnail = InlineQueryResult;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Represents a user contact
//@id Unique identifier of the query result
//@contact A user contact
//@thumbnail Result thumbnail in JPEG format; may be null
2020-11-30 09:33:47 +00:00
inlineQueryResultContact id:string contact:contact thumbnail:thumbnail = InlineQueryResult;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Represents a point on the map
//@id Unique identifier of the query result
//@location Location result
//@title Title of the result
//@thumbnail Result thumbnail in JPEG format; may be null
2020-11-30 09:33:47 +00:00
inlineQueryResultLocation id:string location:location title:string thumbnail:thumbnail = InlineQueryResult;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Represents information about a venue
//@id Unique identifier of the query result
//@venue Venue result
//@thumbnail Result thumbnail in JPEG format; may be null
2020-11-30 09:33:47 +00:00
inlineQueryResultVenue id:string venue:venue thumbnail:thumbnail = InlineQueryResult;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Represents information about a game
//@id Unique identifier of the query result
//@game Game result
2018-08-30 14:55:42 +00:00
inlineQueryResultGame id:string game:game = InlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents an animation file
//@id Unique identifier of the query result
//@animation Animation file
//@title Animation title
2018-08-30 14:55:42 +00:00
inlineQueryResultAnimation id:string animation:animation title:string = InlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents an audio file
//@id Unique identifier of the query result
//@audio Audio file
2018-08-30 14:55:42 +00:00
inlineQueryResultAudio id:string audio:audio = InlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a document
//@id Unique identifier of the query result
//@document Document
//@title Document title
//@param_description Document description
2018-08-30 14:55:42 +00:00
inlineQueryResultDocument id:string document:document title:string description:string = InlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a photo
//@id Unique identifier of the query result
//@photo Photo
//@title Title of the result, if known
//@param_description A short description of the result, if known
2018-08-30 14:55:42 +00:00
inlineQueryResultPhoto id:string photo:photo title:string description:string = InlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a sticker
//@id Unique identifier of the query result
//@sticker Sticker
2018-08-30 14:55:42 +00:00
inlineQueryResultSticker id:string sticker:sticker = InlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a video
//@id Unique identifier of the query result
//@video Video
//@title Title of the video
//@param_description Description of the video
2018-08-30 14:55:42 +00:00
inlineQueryResultVideo id:string video:video title:string description:string = InlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents a voice note
//@id Unique identifier of the query result
//@voice_note Voice note
//@title Title of the voice note
2018-08-30 14:55:42 +00:00
inlineQueryResultVoiceNote id:string voice_note:voiceNote title:string = InlineQueryResult;
2022-12-30 18:28:59 +00:00
//@description Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query
//@inline_query_id Unique identifier of the inline query
//@next_offset The offset for the next request. If empty, there are no more results
//@results Results of the query
//@switch_pm_text If non-empty, this text must be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter
//@switch_pm_parameter Parameter for the bot start message
2018-08-30 14:55:42 +00:00
inlineQueryResults inline_query_id:int64 next_offset:string results:vector<InlineQueryResult> switch_pm_text:string switch_pm_parameter:string = InlineQueryResults;
//@class CallbackQueryPayload @description Represents a payload of a callback query
2020-11-30 09:33:47 +00:00
//@description The payload for a general callback button @data Data that was attached to the callback button
2018-08-30 14:55:42 +00:00
callbackQueryPayloadData data:bytes = CallbackQueryPayload;
2022-08-13 15:24:07 +00:00
//@description The payload for a callback button requiring password @password The 2-step verification password for the current user @data Data that was attached to the callback button
2020-11-30 09:33:47 +00:00
callbackQueryPayloadDataWithPassword password:string data:bytes = CallbackQueryPayload;
//@description The payload for a game callback button @game_short_name A short name of the game that was attached to the callback button
2018-08-30 14:55:42 +00:00
callbackQueryPayloadGame game_short_name:string = CallbackQueryPayload;
2021-12-30 05:55:02 +00:00
//@description Contains a bot's answer to a callback query @text Text of the answer @show_alert True, if an alert must be shown to the user instead of a toast notification @url URL to be opened
2018-08-30 14:55:42 +00:00
callbackQueryAnswer text:string show_alert:Bool url:string = CallbackQueryAnswer;
//@description Contains the result of a custom request @result A JSON-serialized result
customRequestResult result:string = CustomRequestResult;
//@description Contains one row of the game high score table @position Position in the high score table @user_id User identifier @score User score
2021-12-30 05:55:02 +00:00
gameHighScore position:int32 user_id:int53 score:int32 = GameHighScore;
2018-08-30 14:55:42 +00:00
//@description Contains a list of game high scores @scores A list of game high scores
gameHighScores scores:vector<gameHighScore> = GameHighScores;
//@class ChatEventAction @description Represents a chat event
//@description A message was edited @old_message The original message before the edit @new_message The message after it was edited
chatEventMessageEdited old_message:message new_message:message = ChatEventAction;
2022-12-07 20:04:16 +00:00
//@description A message was deleted @message Deleted message @can_report_anti_spam_false_positive True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive
chatEventMessageDeleted message:message can_report_anti_spam_false_positive:Bool = ChatEventAction;
2018-08-30 14:55:42 +00:00
//@description A message was pinned @message Pinned message
chatEventMessagePinned message:message = ChatEventAction;
2020-11-30 09:33:47 +00:00
//@description A message was unpinned @message Unpinned message
chatEventMessageUnpinned message:message = ChatEventAction;
2018-08-30 14:55:42 +00:00
2022-02-06 18:36:17 +00:00
//@description A poll in a message was stopped @message The message with the poll
chatEventPollStopped message:message = ChatEventAction;
2018-08-30 14:55:42 +00:00
//@description A new member joined the chat
chatEventMemberJoined = ChatEventAction;
2021-12-30 05:55:02 +00:00
//@description A new member joined the chat via an invite link @invite_link Invite link used to join the chat
chatEventMemberJoinedByInviteLink invite_link:chatInviteLink = ChatEventAction;
//@description A new member was accepted to the chat by an administrator @approver_user_id User identifier of the chat administrator, approved user join request @invite_link Invite link used to join the chat; may be null
chatEventMemberJoinedByRequest approver_user_id:int53 invite_link:chatInviteLink = ChatEventAction;
2018-08-30 14:55:42 +00:00
//@description A new chat member was invited @user_id New member user identifier @status New member status
2021-12-30 05:55:02 +00:00
chatEventMemberInvited user_id:int53 status:ChatMemberStatus = ChatEventAction;
2018-08-30 14:55:42 +00:00
2022-02-06 18:36:17 +00:00
//@description A member left the chat
chatEventMemberLeft = ChatEventAction;
2021-12-30 05:55:02 +00:00
//@description A chat member has gained/lost administrator status, or the list of their administrator privileges has changed @user_id Affected chat member user identifier @old_status Previous status of the chat member @new_status New status of the chat member
chatEventMemberPromoted user_id:int53 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed @member_id Affected chat member identifier @old_status Previous status of the chat member @new_status New status of the chat member
chatEventMemberRestricted member_id:MessageSender old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction;
2018-08-30 14:55:42 +00:00
2022-02-06 18:36:17 +00:00
//@description The chat available reactions were changed @old_available_reactions Previous chat available reactions @new_available_reactions New chat available reactions
2022-09-18 01:34:29 +00:00
chatEventAvailableReactionsChanged old_available_reactions:ChatAvailableReactions new_available_reactions:ChatAvailableReactions = ChatEventAction;
2019-09-10 12:36:54 +00:00
2018-08-30 14:55:42 +00:00
//@description The chat description was changed @old_description Previous chat description @new_description New chat description
chatEventDescriptionChanged old_description:string new_description:string = ChatEventAction;
2020-02-03 12:56:20 +00:00
//@description The linked chat of a supergroup was changed @old_linked_chat_id Previous supergroup linked chat identifier @new_linked_chat_id New supergroup linked chat identifier
chatEventLinkedChatChanged old_linked_chat_id:int53 new_linked_chat_id:int53 = ChatEventAction;
2022-02-06 18:36:17 +00:00
//@description The supergroup location was changed @old_location Previous location; may be null @new_location New location; may be null
chatEventLocationChanged old_location:chatLocation new_location:chatLocation = ChatEventAction;
2020-02-03 12:56:20 +00:00
2022-12-30 18:28:59 +00:00
//@description The message auto-delete timer was changed @old_message_auto_delete_time Previous value of message_auto_delete_time @new_message_auto_delete_time New value of message_auto_delete_time
chatEventMessageAutoDeleteTimeChanged old_message_auto_delete_time:int32 new_message_auto_delete_time:int32 = ChatEventAction;
2021-12-30 05:55:02 +00:00
2022-02-06 18:36:17 +00:00
//@description The chat permissions was changed @old_permissions Previous chat permissions @new_permissions New chat permissions
chatEventPermissionsChanged old_permissions:chatPermissions new_permissions:chatPermissions = ChatEventAction;
2018-08-30 14:55:42 +00:00
2022-02-06 18:36:17 +00:00
//@description The chat photo was changed @old_photo Previous chat photo value; may be null @new_photo New chat photo value; may be null
chatEventPhotoChanged old_photo:chatPhoto new_photo:chatPhoto = ChatEventAction;
//@description The slow_mode_delay setting of a supergroup was changed @old_slow_mode_delay Previous value of slow_mode_delay, in seconds @new_slow_mode_delay New value of slow_mode_delay, in seconds
chatEventSlowModeDelayChanged old_slow_mode_delay:int32 new_slow_mode_delay:int32 = ChatEventAction;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
//@description The supergroup sticker set was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none
chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction;
2022-02-06 18:36:17 +00:00
//@description The chat title was changed @old_title Previous chat title @new_title New chat title
chatEventTitleChanged old_title:string new_title:string = ChatEventAction;
2022-11-07 18:50:52 +00:00
//@description The chat editable username was changed @old_username Previous chat username @new_username New chat username
2022-02-06 18:36:17 +00:00
chatEventUsernameChanged old_username:string new_username:string = ChatEventAction;
2022-11-07 18:50:52 +00:00
//@description The chat active usernames were changed @old_usernames Previous list of active usernames @new_usernames New list of active usernames
chatEventActiveUsernamesChanged old_usernames:vector<string> new_usernames:vector<string> = ChatEventAction;
2022-02-06 18:36:17 +00:00
//@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content
chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction;
//@description The can_invite_users permission of a supergroup chat was toggled @can_invite_users New value of can_invite_users permission
chatEventInvitesToggled can_invite_users:Bool = ChatEventAction;
2020-02-03 12:56:20 +00:00
2018-08-30 14:55:42 +00:00
//@description The is_all_history_available setting of a supergroup was toggled @is_all_history_available New value of is_all_history_available
chatEventIsAllHistoryAvailableToggled is_all_history_available:Bool = ChatEventAction;
2022-12-30 18:28:59 +00:00
//@description The has_aggressive_anti_spam_enabled setting of a supergroup was toggled @has_aggressive_anti_spam_enabled New value of has_aggressive_anti_spam_enabled
chatEventHasAggressiveAntiSpamEnabledToggled has_aggressive_anti_spam_enabled:Bool = ChatEventAction;
2022-12-07 20:04:16 +00:00
2022-02-06 18:36:17 +00:00
//@description The sign_messages setting of a channel was toggled @sign_messages New value of sign_messages
chatEventSignMessagesToggled sign_messages:Bool = ChatEventAction;
2021-12-30 05:55:02 +00:00
//@description A chat invite link was edited @old_invite_link Previous information about the invite link @new_invite_link New information about the invite link
chatEventInviteLinkEdited old_invite_link:chatInviteLink new_invite_link:chatInviteLink = ChatEventAction;
//@description A chat invite link was revoked @invite_link The invite link
chatEventInviteLinkRevoked invite_link:chatInviteLink = ChatEventAction;
//@description A revoked chat invite link was deleted @invite_link The invite link
chatEventInviteLinkDeleted invite_link:chatInviteLink = ChatEventAction;
//@description A video chat was created @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall
chatEventVideoChatCreated group_call_id:int32 = ChatEventAction;
//@description A video chat was ended @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall
chatEventVideoChatEnded group_call_id:int32 = ChatEventAction;
2022-02-06 18:36:17 +00:00
//@description The mute_new_participants setting of a video chat was toggled @mute_new_participants New value of the mute_new_participants setting
chatEventVideoChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEventAction;
2021-12-30 05:55:02 +00:00
//@description A video chat participant was muted or unmuted @participant_id Identifier of the affected group call participant @is_muted New value of is_muted
chatEventVideoChatParticipantIsMutedToggled participant_id:MessageSender is_muted:Bool = ChatEventAction;
//@description A video chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents
chatEventVideoChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction;
2022-11-07 18:50:52 +00:00
//@description The is_forum setting of a channel was toggled @is_forum New value of is_forum
chatEventIsForumToggled is_forum:Bool = ChatEventAction;
//@description A new forum topic was created @topic_info Information about the topic
chatEventForumTopicCreated topic_info:forumTopicInfo = ChatEventAction;
//@description A forum topic was edited @old_topic_info Old information about the topic @new_topic_info New information about the topic
chatEventForumTopicEdited old_topic_info:forumTopicInfo new_topic_info:forumTopicInfo = ChatEventAction;
//@description A forum topic was closed or reopened @topic_info New information about the topic
chatEventForumTopicToggleIsClosed topic_info:forumTopicInfo = ChatEventAction;
2022-12-07 20:04:16 +00:00
//@description The General forum topic was hidden or unhidden @topic_info New information about the topic
chatEventForumTopicToggleIsHidden topic_info:forumTopicInfo = ChatEventAction;
2022-11-07 18:50:52 +00:00
//@description A forum topic was deleted @topic_info Information about the topic
chatEventForumTopicDeleted topic_info:forumTopicInfo = ChatEventAction;
//@description A pinned forum topic was changed @old_topic_info Information about the old pinned topic; may be null @new_topic_info Information about the new pinned topic; may be null
chatEventForumTopicPinned old_topic_info:forumTopicInfo new_topic_info:forumTopicInfo = ChatEventAction;
2022-12-30 18:28:59 +00:00
//@description Represents a chat event
//@id Chat event identifier
//@date Point in time (Unix timestamp) when the event happened
//@member_id Identifier of the user or chat who performed the action
//@action The action
2021-12-30 05:55:02 +00:00
chatEvent id:int64 date:int32 member_id:MessageSender action:ChatEventAction = ChatEvent;
2018-08-30 14:55:42 +00:00
//@description Contains a list of chat events @events List of events
chatEvents events:vector<chatEvent> = ChatEvents;
//@description Represents a set of filters used to obtain a chat event log
2021-12-30 05:55:02 +00:00
//@message_edits True, if message edits need to be returned
//@message_deletions True, if message deletions need to be returned
//@message_pins True, if pin/unpin events need to be returned
//@member_joins True, if members joining events need to be returned
//@member_leaves True, if members leaving events need to be returned
//@member_invites True, if invited member events need to be returned
//@member_promotions True, if member promotion/demotion events need to be returned
//@member_restrictions True, if member restricted/unrestricted/banned/unbanned events need to be returned
//@info_changes True, if changes in chat information need to be returned
//@setting_changes True, if changes in chat settings need to be returned
//@invite_link_changes True, if changes to invite links need to be returned
//@video_chat_changes True, if video chat actions need to be returned
2022-11-07 18:50:52 +00:00
//@forum_changes True, if forum-related actions need to be returned
chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool invite_link_changes:Bool video_chat_changes:Bool forum_changes:Bool = ChatEventLogFilters;
2018-08-30 14:55:42 +00:00
2018-09-05 21:45:29 +00:00
//@class LanguagePackStringValue @description Represents the value of a string in a language pack
//@description An ordinary language pack string @value String value
languagePackStringValueOrdinary value:string = LanguagePackStringValue;
2022-03-13 04:04:12 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@zero_value Value for zero objects
//@one_value Value for one object
//@two_value Value for two objects
//@few_value Value for few objects
//@many_value Value for many objects
//@other_value Default value
2018-09-05 21:45:29 +00:00
languagePackStringValuePluralized zero_value:string one_value:string two_value:string few_value:string many_value:string other_value:string = LanguagePackStringValue;
2021-12-30 05:55:02 +00:00
//@description A deleted language pack string, the value must be taken from the built-in English language pack
2018-09-05 21:45:29 +00:00
languagePackStringValueDeleted = LanguagePackStringValue;
2021-12-30 05:55:02 +00:00
//@description Represents one language pack string @key String key @value String value; pass null if the string needs to be taken from the built-in English language pack
2018-09-05 21:45:29 +00:00
languagePackString key:string value:LanguagePackStringValue = LanguagePackString;
//@description Contains a list of language pack strings @strings A list of language pack strings
languagePackStrings strings:vector<languagePackString> = LanguagePackStrings;
2022-12-30 18:28:59 +00:00
//@description Contains information about a language pack
//@id Unique language pack identifier
2021-12-30 05:55:02 +00:00
//@base_language_pack_id Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs
2022-12-30 18:28:59 +00:00
//@name Language name
//@native_name Name of the language in that language
2022-03-13 04:04:12 +00:00
//@plural_code A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information
2022-12-30 18:28:59 +00:00
//@is_official True, if the language pack is official
//@is_rtl True, if the language pack strings are RTL
//@is_beta True, if the language pack is a beta language pack
2019-06-07 10:56:06 +00:00
//@is_installed True, if the language pack is installed by the current user
2022-12-30 18:28:59 +00:00
//@total_string_count Total number of non-deleted strings from the language pack
//@translated_string_count Total number of translated strings from the language pack
//@local_string_count Total number of non-deleted strings from the language pack available locally
//@translation_url Link to language translation interface; empty for custom local language packs
2019-06-07 10:56:06 +00:00
languagePackInfo id:string base_language_pack_id:string name:string native_name:string plural_code:string is_official:Bool is_rtl:Bool is_beta:Bool is_installed:Bool total_string_count:int32 translated_string_count:int32 local_string_count:int32 translation_url:string = LanguagePackInfo;
2018-09-05 21:45:29 +00:00
//@description Contains information about the current localization target @language_packs List of available language packs for this application
localizationTargetInfo language_packs:vector<languagePackInfo> = LocalizationTargetInfo;
2022-06-21 18:10:07 +00:00
//@class PremiumLimitType @description Describes type of a limit, increased for Premium users
//@description The maximum number of joined supergroups and channels
premiumLimitTypeSupergroupCount = PremiumLimitType;
//@description The maximum number of pinned chats in the main chat list
premiumLimitTypePinnedChatCount = PremiumLimitType;
//@description The maximum number of created public chats
premiumLimitTypeCreatedPublicChatCount = PremiumLimitType;
//@description The maximum number of saved animations
premiumLimitTypeSavedAnimationCount = PremiumLimitType;
//@description The maximum number of favorite stickers
premiumLimitTypeFavoriteStickerCount = PremiumLimitType;
//@description The maximum number of chat filters
premiumLimitTypeChatFilterCount = PremiumLimitType;
//@description The maximum number of pinned and always included, or always excluded chats in a chat filter
premiumLimitTypeChatFilterChosenChatCount = PremiumLimitType;
//@description The maximum number of pinned chats in the archive chat list
premiumLimitTypePinnedArchivedChatCount = PremiumLimitType;
//@description The maximum length of sent media caption
premiumLimitTypeCaptionLength = PremiumLimitType;
//@description The maximum length of the user's bio
premiumLimitTypeBioLength = PremiumLimitType;
//@class PremiumFeature @description Describes a feature available to Premium users
//@description Increased limits
premiumFeatureIncreasedLimits = PremiumFeature;
//@description Increased maximum upload file size
premiumFeatureIncreasedUploadFileSize = PremiumFeature;
//@description Improved download speed
premiumFeatureImprovedDownloadSpeed = PremiumFeature;
//@description The ability to convert voice notes to text
premiumFeatureVoiceRecognition = PremiumFeature;
//@description Disabled ads
premiumFeatureDisabledAds = PremiumFeature;
//@description Allowed to use more reactions
premiumFeatureUniqueReactions = PremiumFeature;
//@description Allowed to use premium stickers with unique effects
premiumFeatureUniqueStickers = PremiumFeature;
2022-08-13 15:24:07 +00:00
//@description Allowed to use custom emoji stickers in message texts and captions
premiumFeatureCustomEmoji = PremiumFeature;
2022-06-21 18:10:07 +00:00
//@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
premiumFeatureAdvancedChatManagement = PremiumFeature;
//@description A badge in the user's profile
premiumFeatureProfileBadge = PremiumFeature;
2022-09-18 01:34:29 +00:00
//@description A emoji status shown along with the user's name
premiumFeatureEmojiStatus = PremiumFeature;
2022-06-21 18:10:07 +00:00
//@description Profile photo animation on message and chat screens
premiumFeatureAnimatedProfilePhoto = PremiumFeature;
2022-11-07 18:50:52 +00:00
//@description The ability to set a custom emoji as a forum topic icon
premiumFeatureForumTopicIcon = PremiumFeature;
2022-06-21 18:10:07 +00:00
//@description Allowed to set a premium appllication icons
premiumFeatureAppIcons = PremiumFeature;
2023-02-04 22:54:46 +00:00
//@description Allowed to translate chat messages real-time
premiumFeatureRealTimeChatTranslation = PremiumFeature;
2022-06-21 18:10:07 +00:00
//@description Contains information about a limit, increased for Premium users @type The type of the limit @default_value Default value of the limit @premium_value Value of the limit for Premium users
premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = PremiumLimit;
2022-12-30 18:28:59 +00:00
//@description Contains information about features, available to Premium users
//@features The list of available features
//@limits The list of limits, increased for Premium users
2022-08-13 15:24:07 +00:00
//@payment_link 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
2022-06-21 18:10:07 +00:00
premiumFeatures features:vector<PremiumFeature> limits:vector<premiumLimit> payment_link:InternalLinkType = PremiumFeatures;
//@class PremiumSource @description Describes a source from which the Premium features screen is opened
//@description A limit was exceeded @limit_type Type of the exceeded limit
premiumSourceLimitExceeded limit_type:PremiumLimitType = PremiumSource;
//@description A user tried to use a Premium feature @feature The used feature
premiumSourceFeature feature:PremiumFeature = PremiumSource;
//@description A user opened an internal link of the type internalLinkTypePremiumFeatures @referrer The referrer from the link
premiumSourceLink referrer:string = PremiumSource;
//@description A user opened the Premium features screen from settings
premiumSourceSettings = PremiumSource;
//@description Describes a promotion animation for a Premium feature @feature Premium feature @animation Promotion animation for the feature
premiumFeaturePromotionAnimation feature:PremiumFeature animation:animation = PremiumFeaturePromotionAnimation;
//@description Contains state of Telegram Premium subscription and promotion videos for Premium features
//@state Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription
2022-09-18 01:34:29 +00:00
//@payment_options The list of available options for buying Telegram Premium
2022-06-21 18:10:07 +00:00
//@animations The list of available promotion animations for Premium features
2023-02-04 22:54:46 +00:00
premiumState state:formattedText payment_options:vector<premiumStatePaymentOption> animations:vector<premiumFeaturePromotionAnimation> = PremiumState;
2022-06-21 18:10:07 +00:00
2022-08-13 15:24:07 +00:00
//@class StorePaymentPurpose @description Describes a purpose of an in-store payment
2023-02-04 22:54:46 +00:00
//@description The user subscribed to Telegram Premium @is_restore Pass true if this is a restore of a Telegram Premium purchase; only for App Store @is_upgrade Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store
storePaymentPurposePremiumSubscription is_restore:Bool is_upgrade:Bool = StorePaymentPurpose;
2022-08-13 15:24:07 +00:00
//@description The user gifted Telegram Premium to another user @user_id Identifier of the user for which Premium was gifted @currency ISO 4217 currency code of the payment currency @amount Paid amount, in the smallest units of the currency
storePaymentPurposeGiftedPremium user_id:int53 currency:string amount:int53 = StorePaymentPurpose;
2023-02-04 22:54:46 +00:00
//@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method.
//-To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A token for Firebase Cloud Messaging @token Device registration token; may be empty to deregister a device @encrypt True, if push notifications must be additionally encrypted
2019-06-07 10:56:06 +00:00
deviceTokenFirebaseCloudMessaging token:string encrypt:Bool = DeviceToken;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A token for Apple Push Notification service @device_token Device token; may be empty to deregister a device @is_app_sandbox True, if App Sandbox is enabled
2018-08-30 14:55:42 +00:00
deviceTokenApplePush device_token:string is_app_sandbox:Bool = DeviceToken;
2021-12-30 05:55:02 +00:00
//@description A token for Apple Push Notification service VoIP notifications @device_token Device token; may be empty to deregister a device @is_app_sandbox True, if App Sandbox is enabled @encrypt True, if push notifications must be additionally encrypted
2019-06-07 10:56:06 +00:00
deviceTokenApplePushVoIP device_token:string is_app_sandbox:Bool encrypt:Bool = DeviceToken;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A token for Windows Push Notification Services @access_token The access token that will be used to send notifications; may be empty to deregister a device
2018-08-30 14:55:42 +00:00
deviceTokenWindowsPush access_token:string = DeviceToken;
2021-12-30 05:55:02 +00:00
//@description A token for Microsoft Push Notification Service @channel_uri Push notification channel URI; may be empty to deregister a device
2018-08-30 14:55:42 +00:00
deviceTokenMicrosoftPush channel_uri:string = DeviceToken;
2021-12-30 05:55:02 +00:00
//@description A token for Microsoft Push Notification Service VoIP channel @channel_uri Push notification channel URI; may be empty to deregister a device
2018-08-30 14:55:42 +00:00
deviceTokenMicrosoftPushVoIP channel_uri:string = DeviceToken;
2022-12-30 18:28:59 +00:00
//@description A token for web Push API
//@endpoint Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device
//@p256dh_base64url Base64url-encoded P-256 elliptic curve Diffie-Hellman public key
//@auth_base64url Base64url-encoded authentication secret
2018-08-30 14:55:42 +00:00
deviceTokenWebPush endpoint:string p256dh_base64url:string auth_base64url:string = DeviceToken;
2021-12-30 05:55:02 +00:00
//@description A token for Simple Push API for Firefox OS @endpoint Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device
2018-08-30 14:55:42 +00:00
deviceTokenSimplePush endpoint:string = DeviceToken;
2021-12-30 05:55:02 +00:00
//@description A token for Ubuntu Push Client service @token Token; may be empty to deregister a device
2018-08-30 14:55:42 +00:00
deviceTokenUbuntuPush token:string = DeviceToken;
2021-12-30 05:55:02 +00:00
//@description A token for BlackBerry Push Service @token Token; may be empty to deregister a device
2018-08-30 14:55:42 +00:00
deviceTokenBlackBerryPush token:string = DeviceToken;
2021-12-30 05:55:02 +00:00
//@description A token for Tizen Push Service @reg_id Push service registration identifier; may be empty to deregister a device
2018-08-30 14:55:42 +00:00
deviceTokenTizenPush reg_id:string = DeviceToken;
2023-02-04 22:54:46 +00:00
//@description A token for HUAWEI Push Service @token Device registration token; may be empty to deregister a device @encrypt True, if push notifications must be additionally encrypted
deviceTokenHuaweiPush token:string encrypt:Bool = DeviceToken;
2018-08-30 14:55:42 +00:00
2019-06-07 10:56:06 +00:00
//@description Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification @id The globally unique identifier of push notification subscription
pushReceiverId id:int64 = PushReceiverId;
2020-02-03 12:56:20 +00:00
//@class BackgroundFill @description Describes a fill of a background
//@description Describes a solid fill of a background @color A color of the background in the RGB24 format
backgroundFillSolid color:int32 = BackgroundFill;
2022-12-30 18:28:59 +00:00
//@description Describes a gradient fill of a background
//@top_color A top color of the background in the RGB24 format
//@bottom_color A bottom color of the background in the RGB24 format
2022-11-07 18:50:52 +00:00
//@rotation_angle Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45
2020-02-03 12:56:20 +00:00
backgroundFillGradient top_color:int32 bottom_color:int32 rotation_angle:int32 = BackgroundFill;
2021-12-30 05:55:02 +00:00
//@description Describes a freeform gradient fill of a background @colors A list of 3 or 4 colors of the freeform gradients in the RGB24 format
backgroundFillFreeformGradient colors:vector<int32> = BackgroundFill;
2020-02-03 12:56:20 +00:00
//@class BackgroundType @description Describes the type of a background
2019-09-10 12:36:54 +00:00
//@description A wallpaper in JPEG format
//@is_blurred True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12
2020-02-03 12:56:20 +00:00
//@is_moving True, if the background needs to be slightly moved when device is tilted
2019-09-10 12:36:54 +00:00
backgroundTypeWallpaper is_blurred:Bool is_moving:Bool = BackgroundType;
2020-02-03 12:56:20 +00:00
//@description A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user
2021-12-30 05:55:02 +00:00
//@fill Fill of the background
//@intensity Intensity of the pattern when it is shown above the filled background; 0-100.
//@is_inverted True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only
2020-02-03 12:56:20 +00:00
//@is_moving True, if the background needs to be slightly moved when device is tilted
2021-12-30 05:55:02 +00:00
backgroundTypePattern fill:BackgroundFill intensity:int32 is_inverted:Bool is_moving:Bool = BackgroundType;
2019-09-10 12:36:54 +00:00
2021-12-30 05:55:02 +00:00
//@description A filled background @fill The background fill
2020-02-03 12:56:20 +00:00
backgroundTypeFill fill:BackgroundFill = BackgroundType;
2019-09-10 12:36:54 +00:00
//@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
2020-02-03 12:56:20 +00:00
//@document Document with the background; may be null. Null only for filled backgrounds
2019-09-10 12:36:54 +00:00
//@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<background> = Backgrounds;
2018-08-30 14:55:42 +00:00
2019-09-10 12:36:54 +00:00
//@class InputBackground @description Contains information about background to set
//@description A background from a local file
2020-02-03 12:56:20 +00:00
//@background Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file must be in JPEG format for wallpapers and in PNG format for patterns
2019-09-10 12:36:54 +00:00
inputBackgroundLocal background:InputFile = InputBackground;
//@description A background from the server @background_id The background identifier
inputBackgroundRemote background_id:int64 = InputBackground;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Describes theme settings
//@accent_color Theme accent color in ARGB format
//@background The background to be used in chats; may be null
//@outgoing_message_fill The fill to be used as a background for outgoing messages
//@animate_outgoing_message_fill If true, the freeform gradient fill needs to be animated on every sent message
//@outgoing_message_accent_color Accent color of outgoing messages in ARGB format
themeSettings accent_color:int32 background:background outgoing_message_fill:BackgroundFill animate_outgoing_message_fill:Bool outgoing_message_accent_color:int32 = ThemeSettings;
//@description Describes a chat theme
//@name Theme name
//@light_settings Theme settings for a light chat theme
//@dark_settings Theme settings for a dark chat theme
chatTheme name:string light_settings:themeSettings dark_settings:themeSettings = ChatTheme;
2018-08-30 14:55:42 +00:00
//@description Contains a list of hashtags @hashtags A list of hashtags
hashtags hashtags:vector<string> = Hashtags;
2020-02-03 12:56:20 +00:00
//@class CanTransferOwnershipResult @description Represents result of checking whether the current session can be used to transfer a chat ownership to another user
//@description The session can be used
canTransferOwnershipResultOk = CanTransferOwnershipResult;
//@description The 2-step verification needs to be enabled first
canTransferOwnershipResultPasswordNeeded = CanTransferOwnershipResult;
//@description The 2-step verification was enabled recently, user needs to wait @retry_after Time left before the session can be used to transfer ownership of a chat, in seconds
canTransferOwnershipResultPasswordTooFresh retry_after:int32 = CanTransferOwnershipResult;
//@description The session was created recently, user needs to wait @retry_after Time left before the session can be used to transfer ownership of a chat, in seconds
canTransferOwnershipResultSessionTooFresh retry_after:int32 = CanTransferOwnershipResult;
2018-08-30 14:55:42 +00:00
//@class CheckChatUsernameResult @description Represents result of checking whether a username can be set for a chat
//@description The username can be set
checkChatUsernameResultOk = CheckChatUsernameResult;
//@description The username is invalid
checkChatUsernameResultUsernameInvalid = CheckChatUsernameResult;
//@description The username is occupied
checkChatUsernameResultUsernameOccupied = CheckChatUsernameResult;
2022-12-07 20:04:16 +00:00
//@description The username can be purchased at fragment.com
checkChatUsernameResultUsernamePurchasable = CheckChatUsernameResult;
2022-01-26 21:05:08 +00:00
//@description The user has too many chats with username, one of them must be made private first
2022-12-07 20:04:16 +00:00
checkChatUsernameResultPublicChatsTooMany = CheckChatUsernameResult;
2018-08-30 14:55:42 +00:00
//@description The user can't be a member of a public supergroup
checkChatUsernameResultPublicGroupsUnavailable = CheckChatUsernameResult;
2021-12-30 05:55:02 +00:00
//@class CheckStickerSetNameResult @description Represents result of checking whether a name can be used for a new sticker set
//@description The name can be set
checkStickerSetNameResultOk = CheckStickerSetNameResult;
//@description The name is invalid
checkStickerSetNameResultNameInvalid = CheckStickerSetNameResult;
//@description The name is occupied
checkStickerSetNameResultNameOccupied = CheckStickerSetNameResult;
//@class ResetPasswordResult @description Represents result of 2-step verification password reset
//@description The password was reset
resetPasswordResultOk = ResetPasswordResult;
//@description The password reset request is pending @pending_reset_date Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword
resetPasswordResultPending pending_reset_date:int32 = ResetPasswordResult;
//@description The password reset request was declined @retry_date Point in time (Unix timestamp) when the password reset can be retried
resetPasswordResultDeclined retry_date:int32 = ResetPasswordResult;
//@class MessageFileType @description Contains information about a file with messages exported from another app
//@description The messages was exported from a private chat @name Name of the other party; may be empty if unrecognized
messageFileTypePrivate name:string = MessageFileType;
//@description The messages was exported from a group chat @title Title of the group chat; may be empty if unrecognized
messageFileTypeGroup title:string = MessageFileType;
//@description The messages was exported from a chat of unknown type
messageFileTypeUnknown = MessageFileType;
2019-06-07 10:56:06 +00:00
//@class PushMessageContent @description Contains content of a push message notification
//@description A general message with hidden content @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentHidden is_pinned:Bool = PushMessageContent;
2019-09-10 12:36:54 +00:00
//@description An animation message (GIF-style). @animation Message content; may be null @caption Animation caption @is_pinned True, if the message is a pinned message with the specified content
2019-06-07 10:56:06 +00:00
pushMessageContentAnimation animation:animation caption:string is_pinned:Bool = PushMessageContent;
//@description An audio message @audio Message content; may be null @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentAudio audio:audio is_pinned:Bool = PushMessageContent;
//@description A message with a user contact @name Contact's name @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentContact name:string is_pinned:Bool = PushMessageContent;
//@description A contact has registered with Telegram
pushMessageContentContactRegistered = PushMessageContent;
//@description A document message (a general file) @document Message content; may be null @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentDocument document:document is_pinned:Bool = PushMessageContent;
//@description A message with a game @title Game title, empty for pinned game message @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentGame title:string is_pinned:Bool = PushMessageContent;
//@description A new high score was achieved in a game @title Game title, empty for pinned message @score New score, 0 for pinned message @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentGameScore title:string score:int32 is_pinned:Bool = PushMessageContent;
//@description A message with an invoice from a bot @price Product price @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentInvoice price:string is_pinned:Bool = PushMessageContent;
//@description A message with a location @is_live True, if the location is live @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentLocation is_live:Bool is_pinned:Bool = PushMessageContent;
2022-12-30 18:28:59 +00:00
//@description A photo message
//@photo Message content; may be null
//@caption Photo caption
//@is_secret True, if the photo is secret
//@is_pinned True, if the message is a pinned message with the specified content
2019-06-07 10:56:06 +00:00
pushMessageContentPhoto photo:photo caption:string is_secret:Bool is_pinned:Bool = PushMessageContent;
2022-12-30 18:28:59 +00:00
//@description A message with a poll
//@question Poll question
//@is_regular True, if the poll is regular and not in quiz mode
//@is_pinned True, if the message is a pinned message with the specified content
2020-02-03 12:56:20 +00:00
pushMessageContentPoll question:string is_regular:Bool is_pinned:Bool = PushMessageContent;
2019-06-07 10:56:06 +00:00
//@description A screenshot of a message in the chat has been taken
pushMessageContentScreenshotTaken = PushMessageContent;
2022-12-30 18:28:59 +00:00
//@description A message with a sticker
//@sticker Message content; may be null
//@emoji Emoji corresponding to the sticker; may be empty
//@is_pinned True, if the message is a pinned message with the specified content
2019-06-07 10:56:06 +00:00
pushMessageContentSticker sticker:sticker emoji:string is_pinned:Bool = PushMessageContent;
//@description A text message @text Message text @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentText text:string is_pinned:Bool = PushMessageContent;
2022-12-30 18:28:59 +00:00
//@description A video message
//@video Message content; may be null
//@caption Video caption
//@is_secret True, if the video is secret
//@is_pinned True, if the message is a pinned message with the specified content
2019-06-07 10:56:06 +00:00
pushMessageContentVideo video:video caption:string is_secret:Bool is_pinned:Bool = PushMessageContent;
//@description A video note message @video_note Message content; may be null @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentVideoNote video_note:videoNote is_pinned:Bool = PushMessageContent;
//@description A voice note message @voice_note Message content; may be null @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentVoiceNote voice_note:voiceNote is_pinned:Bool = PushMessageContent;
//@description A newly created basic group
pushMessageContentBasicGroupChatCreate = PushMessageContent;
2022-12-30 18:28:59 +00:00
//@description New chat members were invited to a group
//@member_name Name of the added member
//@is_current_user True, if the current user was added to the group
2021-12-30 05:55:02 +00:00
//@is_returned True, if the user has returned to the group themselves
2019-06-07 10:56:06 +00:00
pushMessageContentChatAddMembers member_name:string is_current_user:Bool is_returned:Bool = PushMessageContent;
//@description A chat photo was edited
pushMessageContentChatChangePhoto = PushMessageContent;
//@description A chat title was edited @title New chat title
pushMessageContentChatChangeTitle title:string = PushMessageContent;
2023-02-04 22:54:46 +00:00
//@description A chat theme was edited @theme_name If non-empty, name of a new theme, set for the chat. Otherwise, the chat theme was reset to the default one
2021-12-30 05:55:02 +00:00
pushMessageContentChatSetTheme theme_name:string = PushMessageContent;
2022-12-30 18:28:59 +00:00
//@description A chat member was deleted
//@member_name Name of the deleted member
//@is_current_user True, if the current user was deleted from the group
2021-12-30 05:55:02 +00:00
//@is_left True, if the user has left the group themselves
2019-06-07 10:56:06 +00:00
pushMessageContentChatDeleteMember member_name:string is_current_user:Bool is_left:Bool = PushMessageContent;
2021-12-30 05:55:02 +00:00
//@description A new member joined the chat via an invite link
2019-06-07 10:56:06 +00:00
pushMessageContentChatJoinByLink = PushMessageContent;
2021-12-30 05:55:02 +00:00
//@description A new member was accepted to the chat by an administrator
pushMessageContentChatJoinByRequest = PushMessageContent;
2022-06-21 18:10:07 +00:00
//@description A new recurrent payment was made by the current user @amount The paid amount
pushMessageContentRecurringPayment amount:string = PushMessageContent;
2022-12-30 18:28:59 +00:00
//@description A profile photo was suggested to the user
pushMessageContentSuggestProfilePhoto = PushMessageContent;
2019-06-07 10:56:06 +00:00
//@description A forwarded messages @total_count Number of forwarded messages
pushMessageContentMessageForwards total_count:int32 = PushMessageContent;
2022-12-30 18:28:59 +00:00
//@description A media album
//@total_count Number of messages in the album
//@has_photos True, if the album has at least one photo
//@has_videos True, if the album has at least one video file
//@has_audios True, if the album has at least one audio file
//@has_documents True, if the album has at least one document
2020-11-30 09:33:47 +00:00
pushMessageContentMediaAlbum total_count:int32 has_photos:Bool has_videos:Bool has_audios:Bool has_documents:Bool = PushMessageContent;
2019-06-07 10:56:06 +00:00
//@class NotificationType @description Contains detailed information about a notification
2022-06-21 18:10:07 +00:00
//@description New message was received @message The message @show_preview True, if message content must be displayed in notifications
notificationTypeNewMessage message:message show_preview:Bool = NotificationType;
2019-06-07 10:56:06 +00:00
//@description New secret chat was created
notificationTypeNewSecretChat = NotificationType;
//@description New call was received @call_id Call identifier
notificationTypeNewCall call_id:int32 = NotificationType;
//@description New message was received through a push notification
2020-11-30 09:33:47 +00:00
//@message_id The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id
2021-12-30 05:55:02 +00:00
//@sender_id Identifier of the sender of the message. Corresponding user or chat may be inaccessible
2020-11-30 09:33:47 +00:00
//@sender_name Name of the sender
//@is_outgoing True, if the message is outgoing
//@content Push message content
2021-12-30 05:55:02 +00:00
notificationTypeNewPushMessage message_id:int53 sender_id:MessageSender sender_name:string is_outgoing:Bool content:PushMessageContent = NotificationType;
2019-06-07 10:56:06 +00:00
2020-02-03 12:56:20 +00:00
//@class NotificationGroupType @description Describes the type of notifications in a notification group
2019-06-07 10:56:06 +00:00
//@description A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with ordinary unread messages
notificationGroupTypeMessages = NotificationGroupType;
//@description A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with unread mentions of the current user, replies to their messages, or a pinned message
notificationGroupTypeMentions = NotificationGroupType;
//@description A group containing a notification of type notificationTypeNewSecretChat
notificationGroupTypeSecretChat = NotificationGroupType;
//@description A group containing notifications of type notificationTypeNewCall
notificationGroupTypeCalls = NotificationGroupType;
2022-04-24 20:33:39 +00:00
//@description Describes a notification sound in MP3 format
//@id Unique identifier of the notification sound
//@duration Duration of the sound, in seconds
//@date Point in time (Unix timestamp) when the sound was created
//@title Title of the notification sound
//@data Arbitrary data, defined while the sound was uploaded
//@sound File containing the sound
notificationSound id:int64 duration:int32 date:int32 title:string data:string sound:file = NotificationSound;
//@description Contains a list of notification sounds @notification_sounds A list of notification sounds
notificationSounds notification_sounds:vector<notificationSound> = NotificationSounds;
2022-12-30 18:28:59 +00:00
//@description Contains information about a notification
//@id Unique persistent identifier of this notification
//@date Notification date
//@is_silent True, if the notification was explicitly sent without sound
//@type Notification type
2022-05-09 11:35:19 +00:00
notification id:int32 date:int32 is_silent:Bool type:NotificationType = Notification;
2019-06-07 10:56:06 +00:00
2022-12-30 18:28:59 +00:00
//@description Describes a group of notifications
//@id Unique persistent auto-incremented from 1 identifier of the notification group
//@type Type of the group
2019-06-07 10:56:06 +00:00
//@chat_id Identifier of a chat to which all notifications in the group belong
2022-12-30 18:28:59 +00:00
//@total_count Total number of active notifications in the group
//@notifications The list of active notifications
2019-06-07 10:56:06 +00:00
notificationGroup id:int32 type:NotificationGroupType chat_id:int53 total_count:int32 notifications:vector<notification> = NotificationGroup;
2018-08-30 14:55:42 +00:00
//@class OptionValue @description Represents the value of an option
2019-06-07 10:56:06 +00:00
//@description Represents a boolean option @value The value of the option
2018-08-30 14:55:42 +00:00
optionValueBoolean value:Bool = OptionValue;
2019-06-07 10:56:06 +00:00
//@description Represents an unknown option or an option which has a default value
2018-08-30 14:55:42 +00:00
optionValueEmpty = OptionValue;
2019-06-07 10:56:06 +00:00
//@description Represents an integer option @value The value of the option
2020-11-30 09:33:47 +00:00
optionValueInteger value:int64 = OptionValue;
2018-08-30 14:55:42 +00:00
2019-06-07 10:56:06 +00:00
//@description Represents a string option @value The value of the option
2018-08-30 14:55:42 +00:00
optionValueString value:string = OptionValue;
2019-06-07 10:56:06 +00:00
//@description Represents one member of a JSON object @key Member's key @value Member's value
jsonObjectMember key:string value:JsonValue = JsonObjectMember;
//@class JsonValue @description Represents a JSON value
//@description Represents a null JSON value
jsonValueNull = JsonValue;
//@description Represents a boolean JSON value @value The value
jsonValueBoolean value:Bool = JsonValue;
//@description Represents a numeric JSON value @value The value
jsonValueNumber value:double = JsonValue;
//@description Represents a string JSON value @value The value
jsonValueString value:string = JsonValue;
//@description Represents a JSON array @values The list of array elements
jsonValueArray values:vector<JsonValue> = JsonValue;
//@description Represents a JSON object @members The list of object members
jsonValueObject members:vector<jsonObjectMember> = JsonValue;
2018-08-30 14:55:42 +00:00
//@class UserPrivacySettingRule @description Represents a single rule for managing privacy settings
//@description A rule to allow all users to do something
userPrivacySettingRuleAllowAll = UserPrivacySettingRule;
//@description A rule to allow all of a user's contacts to do something
userPrivacySettingRuleAllowContacts = UserPrivacySettingRule;
2020-02-03 12:56:20 +00:00
//@description A rule to allow certain specified users to do something @user_ids The user identifiers, total number of users in all rules must not exceed 1000
2021-12-30 05:55:02 +00:00
userPrivacySettingRuleAllowUsers user_ids:vector<int53> = UserPrivacySettingRule;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description A rule to allow all members of certain specified basic groups and supergroups to doing something @chat_ids The chat identifiers, total number of chats in all rules must not exceed 20
userPrivacySettingRuleAllowChatMembers chat_ids:vector<int53> = UserPrivacySettingRule;
2018-08-30 14:55:42 +00:00
//@description A rule to restrict all users from doing something
userPrivacySettingRuleRestrictAll = UserPrivacySettingRule;
//@description A rule to restrict all contacts of a user from doing something
userPrivacySettingRuleRestrictContacts = UserPrivacySettingRule;
2020-02-03 12:56:20 +00:00
//@description A rule to restrict all specified users from doing something @user_ids The user identifiers, total number of users in all rules must not exceed 1000
2021-12-30 05:55:02 +00:00
userPrivacySettingRuleRestrictUsers user_ids:vector<int53> = UserPrivacySettingRule;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description A rule to restrict all members of specified basic groups and supergroups from doing something @chat_ids The chat identifiers, total number of chats in all rules must not exceed 20
userPrivacySettingRuleRestrictChatMembers chat_ids:vector<int53> = UserPrivacySettingRule;
2018-08-30 14:55:42 +00:00
//@description A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed @rules A list of rules
userPrivacySettingRules rules:vector<UserPrivacySettingRule> = UserPrivacySettingRules;
//@class UserPrivacySetting @description Describes available user privacy settings
//@description A privacy setting for managing whether the user's online status is visible
userPrivacySettingShowStatus = UserPrivacySetting;
2019-09-10 12:36:54 +00:00
//@description A privacy setting for managing whether the user's profile photo is visible
userPrivacySettingShowProfilePhoto = UserPrivacySetting;
//@description A privacy setting for managing whether a link to the user's account is included in forwarded messages
userPrivacySettingShowLinkInForwardedMessages = UserPrivacySetting;
2020-02-03 12:56:20 +00:00
//@description A privacy setting for managing whether the user's phone number is visible
userPrivacySettingShowPhoneNumber = UserPrivacySetting;
2018-08-30 14:55:42 +00:00
//@description A privacy setting for managing whether the user can be invited to chats
userPrivacySettingAllowChatInvites = UserPrivacySetting;
//@description A privacy setting for managing whether the user can be called
userPrivacySettingAllowCalls = UserPrivacySetting;
2019-06-07 10:56:06 +00:00
//@description A privacy setting for managing whether peer-to-peer connections can be used for calls
userPrivacySettingAllowPeerToPeerCalls = UserPrivacySetting;
2020-02-03 12:56:20 +00:00
//@description A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all"
userPrivacySettingAllowFindingByPhoneNumber = UserPrivacySetting;
2022-08-13 15:24:07 +00:00
//@description A privacy setting for managing whether the user can receive voice and video messages in private chats
userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = UserPrivacySetting;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Contains information about the period of inactivity after which the current user's account will automatically be deleted @days Number of days of inactivity before the account will be flagged for deletion; 30-366 days
2018-08-30 14:55:42 +00:00
accountTtl days:int32 = AccountTtl;
2022-12-30 18:28:59 +00:00
//@description Contains default auto-delete timer setting for new chats @time Message auto-delete time, in seconds. If 0, then messages aren't deleted automatically
messageAutoDeleteTime time:int32 = MessageAutoDeleteTime;
2022-12-07 20:04:16 +00:00
2022-05-09 11:35:19 +00:00
//@class SessionType @description Represents the type of a session
//@description The session is running on an Android device
sessionTypeAndroid = SessionType;
//@description The session is running on a generic Apple device
sessionTypeApple = SessionType;
//@description The session is running on the Brave browser
sessionTypeBrave = SessionType;
//@description The session is running on the Chrome browser
sessionTypeChrome = SessionType;
//@description The session is running on the Edge browser
sessionTypeEdge = SessionType;
//@description The session is running on the Firefox browser
sessionTypeFirefox = SessionType;
//@description The session is running on an iPad device
sessionTypeIpad = SessionType;
//@description The session is running on an iPhone device
sessionTypeIphone = SessionType;
//@description The session is running on a Linux device
sessionTypeLinux = SessionType;
//@description The session is running on a Mac device
sessionTypeMac = SessionType;
//@description The session is running on the Opera browser
sessionTypeOpera = SessionType;
//@description The session is running on the Safari browser
sessionTypeSafari = SessionType;
//@description The session is running on an Ubuntu device
sessionTypeUbuntu = SessionType;
//@description The session is running on an unknown type of device
sessionTypeUnknown = SessionType;
//@description The session is running on the Vivaldi browser
sessionTypeVivaldi = SessionType;
//@description The session is running on a Windows device
sessionTypeWindows = SessionType;
//@description The session is running on an Xbox console
sessionTypeXbox = SessionType;
2021-12-30 05:55:02 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@id Session identifier
//@is_current True, if this session is the current session
2022-08-13 15:24:07 +00:00
//@is_password_pending True, if a 2-step verification password is needed to complete authorization of the session
2021-12-30 05:55:02 +00:00
//@can_accept_secret_chats True, if incoming secret chats can be accepted by the session
//@can_accept_calls True, if incoming calls can be accepted by the session
2022-05-09 11:35:19 +00:00
//@type Session type based on the system and application version, which can be used to display a corresponding icon
2022-12-30 18:28:59 +00:00
//@api_id Telegram API identifier, as provided by the application
//@application_name Name of the application, as provided by the application
//@application_version The version of the application, as provided by the application
//@is_official_application True, if the application is an official application or uses the api_id of an official application
//@device_model Model of the device the application has been run or is running on, as provided by the application
//@platform Operating system the application has been run or is running on, as provided by the application
//@system_version Version of the operating system the application has been run or is running on, as provided by the application
//@log_in_date Point in time (Unix timestamp) when the user has logged in
//@last_active_date Point in time (Unix timestamp) when the session was last used
//@ip IP address from which the session was created, in human-readable format
//@country A two-letter country code for the country from which the session was created, based on the IP address
//@region Region code from which the session was created, based on the IP address
2022-05-09 11:35:19 +00:00
session id:int64 is_current:Bool is_password_pending:Bool can_accept_secret_chats:Bool can_accept_calls:Bool type:SessionType api_id:int32 application_name:string application_version:string is_official_application:Bool device_model:string platform:string system_version:string log_in_date:int32 last_active_date:int32 ip:string country:string region:string = Session;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Contains a list of sessions @sessions List of sessions @inactive_session_ttl_days Number of days of inactivity before sessions will automatically be terminated; 1-366 days
sessions sessions:vector<session> inactive_session_ttl_days:int32 = Sessions;
2018-08-30 14:55:42 +00:00
//@description Contains information about one website the current user is logged in with Telegram
//@id Website identifier
//@domain_name The domain name of the website
//@bot_user_id User identifier of a bot linked with the website
//@browser The version of a browser used to log in
//@platform Operating system the browser is running on
//@log_in_date Point in time (Unix timestamp) when the user was logged in
//@last_active_date Point in time (Unix timestamp) when obtained authorization was last used
//@ip IP address from which the user was logged in, in human-readable format
2022-04-24 20:33:39 +00:00
//@location Human-readable description of a country and a region from which the user was logged in, based on the IP address
2021-12-30 05:55:02 +00:00
connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string platform:string log_in_date:int32 last_active_date:int32 ip:string location:string = ConnectedWebsite;
2018-08-30 14:55:42 +00:00
//@description Contains a list of websites the current user is logged in with Telegram @websites List of connected websites
connectedWebsites websites:vector<connectedWebsite> = ConnectedWebsites;
//@class ChatReportReason @description Describes the reason why a chat is reported
//@description The chat contains spam messages
chatReportReasonSpam = ChatReportReason;
//@description The chat promotes violence
chatReportReasonViolence = ChatReportReason;
//@description The chat contains pornographic messages
chatReportReasonPornography = ChatReportReason;
2019-06-07 10:56:06 +00:00
//@description The chat has child abuse related content
chatReportReasonChildAbuse = ChatReportReason;
2018-09-05 21:45:29 +00:00
//@description The chat contains copyrighted content
chatReportReasonCopyright = ChatReportReason;
2020-02-03 12:56:20 +00:00
//@description The location-based chat is unrelated to its stated location
chatReportReasonUnrelatedLocation = ChatReportReason;
2021-12-30 05:55:02 +00:00
//@description The chat represents a fake account
chatReportReasonFake = ChatReportReason;
2022-03-13 04:04:12 +00:00
//@description The chat has illegal drugs related content
chatReportReasonIllegalDrugs = ChatReportReason;
//@description The chat contains messages with personal details
chatReportReasonPersonalDetails = ChatReportReason;
2021-12-30 05:55:02 +00:00
//@description A custom reason provided by the user
chatReportReasonCustom = ChatReportReason;
2022-06-21 18:10:07 +00:00
//@class TargetChat @description Describes the target chat to be opened
//@description The currently opened chat needs to be kept
targetChatCurrent = TargetChat;
//@description The chat needs to be chosen by the user among chats of the specified types
//@allow_user_chats True, if private chats with ordinary users are allowed
//@allow_bot_chats True, if private chats with other bots are allowed
//@allow_group_chats True, if basic group and supergroup chats are allowed
//@allow_channel_chats True, if channel chats are allowed
targetChatChosen allow_user_chats:Bool allow_bot_chats:Bool allow_group_chats:Bool allow_channel_chats:Bool = TargetChat;
//@description The chat needs to be open with the provided internal link @link An internal link pointing to the chat
targetChatInternalLink link:InternalLinkType = TargetChat;
2021-12-30 05:55:02 +00:00
2022-06-21 18:10:07 +00:00
//@class InternalLinkType @description Describes an internal https://t.me or tg: link, which must be processed by the application in a special way
//@description The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link
2021-12-30 05:55:02 +00:00
internalLinkTypeActiveSessions = InternalLinkType;
2022-06-21 18:10:07 +00:00
//@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.
2023-02-04 22:54:46 +00:00
//-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.
2022-04-24 20:33:39 +00:00
//-If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it.
2022-06-21 18:10:07 +00:00
//-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
2022-12-30 18:28:59 +00:00
//@target_chat Target chat to be opened
//@bot_username Username of the bot
//@url URL to be passed to openWebApp
2022-06-21 18:10:07 +00:00
internalLinkTypeAttachmentMenuBot target_chat:TargetChat bot_username:string url:string = InternalLinkType;
2022-04-24 20:33:39 +00:00
2021-12-30 05:55:02 +00:00
//@description The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode @code The authentication code
internalLinkTypeAuthenticationCode code:string = InternalLinkType;
//@description The link is a link to a background. Call searchBackground with the given background name to process the link @background_name Name of the background
internalLinkTypeBackground background_name:string = InternalLinkType;
//@description The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot,
//-and then call sendBotStartMessage with the given start parameter after the button is pressed
2022-12-30 18:28:59 +00:00
//@bot_username Username of the bot
//@start_parameter The parameter to be passed to sendBotStartMessage
2022-08-13 15:24:07 +00:00
//@autostart True, if sendBotStartMessage must be called automatically without showing the START button
internalLinkTypeBotStart bot_username:string start_parameter:string autostart:Bool = InternalLinkType;
2021-12-30 05:55:02 +00:00
//@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,
2022-04-24 20:33:39 +00:00
//-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.
2023-02-04 22:54:46 +00:00
//-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.
2022-12-30 18:28:59 +00:00
//@bot_username Username of the bot
//@start_parameter The parameter to be passed to sendBotStartMessage
//@administrator_rights Expected administrator rights for the bot; may be null
2022-04-24 20:33:39 +00:00
internalLinkTypeBotStartInGroup bot_username:string start_parameter:string administrator_rights:chatAdministratorRights = InternalLinkType;
//@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,
2023-02-04 22:54:46 +00:00
//-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
2022-12-30 18:28:59 +00:00
//@bot_username Username of the bot
//@administrator_rights Expected administrator rights for the bot
2022-04-24 20:33:39 +00:00
internalLinkTypeBotAddToChannel bot_username:string administrator_rights:chatAdministratorRights = InternalLinkType;
2021-12-30 05:55:02 +00:00
//@description The link is a link to the change phone number section of the app
internalLinkTypeChangePhoneNumber = InternalLinkType;
//@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link
internalLinkTypeChatInvite invite_link:string = InternalLinkType;
2022-12-30 18:28:59 +00:00
//@description The link is a link to the default message auto-delete timer settings section of the app settings
internalLinkTypeDefaultMessageAutoDeleteTimerSettings = InternalLinkType;
//@description The link is a link to the edit profile section of the app settings
internalLinkTypeEditProfileSettings = InternalLinkType;
//@description The link is a link to the filter section of the app settings
2021-12-30 05:55:02 +00:00
internalLinkTypeFilterSettings = InternalLinkType;
//@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame
2022-12-30 18:28:59 +00:00
//@bot_username Username of the bot that owns the game
//@game_short_name Short name of the game
2021-12-30 05:55:02 +00:00
internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkType;
2022-11-07 18:50:52 +00:00
//@description The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link @url URL to be passed to getWebPageInstantView @fallback_url An URL to open if getWebPageInstantView fails
internalLinkTypeInstantView url:string fallback_url:string = InternalLinkType;
2022-09-18 01:34:29 +00:00
2022-06-21 18:10:07 +00:00
//@description The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link @invoice_name Name of the invoice
internalLinkTypeInvoice invoice_name:string = InternalLinkType;
2021-12-30 05:55:02 +00:00
//@description The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link @language_pack_id Language pack identifier
internalLinkTypeLanguagePack language_pack_id:string = InternalLinkType;
2022-12-30 18:28:59 +00:00
//@description The link is a link to the language section of the app settings
2022-03-31 08:54:35 +00:00
internalLinkTypeLanguageSettings = InternalLinkType;
2022-12-07 20:04:16 +00:00
//@description The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link @url URL to be passed to getMessageLinkInfo
2021-12-30 05:55:02 +00:00
internalLinkTypeMessage url:string = InternalLinkType;
//@description The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field
2022-12-30 18:28:59 +00:00
//@text Message draft text
//@contains_link True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected
2021-12-30 05:55:02 +00:00
internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLinkType;
2023-02-04 22:54:46 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@bot_user_id User identifier of the service's bot
//@scope Telegram Passport element types requested by the service
//@public_key Service's public key
//@nonce Unique request identifier provided by the service
2023-02-04 22:54:46 +00:00
//@callback_url 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
2021-12-30 05:55:02 +00:00
internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:string nonce:string callback_url:string = InternalLinkType;
//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link
2022-12-30 18:28:59 +00:00
//@hash Hash value from the link
//@phone_number Phone number value from the link
2021-12-30 05:55:02 +00:00
internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType;
2022-06-21 18:10:07 +00:00
//@description The link is a link to the Premium features screen of the applcation from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link @referrer Referrer specified in the link
internalLinkTypePremiumFeatures referrer:string = InternalLinkType;
2022-12-30 18:28:59 +00:00
//@description The link is a link to the privacy and security section of the app settings
2022-03-31 08:54:35 +00:00
internalLinkTypePrivacyAndSecuritySettings = InternalLinkType;
2021-12-30 05:55:02 +00:00
//@description The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy
2022-12-30 18:28:59 +00:00
//@server Proxy server IP address
//@port Proxy server port
//@type Type of the proxy
2021-12-30 05:55:02 +00:00
internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType;
//@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link @chat_username Username of the chat
internalLinkTypePublicChat chat_username:string = InternalLinkType;
//@description The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to
//-"This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown
internalLinkTypeQrCodeAuthentication = InternalLinkType;
2022-08-13 15:24:07 +00:00
//@description The link forces restore of App Store purchases when opened. For official iOS application only
internalLinkTypeRestorePurchases = InternalLinkType;
2022-06-21 18:10:07 +00:00
//@description The link is a link to application settings
2021-12-30 05:55:02 +00:00
internalLinkTypeSettings = InternalLinkType;
2022-12-30 18:28:59 +00:00
//@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set
//@sticker_set_name Name of the sticker set
//@expect_custom_emoji True, if the sticker set is expected to contain custom emoji
internalLinkTypeStickerSet sticker_set_name:string expect_custom_emoji:Bool = InternalLinkType;
2021-12-30 05:55:02 +00:00
//@description The link is a link to a theme. TDLib has no theme support yet @theme_name Name of the theme
internalLinkTypeTheme theme_name:string = InternalLinkType;
2022-12-30 18:28:59 +00:00
//@description The link is a link to the theme section of the app settings
2021-12-30 05:55:02 +00:00
internalLinkTypeThemeSettings = InternalLinkType;
//@description The link is an unknown tg: link. Call getDeepLinkInfo to process the link @link Link to be passed to getDeepLinkInfo
internalLinkTypeUnknownDeepLink link:string = InternalLinkType;
//@description The link is a link to an unsupported proxy. An alert can be shown to the user
internalLinkTypeUnsupportedProxy = InternalLinkType;
2022-03-13 04:04:12 +00:00
//@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link @phone_number Phone number of the user
internalLinkTypeUserPhoneNumber phone_number:string = InternalLinkType;
2022-12-07 20:04:16 +00:00
//@description The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link @token The token
internalLinkTypeUserToken token:string = InternalLinkType;
2022-02-06 18:36:17 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@chat_username Username of the chat with the video chat
//@invite_hash If non-empty, invite hash to be used to join the video chat without being muted by administrators
2021-12-30 05:55:02 +00:00
//@is_live_stream True, if the video chat is expected to be a live stream in a channel or a broadcast group
internalLinkTypeVideoChat chat_username:string invite_hash:string is_live_stream:Bool = InternalLinkType;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Contains an HTTPS link to a message in a supergroup or channel, or a forum topic @link The link @is_public True, if the link will work for non-members of the chat
2020-11-30 09:33:47 +00:00
messageLink link:string is_public:Bool = MessageLink;
2018-08-30 14:55:42 +00:00
2022-12-07 20:04:16 +00:00
//@description Contains information about a link to a message or a forum topic in a chat
2022-12-30 18:28:59 +00:00
//@is_public True, if the link is a public link for a message or a forum topic in a chat
//@chat_id If found, identifier of the chat to which the link points, 0 otherwise
2022-12-07 20:04:16 +00:00
//@message_thread_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
2019-09-10 12:36:54 +00:00
//@message If found, the linked message; may be null
2021-12-30 05:55:02 +00:00
//@media_timestamp Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview
2019-09-10 12:36:54 +00:00
//@for_album True, if the whole media album to which the message belongs is linked
2022-11-07 18:50:52 +00:00
messageLinkInfo is_public:Bool chat_id:int53 message_thread_id:int53 message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo;
2019-09-10 12:36:54 +00:00
2018-08-30 14:55:42 +00:00
2019-06-07 10:56:06 +00:00
//@description Contains a part of a file @data File bytes
filePart data:bytes = FilePart;
2018-08-30 14:55:42 +00:00
//@class FileType @description Represents the type of a file
//@description The data is not a file
fileTypeNone = FileType;
//@description The file is an animation
fileTypeAnimation = FileType;
//@description The file is an audio file
fileTypeAudio = FileType;
//@description The file is a document
fileTypeDocument = FileType;
2022-04-24 20:33:39 +00:00
//@description The file is a notification sound
fileTypeNotificationSound = FileType;
2018-08-30 14:55:42 +00:00
//@description The file is a photo
fileTypePhoto = FileType;
//@description The file is a profile photo
fileTypeProfilePhoto = FileType;
//@description The file was sent to a secret chat (the file type is not known to the server)
fileTypeSecret = FileType;
2018-09-05 21:45:29 +00:00
//@description The file is a thumbnail of a file from a secret chat
fileTypeSecretThumbnail = FileType;
//@description The file is a file from Secure storage used for storing Telegram Passport files
fileTypeSecure = FileType;
2018-08-30 14:55:42 +00:00
//@description The file is a sticker
fileTypeSticker = FileType;
//@description The file is a thumbnail of another file
fileTypeThumbnail = FileType;
//@description The file type is not yet known
fileTypeUnknown = FileType;
//@description The file is a video
fileTypeVideo = FileType;
//@description The file is a video note
fileTypeVideoNote = FileType;
//@description The file is a voice note
fileTypeVoiceNote = FileType;
2019-09-10 12:36:54 +00:00
//@description The file is a wallpaper or a background pattern
2018-08-30 14:55:42 +00:00
fileTypeWallpaper = FileType;
2022-12-30 18:28:59 +00:00
//@description Contains the storage usage statistics for a specific file type
//@file_type File type
//@size Total size of the files, in bytes
//@count Total number of files
2018-08-30 14:55:42 +00:00
storageStatisticsByFileType file_type:FileType size:int53 count:int32 = StorageStatisticsByFileType;
2022-12-30 18:28:59 +00:00
//@description Contains the storage usage statistics for a specific chat
//@chat_id Chat identifier; 0 if none
//@size Total size of the files in the chat, in bytes
//@count Total number of files in the chat
//@by_file_type Statistics split by file types
2018-08-30 14:55:42 +00:00
storageStatisticsByChat chat_id:int53 size:int53 count:int32 by_file_type:vector<storageStatisticsByFileType> = StorageStatisticsByChat;
2022-12-30 18:28:59 +00:00
//@description Contains the exact storage usage statistics split by chats and file type
//@size Total size of files, in bytes
//@count Total number of files
//@by_chat Statistics split by chats
2018-08-30 14:55:42 +00:00
storageStatistics size:int53 count:int32 by_chat:vector<storageStatisticsByChat> = StorageStatistics;
2022-12-30 18:28:59 +00:00
//@description Contains approximate storage usage statistics, excluding files of unknown file type
//@files_size Approximate total size of files, in bytes
//@file_count Approximate number of files
//@database_size Size of the database
//@language_pack_database_size Size of the language pack database
//@log_size Size of the TDLib internal log
2019-06-07 10:56:06 +00:00
storageStatisticsFast files_size:int53 file_count:int32 database_size:int53 language_pack_database_size:int53 log_size:int53 = StorageStatisticsFast;
//@description Contains database statistics
//@statistics Database statistics in an unspecified human-readable format
databaseStatistics statistics:string = DatabaseStatistics;
2018-08-30 14:55:42 +00:00
//@class NetworkType @description Represents the type of a network
//@description The network is not available
networkTypeNone = NetworkType;
//@description A mobile network
networkTypeMobile = NetworkType;
//@description A mobile roaming network
networkTypeMobileRoaming = NetworkType;
//@description A Wi-Fi network
networkTypeWiFi = NetworkType;
//@description A different network type (e.g., Ethernet network)
networkTypeOther = NetworkType;
//@class NetworkStatisticsEntry @description Contains statistics about network usage
2021-12-30 05:55:02 +00:00
//@description Contains information about the total amount of data that was used to send and receive files
//@file_type Type of the file the data is part of; pass null if the data isn't related to files
//@network_type Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
2022-12-30 18:28:59 +00:00
//@sent_bytes Total number of bytes sent
//@received_bytes Total number of bytes received
2018-08-30 14:55:42 +00:00
networkStatisticsEntryFile file_type:FileType network_type:NetworkType sent_bytes:int53 received_bytes:int53 = NetworkStatisticsEntry;
2021-12-30 05:55:02 +00:00
//@description Contains information about the total amount of data that was used for calls
//@network_type Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
//@sent_bytes Total number of bytes sent
//@received_bytes Total number of bytes received
//@duration Total call duration, in seconds
2018-08-30 14:55:42 +00:00
networkStatisticsEntryCall network_type:NetworkType sent_bytes:int53 received_bytes:int53 duration:double = NetworkStatisticsEntry;
2020-11-30 09:33:47 +00:00
//@description A full list of available network statistic entries @since_date Point in time (Unix timestamp) from which the statistics are collected @entries Network statistics entries
2018-08-30 14:55:42 +00:00
networkStatistics since_date:int32 entries:vector<NetworkStatisticsEntry> = NetworkStatistics;
2019-09-10 12:36:54 +00:00
//@description Contains auto-download settings
//@is_auto_download_enabled True, if the auto-download is enabled
2021-12-30 05:55:02 +00:00
//@max_photo_file_size The maximum size of a photo file to be auto-downloaded, in bytes
//@max_video_file_size The maximum size of a video file to be auto-downloaded, in bytes
//@max_other_file_size The maximum size of other file types to be auto-downloaded, in bytes
//@video_upload_bitrate The maximum suggested bitrate for uploaded videos, in kbit/s
2020-11-30 09:33:47 +00:00
//@preload_large_videos True, if the beginning of video files needs to be preloaded for instant playback
2019-09-10 12:36:54 +00:00
//@preload_next_audio True, if the next audio track needs to be preloaded while the user is listening to an audio file
//@use_less_data_for_calls True, if "use less data for calls" option needs to be enabled
2022-06-21 18:10:07 +00:00
autoDownloadSettings is_auto_download_enabled:Bool max_photo_file_size:int32 max_video_file_size:int53 max_other_file_size:int53 video_upload_bitrate:int32 preload_large_videos:Bool preload_next_audio:Bool use_less_data_for_calls:Bool = AutoDownloadSettings;
2019-09-10 12:36:54 +00:00
2021-12-30 05:55:02 +00:00
//@description Contains auto-download settings presets for the current user
2019-09-10 12:36:54 +00:00
//@low Preset with lowest settings; supposed to be used by default when roaming
//@medium Preset with medium settings; supposed to be used by default when using mobile data
//@high Preset with highest settings; supposed to be used by default when connected on Wi-Fi
autoDownloadSettingsPresets low:autoDownloadSettings medium:autoDownloadSettings high:autoDownloadSettings = AutoDownloadSettingsPresets;
2023-02-04 22:54:46 +00:00
//@class AutosaveSettingsScope @description Describes scope of autosave settings
//@description Autosave settings applied to all private chats without chat-specific settings
autosaveSettingsScopePrivateChats = AutosaveSettingsScope;
//@description Autosave settings applied to all basic group and supergroup chats without chat-specific settings
autosaveSettingsScopeGroupChats = AutosaveSettingsScope;
//@description Autosave settings applied to all channel chats without chat-specific settings
autosaveSettingsScopeChannelChats = AutosaveSettingsScope;
//@description Autosave settings applied to a chat @chat_id Chat identifier
autosaveSettingsScopeChat chat_id:int53 = AutosaveSettingsScope;
//@description Contains autosave settings for an autosave settings scope
//@autosave_photos True, if photo autosave is enabled
//@autosave_videos True, if video autosave is enabled
//@max_video_file_size The maximum size of a video file to be autosaved, in bytes; 512 KB - 4000 MB
scopeAutosaveSettings autosave_photos:Bool autosave_videos:Bool max_video_file_size:int53 = ScopeAutosaveSettings;
//@description Contains autosave settings for a chat, which overrides default settings for the corresponding scope
//@chat_id Chat identifier
//@settings Autosave settings for the chat
autosaveSettingsException chat_id:int53 settings:scopeAutosaveSettings = AutosaveSettingsException;
//@description Describes autosave settings
//@private_chat_settings Default autosave settings for private chats
//@group_settings Default autosave settings for basic group and supergroup chats
//@channel_settings Default autosave settings for channel chats
//@exceptions Autosave settings for specific chats
autosaveSettings private_chat_settings:scopeAutosaveSettings group_settings:scopeAutosaveSettings channel_settings:scopeAutosaveSettings exceptions:vector<autosaveSettingsException> = AutosaveSettings;
2018-08-30 14:55:42 +00:00
//@class ConnectionState @description Describes the current state of the connection to Telegram servers
2019-09-10 12:36:54 +00:00
//@description Currently waiting for the network to become available. Use setNetworkType to change the available network type
2018-08-30 14:55:42 +00:00
connectionStateWaitingForNetwork = ConnectionState;
//@description Currently establishing a connection with a proxy server
connectionStateConnectingToProxy = ConnectionState;
//@description Currently establishing a connection to the Telegram servers
connectionStateConnecting = ConnectionState;
2020-11-30 09:33:47 +00:00
//@description Downloading data received while the application was offline
2018-08-30 14:55:42 +00:00
connectionStateUpdating = ConnectionState;
//@description There is a working connection to the Telegram servers
connectionStateReady = ConnectionState;
//@class TopChatCategory @description Represents the categories of chats for which a list of frequently used chats can be retrieved
//@description A category containing frequently used private chats with non-bot users
topChatCategoryUsers = TopChatCategory;
//@description A category containing frequently used private chats with bot users
topChatCategoryBots = TopChatCategory;
//@description A category containing frequently used basic groups and supergroups
topChatCategoryGroups = TopChatCategory;
//@description A category containing frequently used channels
topChatCategoryChannels = TopChatCategory;
//@description A category containing frequently used chats with inline bots sorted by their usage in inline mode
topChatCategoryInlineBots = TopChatCategory;
//@description A category containing frequently used chats used for calls
topChatCategoryCalls = TopChatCategory;
2020-02-03 12:56:20 +00:00
//@description A category containing frequently used chats used to forward messages
topChatCategoryForwardChats = TopChatCategory;
2018-08-30 14:55:42 +00:00
//@class TMeUrlType @description Describes the type of a URL linking to an internal Telegram entity
//@description A URL linking to a user @user_id Identifier of the user
2021-12-30 05:55:02 +00:00
tMeUrlTypeUser user_id:int53 = TMeUrlType;
2018-08-30 14:55:42 +00:00
//@description A URL linking to a public supergroup or channel @supergroup_id Identifier of the supergroup or channel
tMeUrlTypeSupergroup supergroup_id:int53 = TMeUrlType;
2022-03-13 04:04:12 +00:00
//@description A chat invite link @info Information about the chat invite link
2018-08-30 14:55:42 +00:00
tMeUrlTypeChatInvite info:chatInviteLinkInfo = TMeUrlType;
//@description A URL linking to a sticker set @sticker_set_id Identifier of the sticker set
tMeUrlTypeStickerSet sticker_set_id:int64 = TMeUrlType;
//@description Represents a URL linking to an internal Telegram entity @url URL @type Type of the URL
tMeUrl url:string type:TMeUrlType = TMeUrl;
//@description Contains a list of t.me URLs @urls List of URLs
tMeUrls urls:vector<tMeUrl> = TMeUrls;
2020-11-30 09:33:47 +00:00
//@class SuggestedAction @description Describes an action suggested to the current user
//@description Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option
suggestedActionEnableArchiveAndMuteNewChats = SuggestedAction;
2021-12-30 05:55:02 +00:00
//@description Suggests the user to check whether they still remember their 2-step verification password
suggestedActionCheckPassword = SuggestedAction;
//@description Suggests the user to check whether authorization phone number is correct and change the phone number if it is inaccessible
2020-11-30 09:33:47 +00:00
suggestedActionCheckPhoneNumber = SuggestedAction;
2021-12-30 05:55:02 +00:00
//@description Suggests the user to view a hint about the meaning of one and two check marks on sent messages
suggestedActionViewChecksHint = SuggestedAction;
//@description Suggests the user to convert specified supergroup to a broadcast group @supergroup_id Supergroup identifier
suggestedActionConvertToBroadcastGroup supergroup_id:int53 = SuggestedAction;
2023-02-04 22:54:46 +00:00
//@description Suggests the user to set a 2-step verification password to be able to log in again
//@authorization_delay The number of days to pass between consecutive authorizations if the user declines to set password; if 0, then the user is advised to set the password for security reasons
2021-12-30 05:55:02 +00:00
suggestedActionSetPassword authorization_delay:int32 = SuggestedAction;
2023-02-04 22:54:46 +00:00
//@description Suggests the user to upgrade the Premium subscription from monthly payments to annual payments
suggestedActionUpgradePremium = SuggestedAction;
//@description Suggests the user to subscribe to the Premium subscription with annual payments
suggestedActionSubscribeToAnnualPremium = SuggestedAction;
2020-11-30 09:33:47 +00:00
2018-08-30 14:55:42 +00:00
//@description Contains a counter @count Count
count count:int32 = Count;
//@description Contains some text @text Text
text text:string = Text;
2018-09-05 21:45:29 +00:00
//@description Contains a value representing a number of seconds @seconds Number of seconds
seconds seconds:double = Seconds;
2022-06-21 18:10:07 +00:00
//@description Contains size of downloaded prefix of a file @size The prefix size, in bytes
fileDownloadedPrefixSize size:int53 = FileDownloadedPrefixSize;
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
//@description Contains information about a tg: deep link @text Text to be shown to the user @need_update_application True, if the user must be asked to update the application
2018-09-05 21:45:29 +00:00
deepLinkInfo text:formattedText need_update_application:Bool = DeepLinkInfo;
2018-08-30 14:55:42 +00:00
2022-12-07 20:04:16 +00:00
//@class TextParseMode @description Describes the way the text needs to be parsed for text entities
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description The text uses Markdown-style formatting
//@version Version of the parser: 0 or 1 - Telegram Bot API "Markdown" parse mode, 2 - Telegram Bot API "MarkdownV2" parse mode
2020-02-03 12:56:20 +00:00
textParseModeMarkdown version:int32 = TextParseMode;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description The text uses HTML-style formatting. The same as Telegram Bot API "HTML" parse mode
2018-08-30 14:55:42 +00:00
textParseModeHTML = TextParseMode;
2020-02-03 12:56:20 +00:00
//@class ProxyType @description Describes the type of a proxy server
2018-09-05 21:45:29 +00:00
//@description A SOCKS5 proxy server @username Username for logging in; may be empty @password Password for logging in; may be empty
proxyTypeSocks5 username:string password:string = ProxyType;
2020-11-30 09:33:47 +00:00
//@description A HTTP transparent proxy server @username Username for logging in; may be empty @password Password for logging in; may be empty @http_only Pass true if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method
2018-09-05 21:45:29 +00:00
proxyTypeHttp username:string password:string http_only:Bool = ProxyType;
//@description An MTProto proxy server @secret The proxy's secret in hexadecimal encoding
proxyTypeMtproto secret:string = ProxyType;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Contains information about a proxy server
//@id Unique identifier of the proxy
//@server Proxy server IP address
//@port Proxy server port
//@last_used_date Point in time (Unix timestamp) when the proxy was last used; 0 if never
//@is_enabled True, if the proxy is enabled now
//@type Type of the proxy
2018-09-05 21:45:29 +00:00
proxy id:int32 server:string port:int32 last_used_date:int32 is_enabled:Bool type:ProxyType = Proxy;
//@description Represents a list of proxy servers @proxies List of proxy servers
proxies proxies:vector<proxy> = Proxies;
2018-08-30 14:55:42 +00:00
2022-02-06 18:36:17 +00:00
//@description A sticker to be added to a sticker set
2022-12-30 18:28:59 +00:00
//@sticker File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side.
//-Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
2020-11-30 09:33:47 +00:00
//@emojis Emojis corresponding to the sticker
2022-08-13 15:24:07 +00:00
//@format Sticker format
//@mask_position Position where the mask is placed; pass null if not specified
inputSticker sticker:InputFile emojis:string format:StickerFormat mask_position:maskPosition = InputSticker;
2020-11-30 09:33:47 +00:00
//@description Represents a date range @start_date Point in time (Unix timestamp) at which the date range begins @end_date Point in time (Unix timestamp) at which the date range ends
dateRange start_date:int32 end_date:int32 = DateRange;
//@description A value with information about its recent changes @value The current value @previous_value The value for the previous day @growth_rate_percentage The growth rate of the value, as a percentage
statisticalValue value:double previous_value:double growth_rate_percentage:double = StatisticalValue;
//@class StatisticalGraph @description Describes a statistical graph
//@description A graph data @json_data Graph data in JSON format @zoom_token If non-empty, a token which can be used to receive a zoomed in graph
statisticalGraphData json_data:string zoom_token:string = StatisticalGraph;
//@description The graph data to be asynchronously loaded through getStatisticalGraph @token The token to use for data loading
statisticalGraphAsync token:string = StatisticalGraph;
//@description An error message to be shown to the user instead of the graph @error_message The error message
statisticalGraphError error_message:string = StatisticalGraph;
//@description Contains statistics about interactions with a message
//@message_id Message identifier
//@view_count Number of times the message was viewed
//@forward_count Number of times the message was forwarded
chatStatisticsMessageInteractionInfo message_id:int53 view_count:int32 forward_count:int32 = ChatStatisticsMessageInteractionInfo;
//@description Contains statistics about messages sent by a user
//@user_id User identifier
//@sent_message_count Number of sent messages
2021-12-30 05:55:02 +00:00
//@average_character_count Average number of characters in sent messages; 0 if unknown
chatStatisticsMessageSenderInfo user_id:int53 sent_message_count:int32 average_character_count:int32 = ChatStatisticsMessageSenderInfo;
2020-11-30 09:33:47 +00:00
//@description Contains statistics about administrator actions done by a user
//@user_id Administrator user identifier
//@deleted_message_count Number of messages deleted by the administrator
//@banned_user_count Number of users banned by the administrator
//@restricted_user_count Number of users restricted by the administrator
2021-12-30 05:55:02 +00:00
chatStatisticsAdministratorActionsInfo user_id:int53 deleted_message_count:int32 banned_user_count:int32 restricted_user_count:int32 = ChatStatisticsAdministratorActionsInfo;
2020-11-30 09:33:47 +00:00
//@description Contains statistics about number of new members invited by a user
//@user_id User identifier
//@added_member_count Number of new members invited by the user
2021-12-30 05:55:02 +00:00
chatStatisticsInviterInfo user_id:int53 added_member_count:int32 = ChatStatisticsInviterInfo;
2020-11-30 09:33:47 +00:00
//@class ChatStatistics @description Contains a detailed statistics about a chat
//@description A detailed statistics about a supergroup chat
//@period A period to which the statistics applies
//@member_count Number of members in the chat
//@message_count Number of messages sent to the chat
//@viewer_count Number of users who viewed messages in the chat
//@sender_count Number of users who sent messages to the chat
//@member_count_graph A graph containing number of members in the chat
//@join_graph A graph containing number of members joined and left the chat
//@join_by_source_graph A graph containing number of new member joins per source
//@language_graph A graph containing distribution of active users per language
//@message_content_graph A graph containing distribution of sent messages by content type
//@action_graph A graph containing number of different actions in the chat
//@day_graph A graph containing distribution of message views per hour
//@week_graph A graph containing distribution of message views per day of week
//@top_senders List of users sent most messages in the last week
//@top_administrators List of most active administrators in the last week
//@top_inviters List of most active inviters of new members in the last week
chatStatisticsSupergroup period:dateRange member_count:statisticalValue message_count:statisticalValue viewer_count:statisticalValue sender_count:statisticalValue member_count_graph:StatisticalGraph join_graph:StatisticalGraph join_by_source_graph:StatisticalGraph language_graph:StatisticalGraph message_content_graph:StatisticalGraph action_graph:StatisticalGraph day_graph:StatisticalGraph week_graph:StatisticalGraph top_senders:vector<chatStatisticsMessageSenderInfo> top_administrators:vector<chatStatisticsAdministratorActionsInfo> top_inviters:vector<chatStatisticsInviterInfo> = ChatStatistics;
//@description A detailed statistics about a channel chat
//@period A period to which the statistics applies
//@member_count Number of members in the chat
//@mean_view_count Mean number of times the recently sent messages was viewed
//@mean_share_count Mean number of times the recently sent messages was shared
//@enabled_notifications_percentage A percentage of users with enabled notifications for the chat
//@member_count_graph A graph containing number of members in the chat
//@join_graph A graph containing number of members joined and left the chat
//@mute_graph A graph containing number of members muted and unmuted the chat
//@view_count_by_hour_graph A graph containing number of message views in a given hour in the last two weeks
//@view_count_by_source_graph A graph containing number of message views per source
//@join_by_source_graph A graph containing number of new member joins per source
//@language_graph A graph containing number of users viewed chat messages per language
//@message_interaction_graph A graph containing number of chat message views and shares
//@instant_view_interaction_graph A graph containing number of views of associated with the chat instant views
//@recent_message_interactions Detailed statistics about number of views and shares of recently sent messages
chatStatisticsChannel period:dateRange member_count:statisticalValue mean_view_count:statisticalValue mean_share_count:statisticalValue enabled_notifications_percentage:double member_count_graph:StatisticalGraph join_graph:StatisticalGraph mute_graph:StatisticalGraph view_count_by_hour_graph:StatisticalGraph view_count_by_source_graph:StatisticalGraph join_by_source_graph:StatisticalGraph language_graph:StatisticalGraph message_interaction_graph:StatisticalGraph instant_view_interaction_graph:StatisticalGraph recent_message_interactions:vector<chatStatisticsMessageInteractionInfo> = ChatStatistics;
//@description A detailed statistics about a message @message_interaction_graph A graph containing number of message views and shares
messageStatistics message_interaction_graph:StatisticalGraph = MessageStatistics;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A point on a Cartesian plane @x The point's first coordinate @y The point's second coordinate
point x:double y:double = Point;
//@class VectorPathCommand @description Represents a vector path command
//@description A straight line to a given point @end_point The end point of the straight line
vectorPathCommandLine end_point:point = VectorPathCommand;
//@description A cubic Bézier curve to a given point @start_control_point The start control point of the curve @end_control_point The end control point of the curve @end_point The end point of the curve
vectorPathCommandCubicBezierCurve start_control_point:point end_control_point:point end_point:point = VectorPathCommand;
//@class BotCommandScope @description Represents the scope to which bot commands are relevant
//@description A scope covering all users
botCommandScopeDefault = BotCommandScope;
//@description A scope covering all private chats
botCommandScopeAllPrivateChats = BotCommandScope;
//@description A scope covering all group and supergroup chats
botCommandScopeAllGroupChats = BotCommandScope;
//@description A scope covering all group and supergroup chat administrators
botCommandScopeAllChatAdministrators = BotCommandScope;
//@description A scope covering all members of a chat @chat_id Chat identifier
botCommandScopeChat chat_id:int53 = BotCommandScope;
//@description A scope covering all administrators of a chat @chat_id Chat identifier
botCommandScopeChatAdministrators chat_id:int53 = BotCommandScope;
//@description A scope covering a member of a chat @chat_id Chat identifier @user_id User identifier
botCommandScopeChatMember chat_id:int53 user_id:int53 = BotCommandScope;
2018-08-30 14:55:42 +00:00
//@class Update @description Contains notifications about data changes
//@description The user authorization state has changed @authorization_state New authorization state
updateAuthorizationState authorization_state:AuthorizationState = Update;
2019-06-07 10:56:06 +00:00
//@description A new message was received; can also be an outgoing message @message The new message
updateNewMessage message:message = Update;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed.
//-This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message
//@chat_id The chat identifier of the sent message
//@message_id A temporary message identifier
2018-08-30 14:55:42 +00:00
updateMessageSendAcknowledged chat_id:int53 message_id:int53 = Update;
2021-12-30 05:55:02 +00:00
//@description A message has been successfully sent @message The sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change @old_message_id The previous temporary message identifier
2018-08-30 14:55:42 +00:00
updateMessageSendSucceeded message:message old_message_id:int53 = Update;
//@description A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update
2022-12-30 18:28:59 +00:00
//@message The failed to send message
//@old_message_id The previous temporary message identifier
//@error_code An error code
//@error_message Error message
2018-08-30 14:55:42 +00:00
updateMessageSendFailed message:message old_message_id:int53 error_code:int32 error_message:string = Update;
//@description The message content has changed @chat_id Chat identifier @message_id Message identifier @new_content New message content
updateMessageContent chat_id:int53 message_id:int53 new_content:MessageContent = Update;
2022-12-30 18:28:59 +00:00
//@description A message was edited. Changes in the message content will come in a separate updateMessageContent
//@chat_id Chat identifier
//@message_id Message identifier
//@edit_date Point in time (Unix timestamp) when the message was edited
//@reply_markup New message reply markup; may be null
2018-08-30 14:55:42 +00:00
updateMessageEdited chat_id:int53 message_id:int53 edit_date:int32 reply_markup:ReplyMarkup = Update;
2020-11-30 09:33:47 +00:00
//@description The message pinned state was changed @chat_id Chat identifier @message_id The message identifier @is_pinned True, if the message is pinned
updateMessageIsPinned chat_id:int53 message_id:int53 is_pinned:Bool = Update;
//@description The information about interactions with a message has changed @chat_id Chat identifier @message_id Message identifier @interaction_info New information about interactions with the message; may be null
updateMessageInteractionInfo chat_id:int53 message_id:int53 interaction_info:messageInteractionInfo = Update;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the self-destruct timer @chat_id Chat identifier @message_id Message identifier
2018-08-30 14:55:42 +00:00
updateMessageContentOpened chat_id:int53 message_id:int53 = Update;
//@description A message with an unread mention was read @chat_id Chat identifier @message_id Message identifier @unread_mention_count The new number of unread mention messages left in the chat
updateMessageMentionRead chat_id:int53 message_id:int53 unread_mention_count:int32 = Update;
2022-12-30 18:28:59 +00:00
//@description The list of unread reactions added to a message was changed
//@chat_id Chat identifier
//@message_id Message identifier
//@unread_reactions The new list of unread reactions
//@unread_reaction_count The new number of messages with unread reactions left in the chat
2022-02-06 18:36:17 +00:00
updateMessageUnreadReactions chat_id:int53 message_id:int53 unread_reactions:vector<unreadReaction> unread_reaction_count:int32 = Update;
2020-11-30 09:33:47 +00:00
//@description A message with a live location was viewed. When the update is received, the application is supposed to update the live location
2022-12-30 18:28:59 +00:00
//@chat_id Identifier of the chat with the live location message
//@message_id Identifier of the message with live location
2020-02-03 12:56:20 +00:00
updateMessageLiveLocationViewed chat_id:int53 message_id:int53 = Update;
2020-11-30 09:33:47 +00:00
//@description A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates @chat The chat
2018-08-30 14:55:42 +00:00
updateNewChat chat:chat = Update;
//@description The title of a chat was changed @chat_id Chat identifier @title The new chat title
updateChatTitle chat_id:int53 title:string = Update;
//@description A chat photo was changed @chat_id Chat identifier @photo The new chat photo; may be null
2020-11-30 09:33:47 +00:00
updateChatPhoto chat_id:int53 photo:chatPhotoInfo = Update;
2018-08-30 14:55:42 +00:00
2019-09-10 12:36:54 +00:00
//@description Chat permissions was changed @chat_id Chat identifier @permissions The new chat permissions
updateChatPermissions chat_id:int53 permissions:chatPermissions = Update;
2022-12-30 18:28:59 +00:00
//@description The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case
//@chat_id Chat identifier
//@last_message The new last message in the chat; may be null
//@positions The new chat positions in the chat lists
2020-11-30 09:33:47 +00:00
updateChatLastMessage chat_id:int53 last_message:message positions:vector<chatPosition> = Update;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@description The position of a chat in a chat list has changed. An updateChatLastMessage or updateChatDraftMessage update might be sent instead of the update
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@position New chat position. If new order is 0, then the chat needs to be removed from the list
2020-11-30 09:33:47 +00:00
updateChatPosition chat_id:int53 position:chatPosition = Update;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Incoming messages were read or the number of unread messages has been changed @chat_id Chat identifier @last_read_inbox_message_id Identifier of the last read incoming message @unread_count The number of unread messages left in the chat
2018-08-30 14:55:42 +00:00
updateChatReadInbox chat_id:int53 last_read_inbox_message_id:int53 unread_count:int32 = Update;
//@description Outgoing messages were read @chat_id Chat identifier @last_read_outbox_message_id Identifier of last read outgoing message
updateChatReadOutbox chat_id:int53 last_read_outbox_message_id:int53 = Update;
2021-12-30 05:55:02 +00:00
//@description The chat action bar was changed @chat_id Chat identifier @action_bar The new value of the action bar; may be null
updateChatActionBar chat_id:int53 action_bar:ChatActionBar = Update;
2022-09-18 01:34:29 +00:00
//@description The chat available reactions were changed @chat_id Chat identifier @available_reactions The new reactions, available in the chat
updateChatAvailableReactions chat_id:int53 available_reactions:ChatAvailableReactions = Update;
2022-02-06 18:36:17 +00:00
2022-12-30 18:28:59 +00:00
//@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
//@chat_id Chat identifier
//@draft_message The new draft message; may be null
//@positions The new chat positions in the chat lists
2021-12-30 05:55:02 +00:00
updateChatDraftMessage chat_id:int53 draft_message:draftMessage positions:vector<chatPosition> = Update;
//@description The message sender that is selected to send messages in a chat has changed @chat_id Chat identifier @message_sender_id New value of message_sender_id; may be null if the user can't change message sender
updateChatMessageSender chat_id:int53 message_sender_id:MessageSender = Update;
2022-12-30 18:28:59 +00:00
//@description The message auto-delete or self-destruct timer setting for a chat was changed @chat_id Chat identifier @message_auto_delete_time New value of message_auto_delete_time
updateChatMessageAutoDeleteTime chat_id:int53 message_auto_delete_time:int32 = Update;
2018-08-30 14:55:42 +00:00
2018-09-05 21:45:29 +00:00
//@description Notification settings for a chat were changed @chat_id Chat identifier @notification_settings The new notification settings
updateChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Update;
2021-12-30 05:55:02 +00:00
//@description The chat pending join requests were changed @chat_id Chat identifier @pending_join_requests The new data about pending join requests; may be null
updateChatPendingJoinRequests chat_id:int53 pending_join_requests:chatJoinRequestsInfo = Update;
2020-02-03 12:56:20 +00:00
2018-08-30 14:55:42 +00:00
//@description The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
2018-08-30 14:55:42 +00:00
updateChatReplyMarkup chat_id:int53 reply_markup_message_id:int53 = Update;
2021-12-30 05:55:02 +00:00
//@description The chat theme was changed @chat_id Chat identifier @theme_name The new name of the chat theme; may be empty if theme was reset to default
updateChatTheme chat_id:int53 theme_name:string = Update;
//@description The chat unread_mention_count has changed @chat_id Chat identifier @unread_mention_count The number of unread mention messages left in the chat
updateChatUnreadMentionCount chat_id:int53 unread_mention_count:int32 = Update;
2022-02-06 18:36:17 +00:00
//@description The chat unread_reaction_count has changed @chat_id Chat identifier @unread_reaction_count The number of messages with unread reactions left in the chat
updateChatUnreadReactionCount chat_id:int53 unread_reaction_count:int32 = Update;
2021-12-30 05:55:02 +00:00
//@description A chat video chat state has changed @chat_id Chat identifier @video_chat New value of video_chat
updateChatVideoChat chat_id:int53 video_chat:videoChat = Update;
//@description The value of the default disable_notification parameter, used when a message is sent to the chat, was changed @chat_id Chat identifier @default_disable_notification The new default_disable_notification value
updateChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Update;
//@description A chat content was allowed or restricted for saving @chat_id Chat identifier @has_protected_content New value of has_protected_content
updateChatHasProtectedContent chat_id:int53 has_protected_content:Bool = Update;
2023-02-04 22:54:46 +00:00
//@description Translation of chat messages was enabled or disabled @chat_id Chat identifier @is_translatable New value of is_translatable
updateChatIsTranslatable chat_id:int53 is_translatable:Bool = Update;
//@description A chat was marked as unread or was read @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread
updateChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Update;
2021-12-30 05:55:02 +00:00
//@description A chat was blocked or unblocked @chat_id Chat identifier @is_blocked New value of is_blocked
updateChatIsBlocked chat_id:int53 is_blocked:Bool = Update;
2023-02-04 22:54:46 +00:00
//@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages
updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update;
2020-11-30 09:33:47 +00:00
2022-06-21 18:10:07 +00:00
//@description The list of chat filters or a chat filter has changed @chat_filters The new list of chat filters @main_chat_list_position Position of the main chat list among chat filters, 0-based
updateChatFilters chat_filters:vector<chatFilterInfo> main_chat_list_position:int32 = Update;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
//@chat_id Identifier of the chat
//@online_member_count New number of online members in the chat, or 0 if unknown
2019-06-07 10:56:06 +00:00
updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update;
2022-11-07 18:50:52 +00:00
//@description Basic information about a topic in a forum chat was changed @chat_id Chat identifier @info New information about the topic
updateForumTopicInfo chat_id:int53 info:forumTopicInfo = Update;
2021-12-30 05:55:02 +00:00
//@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings
updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update;
2019-06-07 10:56:06 +00:00
//@description A notification was changed @notification_group_id Unique notification group identifier @notification Changed notification
updateNotification notification_group_id:int32 notification:notification = Update;
//@description A list of active notifications in a notification group has changed
//@notification_group_id Unique notification group identifier
//@type New type of the notification group
//@chat_id Identifier of a chat to which all notifications in the group belong
//@notification_settings_chat_id Chat identifier, which notification settings must be applied to the added notifications
2022-04-24 20:33:39 +00:00
//@notification_sound_id Identifier of the notification sound to be played; 0 if sound is disabled
2019-06-07 10:56:06 +00:00
//@total_count Total number of unread notifications in the group, can be bigger than number of active notifications
2022-12-30 18:28:59 +00:00
//@added_notifications List of added group notifications, sorted by notification ID
//@removed_notification_ids Identifiers of removed group notifications, sorted by notification ID
2022-04-24 20:33:39 +00:00
updateNotificationGroup notification_group_id:int32 type:NotificationGroupType chat_id:int53 notification_settings_chat_id:int53 notification_sound_id:int64 total_count:int32 added_notifications:vector<notification> removed_notification_ids:vector<int32> = Update;
2019-06-07 10:56:06 +00:00
2020-02-03 12:56:20 +00:00
//@description Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update @groups Lists of active notification groups
2019-06-07 10:56:06 +00:00
updateActiveNotifications groups:vector<notificationGroup> = Update;
2020-02-03 12:56:20 +00:00
//@description Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications
2019-06-07 10:56:06 +00:00
//@have_delayed_notifications True, if there are some delayed notification updates, which will be sent soon
//@have_unreceived_notifications True, if there can be some yet unreceived notifications, which are being fetched from the server
updateHavePendingNotifications have_delayed_notifications:Bool have_unreceived_notifications:Bool = Update;
2022-12-30 18:28:59 +00:00
//@description Some messages were deleted
//@chat_id Chat identifier
//@message_ids Identifiers of the deleted messages
2019-06-07 10:56:06 +00:00
//@is_permanent True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)
2018-08-30 14:55:42 +00:00
//@from_cache True, if the messages are deleted only from the cache and can possibly be retrieved again in the future
updateDeleteMessages chat_id:int53 message_ids:vector<int53> is_permanent:Bool from_cache:Bool = Update;
2022-12-30 18:28:59 +00:00
//@description A message sender activity in the chat has changed
//@chat_id Chat identifier
//@message_thread_id If not 0, a message thread identifier in which the action was performed
//@sender_id Identifier of a message sender performing the action
//@action The action
2021-12-30 05:55:02 +00:00
updateChatAction chat_id:int53 message_thread_id:int53 sender_id:MessageSender action:ChatAction = Update;
2018-08-30 14:55:42 +00:00
//@description The user went online or offline @user_id User identifier @status New status of the user
2021-12-30 05:55:02 +00:00
updateUserStatus user_id:int53 status:UserStatus = Update;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application @user New data about the user
2018-08-30 14:55:42 +00:00
updateUser user:user = Update;
2020-11-30 09:33:47 +00:00
//@description Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application @basic_group New data about the group
2018-08-30 14:55:42 +00:00
updateBasicGroup basic_group:basicGroup = Update;
2020-11-30 09:33:47 +00:00
//@description Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application @supergroup New data about the supergroup
2018-08-30 14:55:42 +00:00
updateSupergroup supergroup:supergroup = Update;
2020-11-30 09:33:47 +00:00
//@description Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application @secret_chat New data about the secret chat
2018-08-30 14:55:42 +00:00
updateSecretChat secret_chat:secretChat = Update;
2021-12-30 05:55:02 +00:00
//@description Some data in userFullInfo has been changed @user_id User identifier @user_full_info New full information about the user
updateUserFullInfo user_id:int53 user_full_info:userFullInfo = Update;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Some data in basicGroupFullInfo has been changed @basic_group_id Identifier of a basic group @basic_group_full_info New full information about the group
updateBasicGroupFullInfo basic_group_id:int53 basic_group_full_info:basicGroupFullInfo = Update;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Some data in supergroupFullInfo has been changed @supergroup_id Identifier of the supergroup or channel @supergroup_full_info New full information about the supergroup
updateSupergroupFullInfo supergroup_id:int53 supergroup_full_info:supergroupFullInfo = Update;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description A service notification from the server was received. Upon receiving this the application must show a popup with the content of the notification
//@type Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" must be shown under notification; if user presses the second, all local data must be destroyed using Destroy method
2018-09-05 21:45:29 +00:00
//@content Notification content
2018-08-30 14:55:42 +00:00
updateServiceNotification type:string content:MessageContent = Update;
//@description Information about a file was updated @file New data about the file
updateFile file:file = Update;
2020-11-30 09:33:47 +00:00
//@description The file generation process needs to be started by the application
2018-08-30 14:55:42 +00:00
//@generation_id Unique identifier for the generation process
2018-09-05 21:45:29 +00:00
//@original_path The path to a file from which a new file is generated; may be empty
2021-12-30 05:55:02 +00:00
//@destination_path The path to a file that must be created and where the new file is generated
//@conversion String specifying the conversion applied to the original file. If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which must be downloaded by the application
2018-08-30 14:55:42 +00:00
updateFileGenerationStart generation_id:int64 original_path:string destination_path:string conversion:string = Update;
//@description File generation is no longer needed @generation_id Unique identifier for the generation process
updateFileGenerationStop generation_id:int64 = Update;
2022-03-13 04:04:12 +00:00
//@description The state of the file download list has changed
//@total_size Total size of files in the file download list, in bytes
//@total_count Total number of files in the file download list
//@downloaded_size Total downloaded size of files in the file download list, in bytes
updateFileDownloads total_size:int53 total_count:int32 downloaded_size:int53 = Update;
//@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 @file_download The added file download @counts New number of being downloaded and recently downloaded files found
updateFileAddedToDownloads file_download:fileDownload counts:downloadedFileCounts = Update;
2022-12-30 18:28:59 +00:00
//@description A file download was changed. This update is sent only after file download list is loaded for the first time
//@file_id File identifier
2022-03-13 04:04:12 +00:00
//@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
//@counts New number of being downloaded and recently downloaded files found
updateFileDownload file_id:int32 complete_date:int32 is_paused:Bool counts:downloadedFileCounts = Update;
//@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 @file_id File identifier @counts New number of being downloaded and recently downloaded files found
updateFileRemovedFromDownloads file_id:int32 counts:downloadedFileCounts = Update;
2018-08-30 14:55:42 +00:00
//@description New call was created or information about a call was updated @call New data about a call
updateCall call:call = Update;
2021-12-30 05:55:02 +00:00
//@description Information about a group call was updated @group_call New data about a group call
updateGroupCall group_call:groupCall = Update;
//@description Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined
2022-12-30 18:28:59 +00:00
//@group_call_id Identifier of group call
//@participant New data about a participant
2021-12-30 05:55:02 +00:00
updateGroupCallParticipant group_call_id:int32 participant:groupCallParticipant = Update;
2020-11-30 09:33:47 +00:00
//@description New call signaling data arrived @call_id The call identifier @data The data
updateNewCallSignalingData call_id:int32 data:bytes = Update;
2018-08-30 14:55:42 +00:00
//@description Some privacy setting rules have been changed @setting The privacy setting @rules New privacy rules
updateUserPrivacySettingRules setting:UserPrivacySetting rules:userPrivacySettingRules = Update;
2022-12-30 18:28:59 +00:00
//@description Number of unread messages in a chat list has changed. This update is sent only if the message database is used
//@chat_list The chat list with changed number of unread messages
//@unread_count Total number of unread messages
//@unread_unmuted_count Total number of unread messages in unmuted chats
2020-02-03 12:56:20 +00:00
updateUnreadMessageCount chat_list:ChatList unread_count:int32 unread_unmuted_count:int32 = Update;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used
//@chat_list The chat list with changed number of unread messages
//@total_count Approximate total number of chats in the chat list
2022-12-30 18:28:59 +00:00
//@unread_count Total number of unread chats
//@unread_unmuted_count Total number of unread unmuted chats
//@marked_as_unread_count Total number of chats marked as unread
//@marked_as_unread_unmuted_count Total number of unmuted chats marked as unread
2020-02-03 12:56:20 +00:00
updateUnreadChatCount chat_list:ChatList total_count:int32 unread_count:int32 unread_unmuted_count:int32 marked_as_unread_count:int32 marked_as_unread_unmuted_count:int32 = Update;
2018-09-05 21:45:29 +00:00
2018-08-30 14:55:42 +00:00
//@description An option changed its value @name The option name @value The new option value
updateOption name:string value:OptionValue = Update;
2020-11-30 09:33:47 +00:00
//@description A sticker set has changed @sticker_set The sticker set
updateStickerSet sticker_set:stickerSet = Update;
2022-08-13 15:24:07 +00:00
//@description The list of installed sticker sets was updated @sticker_type Type of the affected stickers @sticker_set_ids The new list of installed ordinary sticker sets
updateInstalledStickerSets sticker_type:StickerType sticker_set_ids:vector<int64> = Update;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@description The list of trending sticker sets was updated or some of them were viewed @sticker_type Type of the affected stickers @sticker_sets The prefix of the list of trending sticker sets with the newest trending sticker sets
updateTrendingStickerSets sticker_type:StickerType sticker_sets:trendingStickerSets = Update;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@description The list of recently used stickers was updated @is_attached True, if the list of stickers attached to photo or video files was updated; otherwise, the list of sent stickers is updated @sticker_ids The new list of file identifiers of recently used stickers
2018-08-30 14:55:42 +00:00
updateRecentStickers is_attached:Bool sticker_ids:vector<int32> = Update;
//@description The list of favorite stickers was updated @sticker_ids The new list of file identifiers of favorite stickers
updateFavoriteStickers sticker_ids:vector<int32> = Update;
//@description The list of saved animations was updated @animation_ids The new list of file identifiers of saved animations
updateSavedAnimations animation_ids:vector<int32> = Update;
2022-04-24 20:33:39 +00:00
//@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 @notification_sound_ids The new list of identifiers of saved notification sounds
updateSavedNotificationSounds notification_sound_ids:vector<int64> = Update;
2019-09-10 12:36:54 +00:00
//@description The selected background has changed @for_dark_theme True, if background for dark theme has changed @background The new selected background; may be null
updateSelectedBackground for_dark_theme:Bool background:background = Update;
2021-12-30 05:55:02 +00:00
//@description The list of available chat themes has changed @chat_themes The new list of chat themes
updateChatThemes chat_themes:vector<chatTheme> = Update;
2018-09-05 21:45:29 +00:00
//@description Some language pack strings have been updated @localization_target Localization target to which the language pack belongs @language_pack_id Identifier of the updated language pack @strings List of changed language pack strings
updateLanguagePackStrings localization_target:string language_pack_id:string strings:vector<languagePackString> = Update;
2020-11-30 09:33:47 +00:00
//@description The connection state has changed. This update must be used only to show a human-readable description of the connection state @state The new connection state
2018-08-30 14:55:42 +00:00
updateConnectionState state:ConnectionState = Update;
2021-12-30 05:55:02 +00:00
//@description New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update" @terms_of_service_id Identifier of the terms of service @terms_of_service The new terms of service
2018-09-05 21:45:29 +00:00
updateTermsOfService terms_of_service_id:string terms_of_service:termsOfService = Update;
2020-11-30 09:33:47 +00:00
//@description The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request @users_nearby The new list of users nearby
2020-02-03 12:56:20 +00:00
updateUsersNearby users_nearby:vector<chatNearby> = Update;
2022-06-21 18:10:07 +00:00
//@description The list of bots added to attachment menu has changed @bots The new list of bots added to attachment menu. The bots must not be shown on scheduled messages screen
2022-04-24 20:33:39 +00:00
updateAttachmentMenuBots bots:vector<attachmentMenuBot> = Update;
2022-06-21 18:10:07 +00:00
//@description A message was sent by an opened Web App, so the Web App needs to be closed @web_app_launch_id Identifier of Web App launch
2022-04-24 20:33:39 +00:00
updateWebAppMessageSent web_app_launch_id:int64 = Update;
2022-09-18 01:34:29 +00:00
//@description The list of active emoji reactions has changed @emojis The new list of active emoji reactions
updateActiveEmojiReactions emojis:vector<string> = Update;
//@description The type of default reaction has changed @reaction_type The new type of the default reaction
updateDefaultReactionType reaction_type:ReactionType = Update;
2022-02-06 18:36:17 +00:00
2020-11-30 09:33:47 +00:00
//@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis
updateDiceEmojis emojis:vector<string> = Update;
2021-12-30 05:55:02 +00:00
//@description Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@message_id Message identifier
//@sticker The animated sticker to be played
2021-12-30 05:55:02 +00:00
updateAnimatedEmojiMessageClicked chat_id:int53 message_id:int53 sticker:sticker = Update;
2022-12-07 20:04:16 +00:00
//@description The parameters of animation search through getOption("animation_search_bot_username") bot has changed @provider Name of the animation search provider @emojis The new list of emojis suggested for searching
2020-11-30 09:33:47 +00:00
updateAnimationSearchParameters provider:string emojis:vector<string> = Update;
//@description The list of suggested to the user actions has changed @added_actions Added suggested actions @removed_actions Removed suggested actions
updateSuggestedActions added_actions:vector<SuggestedAction> removed_actions:vector<SuggestedAction> = Update;
2023-02-04 22:54:46 +00:00
//@description Autosave settings for some type of chats were updated @scope Type of chats for which autosave settings were updated @settings The new autosave settings; may be null if the settings are reset to default
updateAutosaveSettings scope:AutosaveSettingsScope settings:scopeAutosaveSettings = Update;
2022-12-30 18:28:59 +00:00
//@description A new incoming inline query; for bots only
//@id Unique query identifier
//@sender_user_id Identifier of the user who sent the query
//@user_location User location; may be null
//@chat_type The type of the chat from which the query originated; may be null if unknown
//@query Text of the query
//@offset Offset of the first entry to return
2021-12-30 05:55:02 +00:00
updateNewInlineQuery id:int64 sender_user_id:int53 user_location:location chat_type:ChatType query:string offset:string = Update;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description The user has chosen a result of an inline query; for bots only
//@sender_user_id Identifier of the user who sent the query
//@user_location User location; may be null
//@query Text of the query
//@result_id Identifier of the chosen result
//@inline_message_id Identifier of the sent inline message, if known
2021-12-30 05:55:02 +00:00
updateNewChosenInlineResult sender_user_id:int53 user_location:location query:string result_id:string inline_message_id:string = Update;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A new incoming callback query; for bots only
//@id Unique query identifier
//@sender_user_id Identifier of the user who sent the query
//@chat_id Identifier of the chat where the query was sent
//@message_id Identifier of the message from which the query originated
//@chat_instance Identifier that uniquely corresponds to the chat to which the message was sent
//@payload Query payload
2021-12-30 05:55:02 +00:00
updateNewCallbackQuery id:int64 sender_user_id:int53 chat_id:int53 message_id:int53 chat_instance:int64 payload:CallbackQueryPayload = Update;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A new incoming callback query from a message sent via a bot; for bots only
//@id Unique query identifier
//@sender_user_id Identifier of the user who sent the query
//@inline_message_id Identifier of the inline message from which the query originated
//@chat_instance An identifier uniquely corresponding to the chat a message was sent to
//@payload Query payload
2021-12-30 05:55:02 +00:00
updateNewInlineCallbackQuery id:int64 sender_user_id:int53 inline_message_id:string chat_instance:int64 payload:CallbackQueryPayload = Update;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A new incoming shipping query; for bots only. Only for invoices with flexible price
//@id Unique query identifier
//@sender_user_id Identifier of the user who sent the query
//@invoice_payload Invoice payload
//@shipping_address User shipping address
2021-12-30 05:55:02 +00:00
updateNewShippingQuery id:int64 sender_user_id:int53 invoice_payload:string shipping_address:address = Update;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description A new incoming pre-checkout query; for bots only. Contains full information about a checkout
//@id Unique query identifier
//@sender_user_id Identifier of the user who sent the query
//@currency Currency for the product price
//@total_amount Total price for the product, in the smallest units of the currency
//@invoice_payload Invoice payload
//@shipping_option_id Identifier of a shipping option chosen by the user; may be empty if not applicable
//@order_info Information about the order; may be null
2021-12-30 05:55:02 +00:00
updateNewPreCheckoutQuery id:int64 sender_user_id:int53 currency:string total_amount:int53 invoice_payload:bytes shipping_option_id:string order_info:orderInfo = Update;
2018-08-30 14:55:42 +00:00
//@description A new incoming event; for bots only @event A JSON-serialized event
updateNewCustomEvent event:string = Update;
//@description A new incoming query; for bots only @id The query identifier @data JSON-serialized query data @timeout Query timeout
updateNewCustomQuery id:int64 data:string timeout:int32 = Update;
2020-02-03 12:56:20 +00:00
//@description A poll was updated; for bots only @poll New data about the poll
2019-06-07 10:56:06 +00:00
updatePoll poll:poll = Update;
2020-02-03 12:56:20 +00:00
//@description A user changed the answer to a poll; for bots only @poll_id Unique poll identifier @user_id The user, who changed the answer to the poll @option_ids 0-based identifiers of answer options, chosen by the user
2021-12-30 05:55:02 +00:00
updatePollAnswer poll_id:int64 user_id:int53 option_ids:vector<int32> = Update;
2022-12-30 18:28:59 +00:00
//@description User rights changed in a chat; for bots only
//@chat_id Chat identifier
//@actor_user_id Identifier of the user, changing the rights
//@date Point in time (Unix timestamp) when the user rights was changed
//@invite_link If user has joined the chat using an invite link, the invite link; may be null
//@old_chat_member Previous chat member
//@new_chat_member New chat member
2021-12-30 05:55:02 +00:00
updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink old_chat_member:chatMember new_chat_member:chatMember = Update;
2023-02-04 22:54:46 +00:00
//@description A user sent a join request to a chat; for bots only
//@chat_id Chat identifier
//@request Join request
//@user_chat_id Chat identifier of the private chat with the user
//@invite_link The invite link, which was used to send join request; may be null
updateNewChatJoinRequest chat_id:int53 request:chatJoinRequest user_chat_id:int53 invite_link:chatInviteLink = Update;
2020-02-03 12:56:20 +00:00
2019-06-07 10:56:06 +00:00
//@description Contains a list of updates @updates List of updates
updates updates:vector<Update> = Updates;
//@class LogStream @description Describes a stream to which TDLib internal log is written
//@description The log is written to stderr or an OS specific log
logStreamDefault = LogStream;
2020-11-30 09:33:47 +00:00
//@description The log is written to a file
//@path Path to the file to where the internal TDLib log will be written
2021-12-30 05:55:02 +00:00
//@max_file_size The maximum size of the file to where the internal TDLib log is written before the file will automatically be rotated, in bytes
2020-11-30 09:33:47 +00:00
//@redirect_stderr Pass true to additionally redirect stderr to the log file. Ignored on Windows
logStreamFile path:string max_file_size:int53 redirect_stderr:Bool = LogStream;
2019-06-07 10:56:06 +00:00
//@description The log is written nowhere
logStreamEmpty = LogStream;
//@description Contains a TDLib internal log verbosity level @verbosity_level Log verbosity level
logVerbosityLevel verbosity_level:int32 = LogVerbosityLevel;
//@description Contains a list of available TDLib internal log tags @tags List of log tags
logTags tags:vector<string> = LogTags;
2018-08-30 14:55:42 +00:00
2022-09-18 01:34:29 +00:00
//@description Contains custom information about the user @message Information message @author Information author @date Information change date
userSupportInfo message:formattedText author:string date:int32 = UserSupportInfo;
2018-08-30 14:55:42 +00:00
//@description A simple object containing a number; for testing only @value Number
testInt value:int32 = TestInt;
//@description A simple object containing a string; for testing only @value String
testString value:string = TestString;
//@description A simple object containing a sequence of bytes; for testing only @value Bytes
testBytes value:bytes = TestBytes;
//@description A simple object containing a vector of numbers; for testing only @value Vector of numbers
testVectorInt value:vector<int32> = TestVectorInt;
//@description A simple object containing a vector of objects that hold a number; for testing only @value Vector of objects
testVectorIntObject value:vector<testInt> = TestVectorIntObject;
//@description A simple object containing a vector of strings; for testing only @value Vector of strings
testVectorString value:vector<string> = TestVectorString;
//@description A simple object containing a vector of objects that hold a string; for testing only @value Vector of objects
testVectorStringObject value:vector<testString> = TestVectorStringObject;
---functions---
2020-11-30 09:33:47 +00:00
//@description Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization
2018-08-30 14:55:42 +00:00
getAuthorizationState = AuthorizationState;
2022-09-18 01:34:29 +00:00
//@description Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters
//@use_test_dc Pass true to use Telegram test environment 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
2023-02-04 22:54:46 +00:00
//@database_encryption_key Encryption key for the database. If the encryption key is invalid, then an error with code 401 will be returned
2022-09-18 01:34:29 +00:00
//@use_file_database Pass true to keep information about downloaded and uploaded files between application restarts
//@use_chat_info_database Pass true to keep cache of users, basic groups, supergroups, channels and secret chats between restarts. Implies use_file_database
//@use_message_database Pass true to keep cache of chats and messages between restarts. Implies use_chat_info_database
//@use_secret_chats Pass true to enable support for secret chats
//@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 Pass true to automatically delete old files in background
//@ignore_file_names 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
setTdlibParameters use_test_dc:Bool database_directory:string files_directory:string database_encryption_key:bytes 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 = Ok;
2018-08-30 14:55:42 +00:00
2019-09-10 12:36:54 +00:00
//@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,
2023-02-04 22:54:46 +00:00
//-or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
2022-12-30 18:28:59 +00:00
//@phone_number The phone number of the user, in international format
//@settings Settings for the authentication of the user's phone number; pass null to use default settings
2019-09-10 12:36:54 +00:00
setAuthenticationPhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = Ok;
2018-08-30 14:55:42 +00:00
2022-09-18 01:34:29 +00:00
//@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 @email_address The email address of the user
setAuthenticationEmailAddress email_address:string = Ok;
2022-12-30 18:28:59 +00:00
//@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
2018-08-30 14:55:42 +00:00
resendAuthenticationCode = Ok;
2022-09-18 01:34:29 +00:00
//@description Checks the authentication of a email address. Works only when the current authorization state is authorizationStateWaitEmailCode @code Email address authentication to check
checkAuthenticationEmailCode code:EmailAddressAuthentication = Ok;
2021-12-30 05:55:02 +00:00
//@description Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode @code Authentication code to check
2019-09-10 12:36:54 +00:00
checkAuthenticationCode code:string = Ok;
2020-11-30 09:33:47 +00:00
//@description Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber,
2023-02-04 22:54:46 +00:00
//-or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
2020-11-30 09:33:47 +00:00
//@other_user_ids List of user identifiers of other users currently using the application
2021-12-30 05:55:02 +00:00
requestQrCodeAuthentication other_user_ids:vector<int53> = Ok;
2020-02-03 12:56:20 +00:00
2019-09-10 12:36:54 +00:00
//@description Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration
2022-12-30 18:28:59 +00:00
//@first_name The first name of the user; 1-64 characters
//@last_name The last name of the user; 0-64 characters
2019-09-10 12:36:54 +00:00
registerUser first_name:string last_name:string = Ok;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@description Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword @password The 2-step verification password to check
2018-08-30 14:55:42 +00:00
checkAuthenticationPassword password:string = Ok;
2022-08-13 15:24:07 +00:00
//@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
2018-08-30 14:55:42 +00:00
requestAuthenticationPasswordRecovery = Ok;
2022-08-13 15:24:07 +00:00
//@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 @recovery_code Recovery code to check
2021-12-30 05:55:02 +00:00
checkAuthenticationPasswordRecoveryCode recovery_code:string = Ok;
2022-08-13 15:24:07 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@recovery_code Recovery code to check
//@new_password New 2-step verification password of the user; may be empty to remove the password
//@new_hint New password hint; may be empty
2021-12-30 05:55:02 +00:00
recoverAuthenticationPassword recovery_code:string new_password:string new_hint:string = Ok;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@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
//@token SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application
sendAuthenticationFirebaseSms token:string = Ok;
2018-08-30 14:55:42 +00:00
//@description Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in @token The bot token
checkAuthenticationBotToken token:string = Ok;
//@description Closes the TDLib instance after a proper logout. Requires an available network connection. All local data will be destroyed. After the logout completes, updateAuthorizationState with authorizationStateClosed will be sent
logOut = Ok;
2020-11-30 09:33:47 +00:00
//@description Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent. Can be called before initialization
2018-08-30 14:55:42 +00:00
close = Ok;
2022-12-30 18:28:59 +00:00
//@description Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed.
//-After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent. Can be called before authorization
2018-08-30 14:55:42 +00:00
destroy = Ok;
2020-02-03 12:56:20 +00:00
//@description Confirms QR code authentication on another device. Returns created session on success @link A link from a QR code. The link must be scanned by the in-app camera
confirmQrCodeAuthentication link:string = Session;
2022-12-07 20:04:16 +00:00
//@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
2019-06-07 10:56:06 +00:00
getCurrentState = Updates;
2018-08-30 14:55:42 +00:00
//@description Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain @new_encryption_key New encryption key
setDatabaseEncryptionKey new_encryption_key:bytes = Ok;
//@description Returns the current state of 2-step verification
getPasswordState = PasswordState;
2022-08-13 15:24:07 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@old_password Previous 2-step verification password of the user
//@new_password New 2-step verification password of the user; may be empty to remove the password
//@new_hint New password hint; may be empty
//@set_recovery_email_address Pass true to change also the recovery email address
//@new_recovery_email_address New recovery email address; may be empty
2018-08-30 14:55:42 +00:00
setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState;
2022-12-30 18:28:59 +00:00
//@description Changes the login email address of the user. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode.
//-To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly
//@new_login_email_address New login email address
2022-09-18 01:34:29 +00:00
setLoginEmailAddress new_login_email_address:string = EmailAddressAuthenticationCodeInfo;
//@description Resends the login email address verification code
resendLoginEmailAddressCode = EmailAddressAuthenticationCodeInfo;
//@description Checks the login email address authentication @code Email address authentication to check
checkLoginEmailAddressCode code:EmailAddressAuthentication = Ok;
2022-08-13 15:24:07 +00:00
//@description Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user @password The 2-step verification password for the current user
2018-08-30 14:55:42 +00:00
getRecoveryEmailAddress password:string = RecoveryEmailAddress;
2019-09-10 12:36:54 +00:00
//@description Changes the 2-step verification recovery email address of the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed.
2022-12-30 18:28:59 +00:00
//-If new_recovery_email_address is the same as the email address that is currently set up, this call succeeds immediately and aborts all other requests waiting for an email confirmation
//@password The 2-step verification password of the current user
//@new_recovery_email_address New recovery email address
2018-08-30 14:55:42 +00:00
setRecoveryEmailAddress password:string new_recovery_email_address:string = PasswordState;
2021-12-30 05:55:02 +00:00
//@description Checks the 2-step verification recovery email address verification code @code Verification code to check
2019-06-07 10:56:06 +00:00
checkRecoveryEmailAddressCode code:string = PasswordState;
//@description Resends the 2-step verification recovery email address verification code
resendRecoveryEmailAddressCode = PasswordState;
2021-12-30 05:55:02 +00:00
//@description Requests to send a 2-step verification password recovery code to an email address that was previously set up
2018-09-05 21:45:29 +00:00
requestPasswordRecovery = EmailAddressAuthenticationCodeInfo;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Checks whether a 2-step verification password recovery code sent to an email address is valid @recovery_code Recovery code to check
checkPasswordRecoveryCode recovery_code:string = Ok;
//@description Recovers the 2-step verification password using a recovery code sent to an email address that was previously set up
2022-12-30 18:28:59 +00:00
//@recovery_code Recovery code to check
//@new_password New 2-step verification password of the user; may be empty to remove the password
//@new_hint New password hint; may be empty
2021-12-30 05:55:02 +00:00
recoverPassword recovery_code:string new_password:string new_hint:string = PasswordState;
//@description Removes 2-step verification password without previous password and access to recovery email address. The password can't be reset immediately and the request needs to be repeated after the specified time
resetPassword = ResetPasswordResult;
//@description Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date > 0
cancelPasswordReset = Ok;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@description Creates a new temporary password for processing payments @password The 2-step verification password of the current user @valid_for Time during which the temporary password will be valid, in seconds; must be between 60 and 86400
2018-08-30 14:55:42 +00:00
createTemporaryPassword password:string valid_for:int32 = TemporaryPasswordState;
//@description Returns information about the current temporary password
getTemporaryPasswordState = TemporaryPasswordState;
//@description Returns the current user
getMe = User;
//@description Returns information about a user by their identifier. This is an offline request if the current user is not a bot @user_id User identifier
2021-12-30 05:55:02 +00:00
getUser user_id:int53 = User;
2018-08-30 14:55:42 +00:00
//@description Returns full information about a user by their identifier @user_id User identifier
2021-12-30 05:55:02 +00:00
getUserFullInfo user_id:int53 = UserFullInfo;
2018-08-30 14:55:42 +00:00
//@description Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot @basic_group_id Basic group identifier
2021-12-30 05:55:02 +00:00
getBasicGroup basic_group_id:int53 = BasicGroup;
2018-08-30 14:55:42 +00:00
//@description Returns full information about a basic group by its identifier @basic_group_id Basic group identifier
2021-12-30 05:55:02 +00:00
getBasicGroupFullInfo basic_group_id:int53 = BasicGroupFullInfo;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot @supergroup_id Supergroup or channel identifier
2021-12-30 05:55:02 +00:00
getSupergroup supergroup_id:int53 = Supergroup;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute @supergroup_id Supergroup or channel identifier
2021-12-30 05:55:02 +00:00
getSupergroupFullInfo supergroup_id:int53 = SupergroupFullInfo;
2018-08-30 14:55:42 +00:00
//@description Returns information about a secret chat by its identifier. This is an offline request @secret_chat_id Secret chat identifier
getSecretChat secret_chat_id:int32 = SecretChat;
//@description Returns information about a chat by its identifier, this is an offline request if the current user is not a bot @chat_id Chat identifier
getChat chat_id:int53 = Chat;
//@description Returns information about a message @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get
getMessage chat_id:int53 message_id:int53 = Message;
2022-03-13 04:04:12 +00:00
//@description Returns information about a message, if it is available without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get
2019-06-07 10:56:06 +00:00
getMessageLocally chat_id:int53 message_id:int53 = Message;
2023-02-04 22:54:46 +00:00
//@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
2022-12-30 18:28:59 +00:00
//-of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively
//@chat_id Identifier of the chat the message belongs to
//@message_id Identifier of the reply message
2018-08-30 14:55:42 +00:00
getRepliedMessage chat_id:int53 message_id:int53 = Message;
2020-11-30 09:33:47 +00:00
//@description Returns information about a newest pinned message in the chat @chat_id Identifier of the chat the message belongs to
2018-08-30 14:55:42 +00:00
getChatPinnedMessage chat_id:int53 = Message;
2020-11-30 09:33:47 +00:00
//@description Returns information about a message with the callback button that originated a callback query; for bots only @chat_id Identifier of the chat the message belongs to @message_id Message identifier @callback_query_id Identifier of the callback query
getCallbackQueryMessage chat_id:int53 message_id:int53 callback_query_id:int64 = Message;
2018-08-30 14:55:42 +00:00
//@description Returns information about messages. If a message is not found, returns null on the corresponding position of the result @chat_id Identifier of the chat the messages belong to @message_ids Identifiers of the messages to get
getMessages chat_id:int53 message_ids:vector<int53> = Messages;
2020-11-30 09:33:47 +00:00
//@description Returns information about a message thread. Can be used only if message.can_get_message_thread == true @chat_id Chat identifier @message_id Identifier of the message
getMessageThread chat_id:int53 message_id:int53 = MessageThreadInfo;
2022-12-30 18:28:59 +00:00
//@description Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true
//@chat_id Chat identifier
//@message_id Identifier of the message
2021-12-30 05:55:02 +00:00
getMessageViewers chat_id:int53 message_id:int53 = Users;
2018-08-30 14:55:42 +00:00
//@description Returns information about a file; this is an offline request @file_id Identifier of the file to get
getFile file_id:int32 = File;
2020-02-03 12:56:20 +00:00
//@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.
2020-11-30 09:33:47 +00:00
//-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
2022-12-30 18:28:59 +00:00
//@remote_file_id Remote identifier of the file to get
//@file_type File type; pass null if unknown
2018-08-30 14:55:42 +00:00
getRemoteFile remote_file_id:string file_type:FileType = File;
2021-12-30 05:55:02 +00:00
//@description Loads more chats from a chat list. The loaded chats and their positions in the chat list will be sent through updates. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. Returns a 404 error if all chats have been loaded
//@chat_list The chat list in which to load chats; pass null to load chats from the main chat list
//@limit The maximum number of chats to be loaded. For optimal performance, the number of loaded chats is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached
loadChats chat_list:ChatList limit:int32 = Ok;
//@description Returns an ordered list of chats from the beginning of a chat list. For informational purposes only. Use loadChats and updates processing instead to maintain chat lists in a consistent state
2022-12-30 18:28:59 +00:00
//@chat_list The chat list in which to return chats; pass null to get chats from the main chat list
//@limit The maximum number of chats to be returned
2021-12-30 05:55:02 +00:00
getChats chat_list:ChatList limit:int32 = Chats;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@description Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise, an error is returned @username Username to be resolved
2018-08-30 14:55:42 +00:00
searchPublicChat username:string = Chat;
2021-12-30 05:55:02 +00:00
//@description Searches public chats by looking for specified query in their username and title. Currently, only private chats, supergroups and channels can be public. Returns a meaningful number of results.
2022-12-30 18:28:59 +00:00
//-Excludes private chats with contacts and chats from the chat list from the results
//@query Query to search for
2018-08-30 14:55:42 +00:00
searchPublicChats query:string = Chats;
2022-12-30 18:28:59 +00:00
//@description Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list
//@query Query to search for. If the query is empty, returns up to 50 recently found chats
//@limit The maximum number of chats to be returned
2018-08-30 14:55:42 +00:00
searchChats query:string limit:int32 = Chats;
2020-11-30 09:33:47 +00:00
//@description Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the main chat list @query Query to search for @limit The maximum number of chats to be returned
2018-08-30 14:55:42 +00:00
searchChatsOnServer query:string limit:int32 = Chats;
2022-12-30 18:28:59 +00:00
//@description Returns a list of users and location-based supergroups nearby. The list of users nearby will be updated for 60 seconds after the request by the updates updateUsersNearby.
//-The request must be sent again every 25 seconds with adjusted location to not miss new chats
//@location Current user location
2020-02-03 12:56:20 +00:00
searchChatsNearby location:location = ChatsNearby;
//@description Returns a list of frequently used chats. Supported only if the chat info database is enabled @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30
2018-08-30 14:55:42 +00:00
getTopChats category:TopChatCategory limit:int32 = Chats;
//@description Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled @category Category of frequently used chats @chat_id Chat identifier
removeTopChat category:TopChatCategory chat_id:int53 = Ok;
//@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 @chat_id Identifier of the chat to add
addRecentlyFoundChat chat_id:int53 = Ok;
//@description Removes a chat from the list of recently found chats @chat_id Identifier of the chat to be removed
removeRecentlyFoundChat chat_id:int53 = Ok;
//@description Clears the list of recently found chats
clearRecentlyFoundChats = Ok;
2021-12-30 05:55:02 +00:00
//@description Returns recently opened chats, this is an offline request. Returns chats in the order of last opening @limit The maximum number of chats to be returned
getRecentlyOpenedChats limit:int32 = Chats;
//@description Checks whether a username can be set for a chat @chat_id Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created @username Username to be checked
2019-06-07 10:56:06 +00:00
checkChatUsername chat_id:int53 username:string = CheckChatUsernameResult;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Returns a list of public chats of the specified type, owned by the user @type Type of the public chats to return
getCreatedPublicChats type:PublicChatType = Chats;
2022-06-21 18:10:07 +00:00
//@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 @type Type of the public chats, for which to check the limit
2020-02-03 12:56:20 +00:00
checkCreatedPublicChatsLimit type:PublicChatType = Ok;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group.
//-To set a returned supergroup as a discussion group, access to its old messages must be enabled using toggleSupergroupIsAllHistoryAvailable first
2020-02-03 12:56:20 +00:00
getSuitableDiscussionChats = Chats;
2018-08-30 14:55:42 +00:00
2022-06-21 18:10:07 +00:00
//@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
2020-02-03 12:56:20 +00:00
getInactiveSupergroupChats = Chats;
2022-12-30 18:28:59 +00:00
//@description Returns a list of common group chats with a given user. Chats are sorted by their type and creation date
//@user_id User identifier
//@offset_chat_id Chat identifier starting from which to return chats; use 0 for the first request
//@limit The maximum number of chats to be returned; up to 100
2021-12-30 05:55:02 +00:00
getGroupsInCommon user_id:int53 offset_chat_id:int53 limit:int32 = Chats;
2018-08-30 14:55:42 +00:00
//@description Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id).
2021-12-30 05:55:02 +00:00
//-For optimal performance, the number of returned messages is chosen by TDLib. This is an offline request if only_local is true
2018-08-30 14:55:42 +00:00
//@chat_id Chat identifier
2018-09-05 21:45:29 +00:00
//@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message
2019-06-07 10:56:06 +00:00
//@offset Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages
2022-12-30 18:28:59 +00:00
//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset.
//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
2022-03-13 04:04:12 +00:00
//@only_local Pass true to get only messages that are available without sending network requests
2018-08-30 14:55:42 +00:00
getChatHistory chat_id:int53 from_message_id:int53 offset:int32 limit:int32 only_local:Bool = Messages;
2020-11-30 09:33:47 +00:00
//@description Returns messages in a message thread of a message. Can be used only if message.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup.
2021-12-30 05:55:02 +00:00
//-The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib
2020-11-30 09:33:47 +00:00
//@chat_id Chat identifier
//@message_id Message identifier, which thread history needs to be returned
//@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message
//@offset Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages
2022-12-30 18:28:59 +00:00
//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset.
//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
2020-11-30 09:33:47 +00:00
getMessageThreadHistory chat_id:int53 message_id:int53 from_message_id:int53 offset:int32 limit:int32 = Messages;
2021-12-30 05:55:02 +00:00
//@description Deletes all messages in the chat. Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@remove_from_chat_list Pass true to remove the chat from all chat lists
//@revoke Pass true to delete chat history for all users
2019-06-07 10:56:06 +00:00
deleteChatHistory chat_id:int53 remove_from_chat_list:Bool revoke:Bool = Ok;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@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
//@chat_id Chat identifier
2021-12-30 05:55:02 +00:00
deleteChat chat_id:int53 = Ok;
2018-08-30 14:55:42 +00:00
//@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
2022-11-07 18:50:52 +00:00
//-(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
2018-08-30 14:55:42 +00:00
//@chat_id Identifier of the chat in which to search messages
//@query Query to search for
2021-12-30 05:55:02 +00:00
//@sender_id Identifier of the sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats
2018-09-05 21:45:29 +00:00
//@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message
2018-08-30 14:55:42 +00:00
//@offset Specify 0 to get results from exactly the from_message_id or a negative offset to get the specified message and some newer messages
2022-12-30 18:28:59 +00:00
//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset.
//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
2021-12-30 05:55:02 +00:00
//@filter Additional filter for messages to search; pass null to search for all messages
2020-11-30 09:33:47 +00:00
//@message_thread_id If not 0, only messages in the specified thread will be returned; supergroups only
2022-12-30 18:28:59 +00:00
searchChatMessages chat_id:int53 query:string sender_id:MessageSender from_message_id:int53 offset:int32 limit:int32 filter:SearchMessagesFilter message_thread_id:int53 = FoundChatMessages;
2018-08-30 14:55:42 +00:00
//@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)).
2021-12-30 05:55:02 +00:00
//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
//@chat_list Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported
2018-08-30 14:55:42 +00:00
//@query Query to search for
2022-12-30 18:28:59 +00:00
//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
2021-12-30 05:55:02 +00:00
//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
2022-02-06 18:36:17 +00:00
//@filter 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
2020-11-30 09:33:47 +00:00
//@min_date If not 0, the minimum date of the messages to return
//@max_date If not 0, the maximum date of the messages to return
2022-12-30 18:28:59 +00:00
searchMessages chat_list:ChatList query:string offset:string limit:int32 filter:SearchMessagesFilter min_date:int32 max_date:int32 = FoundMessages;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib
2020-11-30 09:33:47 +00:00
//@chat_id Identifier of the chat in which to search. Specify 0 to search in all secret chats
2021-12-30 05:55:02 +00:00
//@query Query to search for. If empty, searchChatMessages must be used instead
2022-02-06 18:36:17 +00:00
//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
2021-12-30 05:55:02 +00:00
//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
//@filter Additional filter for messages to search; pass null to search for all messages
2020-11-30 09:33:47 +00:00
searchSecretMessages chat_id:int53 query:string offset:string limit:int32 filter:SearchMessagesFilter = FoundMessages;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
2022-03-13 04:04:12 +00:00
//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
//@only_missed Pass true to search only for messages with missed/declined calls
2022-12-30 18:28:59 +00:00
searchCallMessages offset:string limit:int32 only_missed:Bool = FoundMessages;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order
//@query Query to search for in document file name and message caption
//@limit The maximum number of messages to be returned; up to 100
searchOutgoingDocumentMessages query:string limit:int32 = FoundMessages;
2021-12-30 05:55:02 +00:00
//@description Deletes all call messages @revoke Pass true to delete the messages for all users
deleteAllCallMessages revoke:Bool = Ok;
2020-02-03 12:56:20 +00:00
//@description Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user @chat_id Chat identifier @limit The maximum number of messages to be returned
2018-08-30 14:55:42 +00:00
searchChatRecentLocationMessages chat_id:int53 limit:int32 = Messages;
2021-12-30 05:55:02 +00:00
//@description Returns all active live locations that need to be updated by the application. The list is persistent across application restarts only if the message database is used
2018-08-30 14:55:42 +00:00
getActiveLiveLocationMessages = Messages;
//@description Returns the last message sent in a chat no later than the specified date @chat_id Chat identifier @date Point in time (Unix timestamp) relative to which to search for messages
getChatMessageByDate chat_id:int53 date:int32 = Message;
2021-12-30 05:55:02 +00:00
//@description Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id).
//-Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database
//@chat_id Identifier of the chat in which to return information about message positions
2022-02-06 18:36:17 +00:00
//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function
2021-12-30 05:55:02 +00:00
//@from_message_id The message identifier from which to return information about message positions
//@limit The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages
getChatSparseMessagePositions chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 limit:int32 = MessagePositions;
//@description Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset"
//@chat_id Identifier of the chat in which to return information about messages
2022-02-06 18:36:17 +00:00
//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function
2021-12-30 05:55:02 +00:00
//@from_message_id The message identifier from which to return information about messages; use 0 to get results from the last message
getChatMessageCalendar chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 = MessageCalendar;
2022-12-30 18:28:59 +00:00
//@description Returns approximate number of messages of the specified type in the chat
//@chat_id Identifier of the chat in which to count messages
//@filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function
//@return_local Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally
2018-09-05 21:45:29 +00:00
getChatMessageCount chat_id:int53 filter:SearchMessagesFilter return_local:Bool = Count;
2022-11-07 18:50:52 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@chat_id Identifier of the chat in which to find message position
//@message_id Message identifier
2022-11-07 18:50:52 +00:00
//@filter Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function
//@message_thread_id If not 0, only messages in the specified thread will be considered; supergroups only
getChatMessagePosition chat_id:int53 message_id:int53 filter:SearchMessagesFilter message_thread_id:int53 = Count;
2020-02-03 12:56:20 +00:00
//@description Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier
getChatScheduledMessages chat_id:int53 = Messages;
2021-12-30 05:55:02 +00:00
//@description Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib
2020-11-30 09:33:47 +00:00
//@chat_id Chat identifier of the message
//@message_id Message identifier
2022-02-06 18:36:17 +00:00
//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
2021-12-30 05:55:02 +00:00
//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
2020-11-30 09:33:47 +00:00
getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages;
2022-11-07 18:50:52 +00:00
//@description Returns sponsored messages to be shown in a chat; for channel chats only @chat_id Identifier of the chat
getChatSponsoredMessages chat_id:int53 = SponsoredMessages;
2021-12-30 05:55:02 +00:00
2018-08-30 14:55:42 +00:00
2019-06-07 10:56:06 +00:00
//@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification
removeNotification notification_group_id:int32 notification_id:int32 = Ok;
2020-02-03 12:56:20 +00:00
//@description Removes a group of active notifications. Needs to be called only if the notification group is removed by the current user @notification_group_id Notification group identifier @max_notification_id The maximum identifier of removed notifications
2019-06-07 10:56:06 +00:00
removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = Ok;
2021-12-30 05:55:02 +00:00
//@description Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request
2018-08-30 14:55:42 +00:00
//@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message
2021-12-30 05:55:02 +00:00
//@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview
2020-11-30 09:33:47 +00:00
//@for_album Pass true to create a link for the whole media album
2022-11-07 18:50:52 +00:00
//@in_message_thread Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic
getMessageLink chat_id:int53 message_id:int53 media_timestamp:int32 for_album:Bool in_message_thread:Bool = MessageLink;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username
2019-06-07 10:56:06 +00:00
//@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message
2020-11-30 09:33:47 +00:00
//@for_album Pass true to return an HTML code for embedding of the whole media album
getMessageEmbeddingCode chat_id:int53 message_id:int53 for_album:Bool = Text;
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
//@description Returns information about a public or private message link. Can be called for any internal link of the type internalLinkTypeMessage @url The message link
2019-09-10 12:36:54 +00:00
getMessageLinkInfo url:string = MessageLinkInfo;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@description Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved
2022-02-06 18:36:17 +00:00
//@text Text to translate
2023-02-04 22:54:46 +00:00
//@to_language_code ISO 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"
translateText text:formattedText to_language_code:string = FormattedText;
//@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
//@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message
//@to_language_code ISO 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"
translateMessageText chat_id:int53 message_id:int53 to_language_code:string = FormattedText;
2022-02-06 18:36:17 +00:00
2022-11-07 18:50:52 +00:00
//@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
2022-06-21 18:10:07 +00:00
//@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message
recognizeSpeech chat_id:int53 message_id:int53 = Ok;
2022-11-07 18:50:52 +00:00
//@description Rates recognized speech in a video note or a voice note message @chat_id Identifier of the chat to which the message belongs @message_id Identifier of the message @is_good Pass true if the speech recognition is good
2022-06-21 18:10:07 +00:00
rateSpeechRecognition chat_id:int53 message_id:int53 is_good:Bool = Ok;
2022-02-06 18:36:17 +00:00
2021-12-30 05:55:02 +00:00
//@description Returns list of message sender identifiers, which can be used to send messages in a chat @chat_id Chat identifier
2022-11-07 18:50:52 +00:00
getChatAvailableMessageSenders chat_id:int53 = ChatMessageSenders;
2021-12-30 05:55:02 +00:00
//@description Selects a message sender to send messages in a chat @chat_id Chat identifier @message_sender_id New message sender for the chat
setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok;
2020-02-03 12:56:20 +00:00
//@description Sends a message. Returns the sent message
2020-11-30 09:33:47 +00:00
//@chat_id Target chat
//@message_thread_id If not 0, a message thread identifier in which the message will be sent
2022-04-24 20:33:39 +00:00
//@reply_to_message_id Identifier of the replied message; 0 if none
2021-12-30 05:55:02 +00:00
//@options Options to be used to send the message; pass null to use default options
//@reply_markup Markup for replying to the message; pass null if none; for bots only
//@input_message_content The content of the message to be sent
2020-11-30 09:33:47 +00:00
sendMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages
2020-11-30 09:33:47 +00:00
//@chat_id Target chat
//@message_thread_id If not 0, a message thread identifier in which the messages will be sent
2022-04-24 20:33:39 +00:00
//@reply_to_message_id Identifier of a replied message; 0 if none
2021-12-30 05:55:02 +00:00
//@options Options to be used to send the messages; pass null to use default options
//@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album
2022-03-13 04:04:12 +00:00
//@only_preview Pass true to get fake messages instead of actually sending them
sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions input_message_contents:vector<InputMessageContent> only_preview:Bool = Messages;
2018-08-30 14:55:42 +00:00
//@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message
2022-12-30 18:28:59 +00:00
//@bot_user_id Identifier of the bot
//@chat_id Identifier of the target chat
//@parameter A hidden parameter sent to the bot for deep linking purposes (https://core.telegram.org/bots#deep-linking)
2021-12-30 05:55:02 +00:00
sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message
2020-11-30 09:33:47 +00:00
//@chat_id Target chat
//@message_thread_id If not 0, a message thread identifier in which the message will be sent
2022-04-24 20:33:39 +00:00
//@reply_to_message_id Identifier of a replied message; 0 if none
2021-12-30 05:55:02 +00:00
//@options Options to be used to send the message; pass null to use default options
//@query_id Identifier of the inline query
//@result_id Identifier of the inline result
2022-12-07 20:04:16 +00:00
//@hide_via_bot 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")
2020-11-30 09:33:47 +00:00
sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message;
2018-08-30 14:55:42 +00:00
//@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message
2021-12-30 05:55:02 +00:00
//@chat_id Identifier of the chat to which to forward messages
2022-11-07 18:50:52 +00:00
//@message_thread_id If not 0, a message thread identifier in which the message will be sent; for forum threads only
2021-12-30 05:55:02 +00:00
//@from_chat_id Identifier of the chat from which to forward messages
//@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously
//@options Options to be used to send the messages; pass null to use default options
2022-03-13 04:04:12 +00:00
//@send_copy 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
//@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false
//@only_preview Pass true to get fake messages instead of actually forwarding them
2022-11-07 18:50:52 +00:00
forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector<int53> options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages;
2019-09-10 12:36:54 +00:00
//@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed.
//-If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message
2022-12-30 18:28:59 +00:00
//@chat_id Identifier of the chat to send messages
//@message_ids Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order
2019-09-10 12:36:54 +00:00
resendMessages chat_id:int53 message_ids:vector<int53> = Messages;
2018-08-30 14:55:42 +00:00
//@description Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Chat identifier
sendChatScreenshotTakenNotification chat_id:int53 = Ok;
2020-11-30 09:33:47 +00:00
//@description Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message
//@chat_id Target chat
2021-12-30 05:55:02 +00:00
//@sender_id Identifier of the sender of the message
2022-04-24 20:33:39 +00:00
//@reply_to_message_id Identifier of the replied message; 0 if none
2020-11-30 09:33:47 +00:00
//@disable_notification Pass true to disable notification for the message
//@input_message_content The content of the message to be added
2021-12-30 05:55:02 +00:00
addLocalMessage chat_id:int53 sender_id:MessageSender reply_to_message_id:int53 disable_notification:Bool input_message_content:InputMessageContent = Message;
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
//@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of the messages to be deleted @revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats
2018-08-30 14:55:42 +00:00
deleteMessages chat_id:int53 message_ids:vector<int53> revoke:Bool = Ok;
2021-12-30 05:55:02 +00:00
//@description Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges @chat_id Chat identifier @sender_id Identifier of the sender of messages to delete
deleteChatMessagesBySender chat_id:int53 sender_id:MessageSender = Ok;
//@description Deletes all messages between the specified dates in a chat. Supported only for private chats and basic groups. Messages sent in the last 30 seconds will not be deleted
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@min_date The minimum date of the messages to delete
//@max_date The maximum date of the messages to delete
//@revoke Pass true to delete chat messages for all users; private chats only
2021-12-30 05:55:02 +00:00
deleteChatMessagesByDate chat_id:int53 min_date:int32 max_date:int32 revoke:Bool = Ok;
2018-08-30 14:55:42 +00:00
2018-09-05 21:45:29 +00:00
//@description Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side
2021-12-30 05:55:02 +00:00
//@chat_id The chat the message belongs to
//@message_id Identifier of the message
//@reply_markup The new message reply markup; pass null if none; for bots only
//@input_message_content New text content of the message. Must be of type inputMessageText
2018-08-30 14:55:42 +00:00
editMessageText chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message;
2018-09-05 21:45:29 +00:00
//@description Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side
2021-12-30 05:55:02 +00:00
//@chat_id The chat the message belongs to
//@message_id Identifier of the message
//@reply_markup The new message reply markup; pass null if none; for bots only
//@location New location content of the message; pass null to stop sharing the live location
2020-11-30 09:33:47 +00:00
//@heading The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown
//@proximity_alert_radius The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled
editMessageLiveLocation chat_id:int53 message_id:int53 reply_markup:ReplyMarkup location:location heading:int32 proximity_alert_radius:int32 = Message;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Edits the content of a message with an animation, an audio, a document, a photo or a video, including message caption. If only the caption needs to be edited, use editMessageCaption instead.
//-The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. Returns the edited message after the edit is completed on the server side
//@chat_id The chat the message belongs to
//@message_id Identifier of the message
//@reply_markup The new message reply markup; pass null if none; for bots only
//@input_message_content New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo
2018-09-05 21:45:29 +00:00
editMessageMedia chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message;
//@description Edits the message content caption. Returns the edited message after the edit is completed on the server side
2021-12-30 05:55:02 +00:00
//@chat_id The chat the message belongs to
//@message_id Identifier of the message
//@reply_markup The new message reply markup; pass null if none; for bots only
2022-12-07 20:04:16 +00:00
//@caption New message content caption; 0-getOption("message_caption_length_max") characters; pass null to remove caption
2018-08-30 14:55:42 +00:00
editMessageCaption chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText = Message;
2018-09-05 21:45:29 +00:00
//@description Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side
2021-12-30 05:55:02 +00:00
//@chat_id The chat the message belongs to
//@message_id Identifier of the message
//@reply_markup The new message reply markup; pass null if none
2018-08-30 14:55:42 +00:00
editMessageReplyMarkup chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Message;
2021-12-30 05:55:02 +00:00
//@description Edits the text of an inline text or game message sent via a bot; for bots only
//@inline_message_id Inline message identifier
//@reply_markup The new message reply markup; pass null if none
//@input_message_content New text content of the message. Must be of type inputMessageText
2018-08-30 14:55:42 +00:00
editInlineMessageText inline_message_id:string reply_markup:ReplyMarkup input_message_content:InputMessageContent = Ok;
2021-12-30 05:55:02 +00:00
//@description Edits the content of a live location in an inline message sent via a bot; for bots only
//@inline_message_id Inline message identifier
//@reply_markup The new message reply markup; pass null if none
//@location New location content of the message; pass null to stop sharing the live location
2020-11-30 09:33:47 +00:00
//@heading The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown
//@proximity_alert_radius The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled
editInlineMessageLiveLocation inline_message_id:string reply_markup:ReplyMarkup location:location heading:int32 proximity_alert_radius:int32 = Ok;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only
//@inline_message_id Inline message identifier
//@reply_markup The new message reply markup; pass null if none; for bots only
//@input_message_content New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo
2018-09-05 21:45:29 +00:00
editInlineMessageMedia inline_message_id:string reply_markup:ReplyMarkup input_message_content:InputMessageContent = Ok;
2021-12-30 05:55:02 +00:00
//@description Edits the caption of an inline message sent via a bot; for bots only
//@inline_message_id Inline message identifier
//@reply_markup The new message reply markup; pass null if none
2022-12-07 20:04:16 +00:00
//@caption New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters
2018-08-30 14:55:42 +00:00
editInlineMessageCaption inline_message_id:string reply_markup:ReplyMarkup caption:formattedText = Ok;
2021-12-30 05:55:02 +00:00
//@description Edits the reply markup of an inline message sent via a bot; for bots only
//@inline_message_id Inline message identifier
//@reply_markup The new message reply markup; pass null if none
2018-08-30 14:55:42 +00:00
editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = Ok;
2021-12-30 05:55:02 +00:00
//@description Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed
//@chat_id The chat the message belongs to
//@message_id Identifier of the message
//@scheduling_state The new message scheduling state; pass null to send the message immediately
2020-02-03 12:56:20 +00:00
editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok;
2018-08-30 14:55:42 +00:00
2022-11-07 18:50:52 +00:00
//@description Returns list of custom emojis, which can be used as forum topic icon by all users
getForumTopicDefaultIcons = Stickers;
//@description Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup
//@chat_id Identifier of the chat
//@name Name of the topic; 1-128 characters
//@icon 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
createForumTopic chat_id:int53 name:string icon:forumTopicIcon = ForumTopicInfo;
2022-12-30 18:28:59 +00:00
//@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
2022-11-07 18:50:52 +00:00
//@chat_id Identifier of the chat
//@message_thread_id Message thread identifier of the forum topic
2022-12-07 20:04:16 +00:00
//@name New name of the topic; 0-128 characters. If empty, the previous topic name is kept
//@edit_icon_custom_emoji Pass true to edit the icon of the topic. Icon of the General topic can't be edited
//@icon_custom_emoji_id 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
editForumTopic chat_id:int53 message_thread_id:int53 name:string edit_icon_custom_emoji:Bool icon_custom_emoji_id:int64 = Ok;
//@description Returns information about a forum topic @chat_id Identifier of the chat @message_thread_id Message thread identifier of the forum topic
getForumTopic chat_id:int53 message_thread_id:int53 = ForumTopic;
//@description Returns an HTTPS link to a topic in a forum chat. This is an offline request @chat_id Identifier of the chat @message_thread_id Message thread identifier of the forum topic
2022-12-30 18:28:59 +00:00
getForumTopicLink chat_id:int53 message_thread_id:int53 = MessageLink;
2022-12-07 20:04:16 +00:00
//@description Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server
//@chat_id Identifier of the forum chat
//@query Query to search for in the forum topic's name
//@offset_date 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
//@offset_message_id The message identifier of the last message in the last found topic, or 0 for the first request
//@offset_message_thread_id The message thread identifier of the last found topic, or 0 for the first request
//@limit 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
getForumTopics chat_id:int53 query:string offset_date:int32 offset_message_id:int53 offset_message_thread_id:int53 limit:int32 = ForumTopics;
//@description Changes the notification settings of a forum topic
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@message_thread_id Message thread identifier of the forum topic
//@notification_settings New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever
2022-12-07 20:04:16 +00:00
setForumTopicNotificationSettings chat_id:int53 message_thread_id:int53 notification_settings:chatNotificationSettings = Ok;
2022-11-07 18:50:52 +00:00
2022-12-30 18:28:59 +00:00
//@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
2022-11-07 18:50:52 +00:00
//@chat_id Identifier of the chat
//@message_thread_id Message thread identifier of the forum topic
//@is_closed Pass true to close the topic; pass false to reopen it
toggleForumTopicIsClosed chat_id:int53 message_thread_id:int53 is_closed:Bool = Ok;
2022-12-30 18:28:59 +00:00
//@description Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup
2022-12-07 20:04:16 +00:00
//@chat_id Identifier of the chat
//@is_hidden Pass true to hide and close the General topic; pass false to unhide it
toggleGeneralForumTopicIsHidden chat_id:int53 is_hidden:Bool = Ok;
2022-12-30 18:28:59 +00:00
//@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
//@chat_id Chat identifier
//@message_thread_id Message thread identifier of the forum topic
//@is_pinned Pass true to pin the topic; pass false to unpin it
toggleForumTopicIsPinned chat_id:int53 message_thread_id:int53 is_pinned:Bool = Ok;
//@description Changes the order of pinned forum topics @chat_id Chat identifier @message_thread_ids The new list of pinned forum topics
setPinnedForumTopics chat_id:int53 message_thread_ids:vector<int53> = Ok;
//@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
2022-11-07 18:50:52 +00:00
//@chat_id Identifier of the chat
//@message_thread_id Message thread identifier of the forum topic
deleteForumTopic chat_id:int53 message_thread_id:int53 = Ok;
2022-09-18 01:34:29 +00:00
//@description Returns information about a emoji reaction. Returns a 404 error if the reaction is not found @emoji Text representation of the reaction
getEmojiReaction emoji:string = EmojiReaction;
2022-11-07 18:50:52 +00:00
//@description Returns TGS stickers with generic animations for custom emoji reactions
getCustomEmojiReactionAnimations = Stickers;
2022-09-18 01:34:29 +00:00
//@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
2022-02-06 18:36:17 +00:00
//@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message
2022-09-18 01:34:29 +00:00
//@row_size Number of reaction per row, 5-25
getMessageAvailableReactions chat_id:int53 message_id:int53 row_size:int32 = AvailableReactions;
//@description Clears the list of recently used reactions
clearRecentReactions = Ok;
2022-02-06 18:36:17 +00:00
2022-09-18 01:34:29 +00:00
//@description Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message
2022-02-06 18:36:17 +00:00
//@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message
2022-09-18 01:34:29 +00:00
//@reaction_type Type of the reaction to add
2022-03-13 04:04:12 +00:00
//@is_big Pass true if the reaction is added with a big animation
2022-09-18 01:34:29 +00:00
//@update_recent_reactions Pass true if the reaction needs to be added to recent reactions
addMessageReaction chat_id:int53 message_id:int53 reaction_type:ReactionType is_big:Bool update_recent_reactions:Bool = Ok;
//@description Removes a reaction from a message. A chosen reaction can always be removed
//@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message
//@reaction_type Type of the reaction to remove
removeMessageReaction chat_id:int53 message_id:int53 reaction_type:ReactionType = Ok;
2022-02-06 18:36:17 +00:00
//@description Returns reactions added for a message, along with their sender
//@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message
2022-09-18 01:34:29 +00:00
//@reaction_type Type of the reactions to return; pass null to return all added reactions
2022-02-06 18:36:17 +00:00
//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
//@limit The maximum number of reactions to be returned; must be positive and can't be greater than 100
2022-09-18 01:34:29 +00:00
getMessageAddedReactions chat_id:int53 message_id:int53 reaction_type:ReactionType offset:string limit:int32 = AddedReactions;
//@description Changes type of default reaction for the current user @reaction_type New type of the default reaction
setDefaultReactionType reaction_type:ReactionType = Ok;
2022-02-06 18:36:17 +00:00
2022-11-07 18:50:52 +00:00
//@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously @text The text in which to look for entites
2018-08-30 14:55:42 +00:00
getTextEntities text:string = TextEntities;
2022-11-07 18:50:52 +00:00
//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously @text The text to parse @parse_mode Text parse mode
2018-08-30 14:55:42 +00:00
parseTextEntities text:string parse_mode:TextParseMode = FormattedText;
2020-11-30 09:33:47 +00:00
//@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously
2022-01-26 21:05:08 +00:00
//@text The text to parse. For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**"
2020-11-30 09:33:47 +00:00
parseMarkdown text:formattedText = FormattedText;
//@description Replaces text entities with Markdown formatting in a human-friendly format. Entities that can't be represented in Markdown unambiguously are kept as is. Can be called synchronously @text The text
getMarkdownText text:formattedText = FormattedText;
//@description Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously @file_name The name of the file or path to the file
2018-08-30 14:55:42 +00:00
getFileMimeType file_name:string = Text;
2020-11-30 09:33:47 +00:00
//@description Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously @mime_type The MIME type of the file
2018-08-30 14:55:42 +00:00
getFileExtension mime_type:string = Text;
2020-11-30 09:33:47 +00:00
//@description Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. Can be called synchronously @file_name File name or path to the file
2018-09-05 21:45:29 +00:00
cleanFileName file_name:string = Text;
2020-11-30 09:33:47 +00:00
//@description Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. Can be called synchronously
2022-12-30 18:28:59 +00:00
//@language_pack_database_path Path to the language pack database in which strings are stored
//@localization_target Localization target to which the language pack belongs
//@language_pack_id Language pack identifier
//@key Language pack key of the string to be returned
2018-09-05 21:45:29 +00:00
getLanguagePackString language_pack_database_path:string localization_target:string language_pack_id:string key:string = LanguagePackStringValue;
2020-11-30 09:33:47 +00:00
//@description Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously @json The JSON-serialized string
2019-06-07 10:56:06 +00:00
getJsonValue json:string = JsonValue;
2020-11-30 09:33:47 +00:00
//@description Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously @json_value The JsonValue object
2019-06-07 10:56:06 +00:00
getJsonString json_value:JsonValue = Text;
2022-04-24 20:33:39 +00:00
//@description Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously @theme Theme parameters to convert to JSON
getThemeParametersJsonString theme:themeParameters = Text;
2019-06-07 10:56:06 +00:00
2020-02-03 12:56:20 +00:00
//@description Changes the user answer to a poll. A poll in quiz mode can be answered only once
2022-02-06 18:36:17 +00:00
//@chat_id Identifier of the chat to which the poll belongs
//@message_id Identifier of the message containing the poll
2020-02-03 12:56:20 +00:00
//@option_ids 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers
2019-06-07 10:56:06 +00:00
setPollAnswer chat_id:int53 message_id:int53 option_ids:vector<int32> = Ok;
2021-12-30 05:55:02 +00:00
//@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
2022-02-06 18:36:17 +00:00
//@chat_id Identifier of the chat to which the poll belongs
//@message_id Identifier of the message containing the poll
2020-02-03 12:56:20 +00:00
//@option_id 0-based identifier of the answer option
//@offset Number of users to skip in the result; must be non-negative
2021-12-30 05:55:02 +00:00
//@limit The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached
2020-02-03 12:56:20 +00:00
getPollVoters chat_id:int53 message_id:int53 option_id:int32 offset:int32 limit:int32 = Users;
2019-06-07 10:56:06 +00:00
//@description Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set
2021-12-30 05:55:02 +00:00
//@chat_id Identifier of the chat to which the poll belongs
//@message_id Identifier of the message containing the poll
//@reply_markup The new message reply markup; pass null if none; for bots only
2019-06-07 10:56:06 +00:00
stopPoll chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Ok;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Hides a suggested action @action Suggested action to hide
hideSuggestedAction action:SuggestedAction = Ok;
2020-02-03 12:56:20 +00:00
//@description Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier of the message with the button
//@message_id Message identifier of the message with the button
//@button_id Button identifier
2021-12-30 05:55:02 +00:00
getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int53 = LoginUrlInfo;
2020-02-03 12:56:20 +00:00
//@description Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl.
//-Use the method getLoginUrlInfo to find whether a prior user confirmation is needed. If an error is returned, then the button must be handled as an ordinary URL button
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier of the message with the button
//@message_id Message identifier of the message with the button
//@button_id Button identifier
2022-03-13 04:04:12 +00:00
//@allow_write_access Pass true to allow the bot to send messages to the current user
2021-12-30 05:55:02 +00:00
getLoginUrl chat_id:int53 message_id:int53 button_id:int53 allow_write_access:Bool = HttpUrl;
2023-02-04 22:54:46 +00:00
//@description Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot
//@chat_id Identifier of the chat with the bot
//@message_id Identifier of the message with the button
//@button_id Identifier of the button
//@shared_user_id Identifier of the shared user
//@only_check Pass true to check that the user can be shared by the button instead of actually sharing them
shareUserWithBot chat_id:int53 message_id:int53 button_id:int32 shared_user_id:int53 only_check:Bool = Ok;
//@description Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot
//@chat_id Identifier of the chat with the bot
//@message_id Identifier of the message with the button
//@button_id Identifier of the button
//@shared_chat_id Identifier of the shared chat
//@only_check 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
shareChatWithBot chat_id:int53 message_id:int53 button_id:int32 shared_chat_id:int53 only_check:Bool = Ok;
2021-12-30 05:55:02 +00:00
//@description Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires
//@bot_user_id The identifier of the target bot
//@chat_id Identifier of the chat where the query was sent
//@user_location Location of the user; pass null if unknown or the bot doesn't need user's location
//@query Text of the query
//@offset Offset of the first entry to return
getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location query:string offset:string = InlineQueryResults;
//@description Sets the result of an inline query; for bots only
//@inline_query_id Identifier of the inline query
2022-03-13 04:04:12 +00:00
//@is_personal 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
2021-12-30 05:55:02 +00:00
//@results The results of the query
//@cache_time Allowed time to cache the results of the query, in seconds
//@next_offset Offset for the next inline query; pass an empty string if there are no more results
//@switch_pm_text If non-empty, this text must be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter
//@switch_pm_parameter The parameter for the bot start message
2018-08-30 14:55:42 +00:00
answerInlineQuery inline_query_id:int64 is_personal:Bool results:vector<InputInlineQueryResult> cache_time:int32 next_offset:string switch_pm_text:string switch_pm_parameter:string = Ok;
2022-06-21 18:10:07 +00:00
//@description Returns an HTTPS URL of a Web App to open after keyboardButtonTypeWebApp button is pressed
2022-04-24 20:33:39 +00:00
//@bot_user_id Identifier of the target bot
//@url The URL from the keyboardButtonTypeWebApp button
2022-06-21 18:10:07 +00:00
//@theme Preferred Web App theme; pass null to use the default theme
2022-09-18 01:34:29 +00:00
//@application_name Short name of the application; 0-64 English letters, digits, and underscores
getWebAppUrl bot_user_id:int53 url:string theme:themeParameters application_name:string = HttpUrl;
2022-04-24 20:33:39 +00:00
2022-06-21 18:10:07 +00:00
//@description Sends data received from a keyboardButtonTypeWebApp Web App to a bot
2022-12-30 18:28:59 +00:00
//@bot_user_id Identifier of the target bot
//@button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App
//@data Received data
2022-04-24 20:33:39 +00:00
sendWebAppData bot_user_id:int53 button_text:string data:string = Ok;
2022-06-21 18:10:07 +00:00
//@description Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button.
2022-04-24 20:33:39 +00:00
//-For each bot, a confirmation alert about data sent to the bot must be shown once
2022-06-21 18:10:07 +00:00
//@chat_id Identifier of the chat in which the Web App is opened
//@bot_user_id Identifier of the bot, providing the Web App
2022-04-24 20:33:39 +00:00
//@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise
2022-06-21 18:10:07 +00:00
//@theme Preferred Web App theme; pass null to use the default theme
2022-09-18 01:34:29 +00:00
//@application_name Short name of the application; 0-64 English letters, digits, and underscores
2022-11-07 18:50:52 +00:00
//@message_thread_id If not 0, a message thread identifier in which the message will be sent
2022-06-21 18:10:07 +00:00
//@reply_to_message_id Identifier of the replied message for the message sent by the Web App; 0 if none
2022-11-07 18:50:52 +00:00
openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to_message_id:int53 = WebAppInfo;
2022-04-24 20:33:39 +00:00
2022-06-21 18:10:07 +00:00
//@description Informs TDLib that a previously opened Web App was closed @web_app_launch_id Identifier of Web App launch, received from openWebApp
2022-04-24 20:33:39 +00:00
closeWebApp web_app_launch_id:int64 = Ok;
2022-06-21 18:10:07 +00:00
//@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
//@web_app_query_id Identifier of the Web App query
2022-04-24 20:33:39 +00:00
//@result The result of the query
answerWebAppQuery web_app_query_id:string result:InputInlineQueryResult = SentWebAppMessage;
2022-12-30 18:28:59 +00:00
//@description Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires
//@chat_id Identifier of the chat with the message
//@message_id Identifier of the message from which the query originated
//@payload Query payload
2018-08-30 14:55:42 +00:00
getCallbackQueryAnswer chat_id:int53 message_id:int53 payload:CallbackQueryPayload = CallbackQueryAnswer;
2022-12-30 18:28:59 +00:00
//@description Sets the result of a callback query; for bots only
//@callback_query_id Identifier of the callback query
//@text Text of the answer
//@show_alert Pass true to show an alert to the user instead of a toast notification
//@url URL to be opened
//@cache_time Time during which the result of the query can be cached, in seconds
2018-08-30 14:55:42 +00:00
answerCallbackQuery callback_query_id:int64 text:string show_alert:Bool url:string cache_time:int32 = Ok;
//@description Sets the result of a shipping query; for bots only @shipping_query_id Identifier of the shipping query @shipping_options Available shipping options @error_message An error message, empty on success
answerShippingQuery shipping_query_id:int64 shipping_options:vector<shippingOption> error_message:string = Ok;
//@description Sets the result of a pre-checkout query; for bots only @pre_checkout_query_id Identifier of the pre-checkout query @error_message An error message, empty on success
answerPreCheckoutQuery pre_checkout_query_id:int64 error_message:string = Ok;
2022-12-30 18:28:59 +00:00
//@description Updates the game score of the specified user in the game; for bots only
//@chat_id The chat to which the message with the game belongs
//@message_id Identifier of the message
//@edit_message Pass true to edit the game message to include the current scoreboard
//@user_id User identifier
//@score The new score
2018-08-30 14:55:42 +00:00
//@force Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table
2021-12-30 05:55:02 +00:00
setGameScore chat_id:int53 message_id:int53 edit_message:Bool user_id:int53 score:int32 force:Bool = Message;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Updates the game score of the specified user in a game; for bots only
//@inline_message_id Inline message identifier
//@edit_message Pass true to edit the game message to include the current scoreboard
//@user_id User identifier
//@score The new score
2018-08-30 14:55:42 +00:00
//@force Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table
2021-12-30 05:55:02 +00:00
setInlineGameScore inline_message_id:string edit_message:Bool user_id:int53 score:int32 force:Bool = Ok;
2018-08-30 14:55:42 +00:00
//@description Returns the high scores for a game and some part of the high score table in the range of the specified user; for bots only @chat_id The chat that contains the message with the game @message_id Identifier of the message @user_id User identifier
2021-12-30 05:55:02 +00:00
getGameHighScores chat_id:int53 message_id:int53 user_id:int53 = GameHighScores;
2018-08-30 14:55:42 +00:00
//@description Returns game high scores and some part of the high score table in the range of the specified user; for bots only @inline_message_id Inline message identifier @user_id User identifier
2021-12-30 05:55:02 +00:00
getInlineGameHighScores inline_message_id:string user_id:int53 = GameHighScores;
2018-08-30 14:55:42 +00:00
2022-12-07 20:04:16 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@chat_id Chat identifier
2018-08-30 14:55:42 +00:00
//@message_id The message identifier of the used keyboard
deleteChatReplyMarkup chat_id:int53 message_id:int53 = Ok;
2021-12-30 05:55:02 +00:00
//@description Sends a notification about user activity in a chat @chat_id Chat identifier @message_thread_id If not 0, a message thread identifier in which the action was performed @action The action description; pass null to cancel the currently active action
2020-11-30 09:33:47 +00:00
sendChatAction chat_id:int53 message_thread_id:int53 action:ChatAction = Ok;
2018-08-30 14:55:42 +00:00
2019-06-07 10:56:06 +00:00
//@description Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are received only for opened chats) @chat_id Chat identifier
2018-08-30 14:55:42 +00:00
openChat chat_id:int53 = Ok;
2019-06-07 10:56:06 +00:00
//@description Informs TDLib that the chat is closed by the user. Many useful activities depend on the chat being opened or closed @chat_id Chat identifier
2018-08-30 14:55:42 +00:00
closeChat chat_id:int53 = Ok;
2022-12-30 18:28:59 +00:00
//@description Informs TDLib that messages are being viewed by the user. Sponsored messages must be marked as viewed only when the entire text of the message is shown on the screen (excluding the button).
//-Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels)
2020-11-30 09:33:47 +00:00
//@chat_id Chat identifier
//@message_thread_id If not 0, a message thread identifier in which the messages are being viewed
//@message_ids The identifiers of the messages being viewed
2022-03-13 04:04:12 +00:00
//@force_read Pass true to mark as read the specified messages even the chat is closed
2020-11-30 09:33:47 +00:00
viewMessages chat_id:int53 message_thread_id:int53 message_ids:vector<int53> force_read:Bool = Ok;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message).
//-An updateMessageContentOpened update will be generated if something has changed
//@chat_id Chat identifier of the message
//@message_id Identifier of the message with the opened content
2018-08-30 14:55:42 +00:00
openMessageContent chat_id:int53 message_id:int53 = Ok;
2021-12-30 05:55:02 +00:00
//@description Informs TDLib that a message with an animated emoji was clicked by the user. Returns a big animated sticker to be played or a 404 error if usual animation needs to be played @chat_id Chat identifier of the message @message_id Identifier of the clicked message
clickAnimatedEmojiMessage chat_id:int53 message_id:int53 = Sticker;
//@description Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization @link The link
getInternalLinkType link:string = InternalLinkType;
//@description Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if web page preview is disabled in secret chats @link The link
getExternalLinkInfo link:string = LoginUrlInfo;
//@description Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed
2022-12-30 18:28:59 +00:00
//@link The HTTP link
//@allow_write_access Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages
2021-12-30 05:55:02 +00:00
getExternalLink link:string allow_write_access:Bool = HttpUrl;
2018-08-30 14:55:42 +00:00
//@description Marks all mentions in a chat as read @chat_id Chat identifier
readAllChatMentions chat_id:int53 = Ok;
2022-11-07 18:50:52 +00:00
//@description Marks all mentions in a forum topic as read @chat_id Chat identifier @message_thread_id Message thread identifier in which mentions are marked as read
readAllMessageThreadMentions chat_id:int53 message_thread_id:int53 = Ok;
//@description Marks all reactions in a chat or a forum topic as read @chat_id Chat identifier
2022-02-06 18:36:17 +00:00
readAllChatReactions chat_id:int53 = Ok;
2022-11-07 18:50:52 +00:00
//@description Marks all reactions in a forum topic as read @chat_id Chat identifier @message_thread_id Message thread identifier in which reactions are marked as read
readAllMessageThreadReactions chat_id:int53 message_thread_id:int53 = Ok;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Returns an existing chat corresponding to a given user @user_id User identifier @force 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
2021-12-30 05:55:02 +00:00
createPrivateChat user_id:int53 force:Bool = Chat;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Returns an existing chat corresponding to a known basic group @basic_group_id Basic group identifier @force 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
2021-12-30 05:55:02 +00:00
createBasicGroupChat basic_group_id:int53 force:Bool = Chat;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Returns an existing chat corresponding to a known supergroup or channel @supergroup_id Supergroup or channel identifier @force 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
2021-12-30 05:55:02 +00:00
createSupergroupChat supergroup_id:int53 force:Bool = Chat;
2018-08-30 14:55:42 +00:00
//@description Returns an existing chat corresponding to a known secret chat @secret_chat_id Secret chat identifier
createSecretChat secret_chat_id:int32 = Chat;
2022-12-07 20:04:16 +00:00
//@description Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat
//@user_ids Identifiers of users to be added to the basic group
//@title Title of the new basic group; 1-128 characters
2022-12-30 18:28:59 +00:00
//@message_auto_delete_time 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
createNewBasicGroupChat user_ids:vector<int53> title:string message_auto_delete_time:int32 = Chat;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat
//@title Title of the new chat; 1-128 characters
2023-02-04 22:54:46 +00:00
//@is_forum Pass true to create a forum supergroup chat
//@is_channel Pass true to create a channel chat; ignored if a forum is created
2021-12-30 05:55:02 +00:00
//@param_description Chat description; 0-255 characters
//@location Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat
2022-12-30 18:28:59 +00:00
//@message_auto_delete_time 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
2022-03-13 04:04:12 +00:00
//@for_import Pass true to create a supergroup for importing messages using importMessage
2023-02-04 22:54:46 +00:00
createNewSupergroupChat title:string is_forum:Bool is_channel:Bool description:string location:chatLocation message_auto_delete_time:int32 for_import:Bool = Chat;
2018-08-30 14:55:42 +00:00
//@description Creates a new secret chat. Returns the newly created chat @user_id Identifier of the target user
2021-12-30 05:55:02 +00:00
createNewSecretChat user_id:int53 = Chat;
2018-08-30 14:55:42 +00:00
2019-09-10 12:36:54 +00:00
//@description Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group @chat_id Identifier of the chat to upgrade
2018-08-30 14:55:42 +00:00
upgradeBasicGroupChatToSupergroupChat chat_id:int53 = Chat;
2020-11-30 09:33:47 +00:00
//@description Returns chat lists to which the chat can be added. This is an offline request @chat_id Chat identifier
getChatListsToAddChat chat_id:int53 = ChatLists;
//@description Adds a chat to a chat list. A chat can't be simultaneously in Main and Archive chat lists, so it is automatically removed from another one if needed
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@chat_list The chat list. Use getChatListsToAddChat to get suitable chat lists
2020-11-30 09:33:47 +00:00
addChatToList chat_id:int53 chat_list:ChatList = Ok;
//@description Returns information about a chat filter by its identifier @chat_filter_id Chat filter identifier
getChatFilter chat_filter_id:int32 = ChatFilter;
2022-12-07 20:04:16 +00:00
//@description Creates new chat filter. Returns information about the created chat filter. There can be up to getOption("chat_filter_count_max") chat filters, but the limit can be increased with Telegram Premium @filter Chat filter
2020-11-30 09:33:47 +00:00
createChatFilter filter:chatFilter = ChatFilterInfo;
//@description Edits existing chat filter. Returns information about the edited chat filter @chat_filter_id Chat filter identifier @filter The edited chat filter
editChatFilter chat_filter_id:int32 filter:chatFilter = ChatFilterInfo;
//@description Deletes existing chat filter @chat_filter_id Chat filter identifier
deleteChatFilter chat_filter_id:int32 = Ok;
2022-06-21 18:10:07 +00:00
//@description Changes the order of chat filters @chat_filter_ids Identifiers of chat filters in the new correct order @main_chat_list_position Position of the main chat list among chat filters, 0-based. Can be non-zero only for Premium users
reorderChatFilters chat_filter_ids:vector<int32> main_chat_list_position:int32 = Ok;
2020-02-03 12:56:20 +00:00
2020-11-30 09:33:47 +00:00
//@description Returns recommended chat filters for the current user
getRecommendedChatFilters = RecommendedChatFilters;
//@description Returns default icon name for a filter. Can be called synchronously @filter Chat filter
getChatFilterDefaultIconName filter:chatFilter = Text;
2021-12-30 05:55:02 +00:00
//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@title New title of the chat; 1-128 characters
2018-08-30 14:55:42 +00:00
setChatTitle chat_id:int53 title:string = Ok;
2021-12-30 05:55:02 +00:00
//@description Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@photo New chat photo; pass null to delete the chat photo
2020-11-30 09:33:47 +00:00
setChatPhoto chat_id:int53 photo:InputChatPhoto = Ok;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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).
//@chat_id Chat identifier
//@message_auto_delete_time 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
setChatMessageAutoDeleteTime chat_id:int53 message_auto_delete_time:int32 = Ok;
2021-12-30 05:55:02 +00:00
2019-09-10 12:36:54 +00:00
//@description Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@permissions New non-administrator members permissions in the chat
2019-09-10 12:36:54 +00:00
setChatPermissions chat_id:int53 permissions:chatPermissions = Ok;
2021-12-30 05:55:02 +00:00
//@description Changes the chat theme. Supported only in private and secret chats @chat_id Chat identifier @theme_name Name of the new chat theme; pass an empty string to return the default theme
setChatTheme chat_id:int53 theme_name:string = Ok;
//@description Changes the draft message in a chat @chat_id Chat identifier @message_thread_id If not 0, a message thread identifier in which the draft was changed @draft_message New draft message; pass null to remove the draft
2020-11-30 09:33:47 +00:00
setChatDraftMessage chat_id:int53 message_thread_id:int53 draft_message:draftMessage = Ok;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@notification_settings New notification settings for the chat. If the chat is muted for more than 366 days, it is considered to be muted forever
2018-09-05 21:45:29 +00:00
setChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Ok;
2021-12-30 05:55:02 +00:00
//@description Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@has_protected_content New value of has_protected_content
2021-12-30 05:55:02 +00:00
toggleChatHasProtectedContent chat_id:int53 has_protected_content:Bool = Ok;
2023-02-04 22:54:46 +00:00
//@description Changes the tranlatable state of a chat; for Telegram Premium users only @chat_id Chat identifier @is_translatable New value of is_translatable
toggleChatIsTranslatable chat_id:int53 is_translatable:Bool = Ok;
2018-09-05 21:45:29 +00:00
//@description Changes the marked as unread state of a chat @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread
toggleChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Ok;
//@description Changes the value of the default disable_notification parameter, used when a message is sent to a chat @chat_id Chat identifier @default_disable_notification New value of default_disable_notification
toggleChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Ok;
2022-09-18 01:34:29 +00:00
//@description Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @chat_id Identifier of the chat @available_reactions Reactions available in the chat. All emoji reactions must be active
setChatAvailableReactions chat_id:int53 available_reactions:ChatAvailableReactions = Ok;
2022-02-06 18:36:17 +00:00
2020-11-30 09:33:47 +00:00
//@description Changes application-specific data associated with a chat @chat_id Chat identifier @client_data New value of client_data
2018-08-30 14:55:42 +00:00
setChatClientData chat_id:int53 client_data:string = Ok;
2021-12-30 05:55:02 +00:00
//@description Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @chat_id Identifier of the chat @param_description New chat description; 0-255 characters
2019-09-10 12:36:54 +00:00
setChatDescription chat_id:int53 description:string = Ok;
2022-12-30 18:28:59 +00:00
//@description Changes the discussion group of a channel chat; requires can_change_info administrator right in the channel if it is specified
//@chat_id Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup)
//@discussion_chat_id Identifier of a new channel's discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups.
//-Basic group chats must be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable must be used first to change that
2020-02-03 12:56:20 +00:00
setChatDiscussionGroup chat_id:int53 discussion_chat_id:int53 = Ok;
//@description Changes the location of a chat. Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the method is allowed to use @chat_id Chat identifier @location New location for the chat; must be valid and not null
setChatLocation chat_id:int53 location:chatLocation = Ok;
2021-12-30 05:55:02 +00:00
//@description Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights @chat_id Chat identifier @slow_mode_delay New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600
2020-02-03 12:56:20 +00:00
setChatSlowModeDelay chat_id:int53 slow_mode_delay:int32 = Ok;
2020-11-30 09:33:47 +00:00
//@description Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel
//@chat_id Identifier of the chat
//@message_id Identifier of the new pinned message
2022-03-13 04:04:12 +00:00
//@disable_notification Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats
//@only_for_self Pass true to pin the message only for self; private chats only
2020-11-30 09:33:47 +00:00
pinChatMessage chat_id:int53 message_id:int53 disable_notification:Bool only_for_self:Bool = Ok;
//@description Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel @chat_id Identifier of the chat @message_id Identifier of the removed pinned message
unpinChatMessage chat_id:int53 message_id:int53 = Ok;
2019-06-07 10:56:06 +00:00
2020-11-30 09:33:47 +00:00
//@description Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel @chat_id Identifier of the chat
unpinAllChatMessages chat_id:int53 = Ok;
2019-06-07 10:56:06 +00:00
2022-12-30 18:28:59 +00:00
//@description Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup
//@chat_id Identifier of the chat
2022-11-07 18:50:52 +00:00
//@message_thread_id Message thread identifier in which messages will be unpinned
unpinAllMessageThreadMessages chat_id:int53 message_thread_id:int53 = Ok;
2020-02-03 12:56:20 +00:00
2022-06-21 18:10:07 +00:00
//@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 @chat_id Chat identifier
2018-09-05 21:45:29 +00:00
joinChat chat_id:int53 = Ok;
2021-12-30 05:55:02 +00:00
//@description Removes the current user from chat members. Private and secret chats can't be left using this method @chat_id Chat identifier
2018-09-05 21:45:29 +00:00
leaveChat chat_id:int53 = Ok;
2021-12-30 05:55:02 +00:00
//@description Adds a new member to a chat. Members can't be added to private or secret chats
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@user_id Identifier of the user
//@forward_limit The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot
2021-12-30 05:55:02 +00:00
addChatMember chat_id:int53 user_id:int53 forward_limit:int32 = Ok;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@user_ids Identifiers of the users to be added to the chat. The maximum number of added users is 20 for supergroups and 100 for channels
2021-12-30 05:55:02 +00:00
addChatMembers chat_id:int53 user_ids:vector<int53> = Ok;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@member_id Member identifier. Chats can be only banned and unbanned in supergroups and channels
//@status The new status of the member in the chat
2021-12-30 05:55:02 +00:00
setChatMemberStatus chat_id:int53 member_id:MessageSender status:ChatMemberStatus = Ok;
//@description Bans a member in a chat. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first
//@chat_id Chat identifier
//@member_id Member identifier
//@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned
//@revoke_messages Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels
banChatMember chat_id:int53 member_id:MessageSender banned_until_date:int32 revoke_messages:Bool = Ok;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Checks whether the current session can be used to transfer a chat ownership to another user
canTransferOwnership = CanTransferOwnershipResult;
//@description Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@user_id Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user
//@password The 2-step verification password of the current user
2021-12-30 05:55:02 +00:00
transferChatOwnership chat_id:int53 user_id:int53 password:string = Ok;
2020-02-03 12:56:20 +00:00
2021-12-30 05:55:02 +00:00
//@description Returns information about a single member of a chat @chat_id Chat identifier @member_id Member identifier
getChatMember chat_id:int53 member_id:MessageSender = ChatMember;
2018-08-30 14:55:42 +00:00
2022-11-07 18:50:52 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@chat_id Chat identifier
//@query Query to search for
//@limit The maximum number of users to be returned; up to 200
//@filter The type of users to search for; pass null to search among all chat members
2018-09-05 21:45:29 +00:00
searchChatMembers chat_id:int53 query:string limit:int32 filter:ChatMembersFilter = ChatMembers;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Returns a list of administrators of the chat with their custom titles @chat_id Chat identifier
getChatAdministrators chat_id:int53 = ChatAdministrators;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Clears message drafts in all chats @exclude_secret_chats Pass true to keep local message drafts in secret chats
2018-09-05 21:45:29 +00:00
clearAllDraftMessages exclude_secret_chats:Bool = Ok;
2022-04-24 20:33:39 +00:00
//@description Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier @notification_sound_id Identifier of the notification sound
getSavedNotificationSound notification_sound_id:int64 = NotificationSounds;
//@description Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used
getSavedNotificationSounds = NotificationSounds;
//@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 @sound Notification sound file to add
addSavedNotificationSound sound:InputFile = NotificationSound;
//@description Removes a notification sound from the list of saved notification sounds @notification_sound_id Identifier of the notification sound
removeSavedNotificationSound notification_sound_id:int64 = Ok;
2021-12-30 05:55:02 +00:00
//@description Returns list of chats with non-default notification settings
//@scope If specified, only chats from the scope will be returned; pass null to return chats from all scopes
2022-03-13 04:04:12 +00:00
//@compare_sound Pass true to include in the response chats with only non-default sound
2019-06-07 10:56:06 +00:00
getChatNotificationSettingsExceptions scope:NotificationSettingsScope compare_sound:Bool = Chats;
2018-09-05 21:45:29 +00:00
//@description Returns the notification settings for chats of a given type @scope Types of chats for which to return the notification settings information
getScopeNotificationSettings scope:NotificationSettingsScope = ScopeNotificationSettings;
//@description Changes notification settings for chats of a given type @scope Types of chats for which to change the notification settings @notification_settings The new notification settings for the given scope
setScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Ok;
2022-04-24 20:33:39 +00:00
//@description Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown
2018-09-05 21:45:29 +00:00
resetAllNotificationSettings = Ok;
2022-12-07 20:04:16 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@chat_list Chat list in which to change the pinned state of the chat
//@chat_id Chat identifier
//@is_pinned Pass true to pin the chat; pass false to unpin it
2020-11-30 09:33:47 +00:00
toggleChatIsPinned chat_list:ChatList chat_id:int53 is_pinned:Bool = Ok;
2020-02-03 12:56:20 +00:00
//@description Changes the order of pinned chats @chat_list Chat list in which to change the order of pinned chats @chat_ids The new list of pinned chats
setPinnedChats chat_list:ChatList chat_ids:vector<int53> = Ok;
2018-08-30 14:55:42 +00:00
2022-04-24 20:33:39 +00:00
//@description Returns information about a bot that can be added to attachment menu @bot_user_id Bot's user identifier
getAttachmentMenuBot bot_user_id:int53 = AttachmentMenuBot;
2022-12-30 18:28:59 +00:00
//@description Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true
//@bot_user_id Bot's user identifier
//@is_added Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu
//@allow_write_access Pass true if the current user allowed the bot to send them messages. Ignored if is_added is false
toggleBotIsAddedToAttachmentMenu bot_user_id:int53 is_added:Bool allow_write_access:Bool = Ok;
2022-04-24 20:33:39 +00:00
2022-12-30 18:28:59 +00:00
//@description Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list
2022-09-18 01:34:29 +00:00
getThemedEmojiStatuses = EmojiStatuses;
//@description Returns recent emoji statuses
getRecentEmojiStatuses = EmojiStatuses;
//@description Returns default emoji statuses
getDefaultEmojiStatuses = EmojiStatuses;
//@description Clears the list of recently used emoji statuses
clearRecentEmojiStatuses = Ok;
2019-06-07 10:56:06 +00:00
//@description Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates
2018-08-30 14:55:42 +00:00
//@file_id Identifier of the file to download
2022-03-13 04:04:12 +00:00
//@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first
2021-12-30 05:55:02 +00:00
//@offset The starting position from which the file needs to be downloaded
//@limit Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit
2022-03-13 04:04:12 +00:00
//@synchronous 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
2022-06-21 18:10:07 +00:00
downloadFile file_id:int32 priority:int32 offset:int53 limit:int53 synchronous:Bool = File;
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
//@description Returns file downloaded prefix size from a given offset, in bytes @file_id Identifier of the file @offset Offset from which downloaded prefix size needs to be calculated
2022-06-21 18:10:07 +00:00
getFileDownloadedPrefixSize file_id:int32 offset:int53 = FileDownloadedPrefixSize;
2018-08-30 14:55:42 +00:00
//@description Stops the downloading of a file. If a file has already been downloaded, does nothing @file_id Identifier of a file to stop downloading @only_if_pending Pass true to stop downloading only if it hasn't been started, i.e. request hasn't been sent to server
cancelDownloadFile file_id:int32 only_if_pending:Bool = Ok;
2021-12-30 05:55:02 +00:00
//@description Returns suggested name for saving a file in a given directory @file_id Identifier of the file @directory Directory in which the file is supposed to be saved
getSuggestedFileName file_id:int32 directory:string = Text;
2022-12-30 18:28:59 +00:00
//@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
2021-12-30 05:55:02 +00:00
//@file File to upload
//@file_type File type; pass null if unknown
2022-08-13 15:24:07 +00:00
//@priority Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first
preliminaryUploadFile file:InputFile file_type:FileType priority:int32 = File;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@description Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile. For other files the behavior is undefined @file_id Identifier of the file to stop uploading
cancelPreliminaryUploadFile file_id:int32 = Ok;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Writes a part of a generated file. 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 write to the destination file
2022-12-30 18:28:59 +00:00
//@generation_id The identifier of the generation process
//@offset The offset from which to write the data to the file
//@data The data to write
2022-06-21 18:10:07 +00:00
writeGeneratedFilePart generation_id:int64 offset:int53 data:bytes = Ok;
2019-06-07 10:56:06 +00:00
2020-02-03 12:56:20 +00:00
//@description Informs TDLib on a file generation progress
2018-08-30 14:55:42 +00:00
//@generation_id The identifier of the generation process
//@expected_size Expected size of the generated file, in bytes; 0 if unknown
//@local_prefix_size The number of bytes already generated
2022-06-21 18:10:07 +00:00
setFileGenerationProgress generation_id:int64 expected_size:int53 local_prefix_size:int53 = Ok;
2018-08-30 14:55:42 +00:00
//@description Finishes the file generation
//@generation_id The identifier of the generation process
2021-12-30 05:55:02 +00:00
//@error If passed, the file generation has failed and must be terminated; pass null if the file generation succeeded
2018-08-30 14:55:42 +00:00
finishFileGeneration generation_id:int64 error:error = Ok;
2020-11-30 09:33:47 +00:00
//@description Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file
2019-06-07 10:56:06 +00:00
//@file_id Identifier of the file. The file must be located in the TDLib file cache
//@offset The offset from which to read the file
//@count 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
2022-06-21 18:10:07 +00:00
readFilePart file_id:int32 offset:int53 count:int53 = FilePart;
2019-06-07 10:56:06 +00:00
2018-08-30 14:55:42 +00:00
//@description Deletes a file from the TDLib file cache @file_id Identifier of the file to delete
deleteFile file_id:int32 = Ok;
2022-03-13 04:04:12 +00:00
//@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
//@file_id Identifier of the file to download
//@chat_id Chat identifier of the message with the file
//@message_id Message identifier
//@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first
addFileToDownloads file_id:int32 chat_id:int53 message_id:int53 priority:int32 = File;
//@description Changes pause state of a file in the file download list
//@file_id Identifier of the downloaded file
//@is_paused Pass true if the download is paused
toggleDownloadIsPaused file_id:int32 is_paused:Bool = Ok;
//@description Changes pause state of all files in the file download list @are_paused Pass true to pause all downloads; pass false to unpause them
toggleAllDownloadsArePaused are_paused:Bool = Ok;
//@description Removes a file from the file download list @file_id Identifier of the downloaded file @delete_from_cache Pass true to delete the file from the TDLib file cache
removeFileFromDownloads file_id:int32 delete_from_cache:Bool = Ok;
//@description Removes all files from the file download list
//@only_active Pass true to remove only active downloads, including paused
//@only_completed Pass true to remove only completed downloads
//@delete_from_cache Pass true to delete the file from the TDLib file cache
removeAllFilesFromDownloads only_active:Bool only_completed:Bool delete_from_cache:Bool = Ok;
//@description Searches for files in the file download list or recently downloaded files from the list
//@query Query to search for; may be empty to return all downloaded files
//@only_active Pass true to search only for active downloads, including paused
//@only_completed Pass true to search only for completed downloads
//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
//@limit The maximum number of files to be returned
searchFileDownloads query:string only_active:Bool only_completed:Bool offset:string limit:int32 = FoundFileDownloads;
2018-08-30 14:55:42 +00:00
2022-06-21 18:10:07 +00:00
//@description Returns information about a file with messages exported from another application @message_file_head Beginning of the message file; up to 100 first lines
2021-12-30 05:55:02 +00:00
getMessageFileType message_file_head:string = MessageFileType;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Returns a confirmation text to be shown to the user before starting message import
//@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right
getMessageImportConfirmationText chat_id:int53 = Text;
//@description Imports messages exported from another app
//@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right
//@message_file File with messages to import. Only inputFileLocal and inputFileGenerated are supported. The file must not be previously uploaded
//@attached_files Files used in the imported messages. Only inputFileLocal and inputFileGenerated are supported. The files must not be previously uploaded
importMessages chat_id:int53 message_file:InputFile attached_files:vector<InputFile> = Ok;
//@description Replaces current primary invite link for a chat with a new primary invite link. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right @chat_id Chat identifier
replacePrimaryChatInviteLink chat_id:int53 = ChatInviteLink;
//@description Creates a new invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat
//@chat_id Chat identifier
//@name Invite link name; 0-32 characters
//@expiration_date Point in time (Unix timestamp) when the link will expire; pass 0 if never
//@member_limit The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited
2022-03-13 04:04:12 +00:00
//@creates_join_request 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
2021-12-30 05:55:02 +00:00
createChatInviteLink chat_id:int53 name:string expiration_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink;
//@description Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
//@chat_id Chat identifier
//@invite_link Invite link to be edited
//@name Invite link name; 0-32 characters
//@expiration_date Point in time (Unix timestamp) when the link will expire; pass 0 if never
//@member_limit The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited
2022-03-13 04:04:12 +00:00
//@creates_join_request 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
2021-12-30 05:55:02 +00:00
editChatInviteLink chat_id:int53 invite_link:string name:string expiration_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink;
//@description Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links
//@chat_id Chat identifier
//@invite_link Invite link to get
getChatInviteLink chat_id:int53 invite_link:string = ChatInviteLink;
//@description Returns list of chat administrators with number of their invite links. Requires owner privileges in the chat @chat_id Chat identifier
getChatInviteLinkCounts chat_id:int53 = ChatInviteLinkCounts;
//@description Returns invite links for a chat created by specified administrator. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links
//@chat_id Chat identifier
//@creator_user_id User identifier of a chat administrator. Must be an identifier of the current user for non-owner
//@is_revoked Pass true if revoked links needs to be returned instead of active or expired
//@offset_date Creation date of an invite link starting after which to return invite links; use 0 to get results from the beginning
//@offset_invite_link Invite link starting after which to return invite links; use empty string to get results from the beginning
//@limit The maximum number of invite links to return; up to 100
getChatInviteLinks chat_id:int53 creator_user_id:int53 is_revoked:Bool offset_date:int32 offset_invite_link:string limit:int32 = ChatInviteLinks;
2022-12-30 18:28:59 +00:00
//@description Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
//@chat_id Chat identifier
//@invite_link Invite link for which to return chat members
//@offset_member A chat member from which to return next chat members; pass null to get results from the beginning
//@limit The maximum number of chat members to return; up to 100
2021-12-30 05:55:02 +00:00
getChatInviteLinkMembers chat_id:int53 invite_link:string offset_member:chatInviteLinkMember limit:int32 = ChatInviteLinkMembers;
//@description Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links.
//-If a primary link is revoked, then additionally to the revoked link returns new primary link
//@chat_id Chat identifier
//@invite_link Invite link to be revoked
revokeChatInviteLink chat_id:int53 invite_link:string = ChatInviteLinks;
//@description Deletes revoked chat invite links. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links @chat_id Chat identifier @invite_link Invite link to revoke
deleteRevokedChatInviteLink chat_id:int53 invite_link:string = Ok;
//@description Deletes all revoked chat invite links created by a given chat administrator. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
//@chat_id Chat identifier
//@creator_user_id User identifier of a chat administrator, which links will be deleted. Must be an identifier of the current user for non-owner
deleteAllRevokedChatInviteLinks chat_id:int53 creator_user_id:int53 = Ok;
//@description Checks the validity of an invite link for a chat and returns information about the corresponding chat @invite_link Invite link to be checked
2018-08-30 14:55:42 +00:00
checkChatInviteLink invite_link:string = ChatInviteLinkInfo;
2022-06-21 18:10:07 +00:00
//@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 @invite_link Invite link to use
2018-08-30 14:55:42 +00:00
joinChatByInviteLink invite_link:string = Chat;
2021-12-30 05:55:02 +00:00
//@description Returns pending join requests in a chat
//@chat_id Chat identifier
//@invite_link Invite link for which to return join requests. If empty, all join requests will be returned. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
//@query A query to search for in the first names, last names and usernames of the users to return
//@offset_request A chat join request from which to return next requests; pass null to get results from the beginning
//@limit The maximum number of requests to join the chat to return
getChatJoinRequests chat_id:int53 invite_link:string query:string offset_request:chatJoinRequest limit:int32 = ChatJoinRequests;
2022-03-13 04:04:12 +00:00
//@description Handles a pending join request in a chat @chat_id Chat identifier @user_id Identifier of the user that sent the request @approve Pass true to approve the request; pass false to decline it
2021-12-30 05:55:02 +00:00
processChatJoinRequest chat_id:int53 user_id:int53 approve:Bool = Ok;
//@description Handles all pending join requests for a given link in a chat
//@chat_id Chat identifier
//@invite_link Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
2022-03-13 04:04:12 +00:00
//@approve Pass true to approve all requests; pass false to decline them
2021-12-30 05:55:02 +00:00
processChatJoinRequests chat_id:int53 invite_link:string approve:Bool = Ok;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Creates a new call @user_id Identifier of the user to be called @protocol The call protocols supported by the application @is_video Pass true to create a video call
2021-12-30 05:55:02 +00:00
createCall user_id:int53 protocol:callProtocol is_video:Bool = CallId;
//@description Accepts an incoming call @call_id Call identifier @protocol The call protocols supported by the application
2018-08-30 14:55:42 +00:00
acceptCall call_id:int32 protocol:callProtocol = Ok;
2020-11-30 09:33:47 +00:00
//@description Sends call signaling data @call_id Call identifier @data The data
sendCallSignalingData call_id:int32 data:bytes = Ok;
2022-12-30 18:28:59 +00:00
//@description Discards a call
//@call_id Call identifier
//@is_disconnected Pass true if the user was disconnected
//@duration The call duration, in seconds
//@is_video Pass true if the call was a video call
//@connection_id Identifier of the connection used during the call
2020-11-30 09:33:47 +00:00
discardCall call_id:int32 is_disconnected:Bool duration:int32 is_video:Bool connection_id:int64 = Ok;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Sends a call rating
//@call_id Call identifier
//@rating Call rating; 1-5
//@comment An optional user comment if the rating is less than 5
//@problems List of the exact types of problems with the call, specified by the user
2019-09-10 12:36:54 +00:00
sendCallRating call_id:int32 rating:int32 comment:string problems:vector<CallProblem> = Ok;
2018-08-30 14:55:42 +00:00
2022-05-09 11:35:19 +00:00
//@description Sends debug information for a call to Telegram servers @call_id Call identifier @debug_information Debug information in application-specific format
2018-08-30 14:55:42 +00:00
sendCallDebugInformation call_id:int32 debug_information:string = Ok;
2022-05-09 11:35:19 +00:00
//@description Sends log file for a call to Telegram servers @call_id Call identifier @log_file Call log file. Only inputFileLocal and inputFileGenerated are supported
sendCallLog call_id:int32 log_file:InputFile = Ok;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined @chat_id Chat identifier
getVideoChatAvailableParticipants chat_id:int53 = MessageSenders;
//@description Changes default participant identifier, on whose behalf a video chat in the chat will be joined @chat_id Chat identifier @default_participant_id Default group call participant identifier to join the video chats
setVideoChatDefaultParticipant chat_id:int53 default_participant_id:MessageSender = Ok;
//@description Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights
2022-04-24 20:33:39 +00:00
//@chat_id Identifier of a chat in which the video chat will be created
2021-12-30 05:55:02 +00:00
//@title Group call title; if empty, chat title will be used
//@start_date 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
2022-03-13 04:04:12 +00:00
//@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges
createVideoChat chat_id:int53 title:string start_date:int32 is_rtmp_stream:Bool = GroupCallId;
//@description Returns RTMP URL for streaming to the chat; requires creator privileges @chat_id Chat identifier
getVideoChatRtmpUrl chat_id:int53 = RtmpUrl;
//@description Replaces the current RTMP URL for streaming to the chat; requires creator privileges @chat_id Chat identifier
replaceVideoChatRtmpUrl chat_id:int53 = RtmpUrl;
2021-12-30 05:55:02 +00:00
//@description Returns information about a group call @group_call_id Group call identifier
getGroupCall group_call_id:int32 = GroupCall;
//@description Starts a scheduled group call @group_call_id Group call identifier
startScheduledGroupCall group_call_id:int32 = Ok;
//@description Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only
2022-12-30 18:28:59 +00:00
//@group_call_id Group call identifier
//@enabled_start_notification New value of the enabled_start_notification setting
2021-12-30 05:55:02 +00:00
toggleGroupCallEnabledStartNotification group_call_id:int32 enabled_start_notification:Bool = Ok;
//@description Joins an active group call. Returns join response payload for tgcalls
//@group_call_id Group call identifier
//@participant_id Identifier of a group call participant, which will be used to join the call; pass null to join as self; video chats only
//@audio_source_id Caller audio channel synchronization source identifier; received from tgcalls
//@payload Group call join payload; received from tgcalls
2022-03-13 04:04:12 +00:00
//@is_muted Pass true to join the call with muted microphone
//@is_my_video_enabled Pass true if the user's video is enabled
2021-12-30 05:55:02 +00:00
//@invite_hash If non-empty, invite hash to be used to join the group call without being muted by administrators
joinGroupCall group_call_id:int32 participant_id:MessageSender audio_source_id:int32 payload:string is_muted:Bool is_my_video_enabled:Bool invite_hash:string = Text;
//@description Starts screen sharing in a joined group call. Returns join response payload for tgcalls
//@group_call_id Group call identifier
//@audio_source_id Screen sharing audio channel synchronization source identifier; received from tgcalls
//@payload Group call join payload; received from tgcalls
startGroupCallScreenSharing group_call_id:int32 audio_source_id:int32 payload:string = Text;
2022-12-30 18:28:59 +00:00
//@description Pauses or unpauses screen sharing in a joined group call @group_call_id Group call identifier @is_paused Pass true to pause screen sharing; pass false to unpause it
2021-12-30 05:55:02 +00:00
toggleGroupCallScreenSharingIsPaused group_call_id:int32 is_paused:Bool = Ok;
//@description Ends screen sharing in a joined group call @group_call_id Group call identifier
endGroupCallScreenSharing group_call_id:int32 = Ok;
//@description Sets group call title. Requires groupCall.can_be_managed group call flag @group_call_id Group call identifier @title New group call title; 1-64 characters
setGroupCallTitle group_call_id:int32 title:string = Ok;
//@description Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires groupCall.can_toggle_mute_new_participants group call flag
2022-12-30 18:28:59 +00:00
//@group_call_id Group call identifier
//@mute_new_participants New value of the mute_new_participants setting
2021-12-30 05:55:02 +00:00
toggleGroupCallMuteNewParticipants group_call_id:int32 mute_new_participants:Bool = Ok;
//@description Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats
2022-12-30 18:28:59 +00:00
//@group_call_id Group call identifier
//@user_ids User identifiers. At most 10 users can be invited simultaneously
2021-12-30 05:55:02 +00:00
inviteGroupCallParticipants group_call_id:int32 user_ids:vector<int53> = Ok;
//@description Returns invite link to a video chat in a public chat
//@group_call_id Group call identifier
//@can_self_unmute Pass true if the invite link needs to contain an invite hash, passing which to joinGroupCall would allow the invited user to unmute themselves. Requires groupCall.can_be_managed group call flag
getGroupCallInviteLink group_call_id:int32 can_self_unmute:Bool = HttpUrl;
//@description Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag @group_call_id Group call identifier
revokeGroupCallInviteLink group_call_id:int32 = Ok;
2022-12-30 18:28:59 +00:00
//@description Starts recording of an active group call. Requires groupCall.can_be_managed group call flag
//@group_call_id Group call identifier
//@title Group call recording title; 0-64 characters
//@record_video Pass true to record a video file instead of an audio file
//@use_portrait_orientation Pass true to use portrait orientation for video instead of landscape one
2021-12-30 05:55:02 +00:00
startGroupCallRecording group_call_id:int32 title:string record_video:Bool use_portrait_orientation:Bool = Ok;
//@description Ends recording of an active group call. Requires groupCall.can_be_managed group call flag @group_call_id Group call identifier
endGroupCallRecording group_call_id:int32 = Ok;
//@description Toggles whether current user's video is paused @group_call_id Group call identifier @is_my_video_paused Pass true if the current user's video is paused
toggleGroupCallIsMyVideoPaused group_call_id:int32 is_my_video_paused:Bool = Ok;
//@description Toggles whether current user's video is enabled @group_call_id Group call identifier @is_my_video_enabled Pass true if the current user's video is enabled
toggleGroupCallIsMyVideoEnabled group_call_id:int32 is_my_video_enabled:Bool = Ok;
2022-12-30 18:28:59 +00:00
//@description Informs TDLib that speaking state of a participant of an active group has changed
//@group_call_id Group call identifier
//@audio_source Group call participant's synchronization audio source identifier, or 0 for the current user
//@is_speaking Pass true if the user is speaking
2021-12-30 05:55:02 +00:00
setGroupCallParticipantIsSpeaking group_call_id:int32 audio_source:int32 is_speaking:Bool = Ok;
//@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves
2022-12-30 18:28:59 +00:00
//@group_call_id Group call identifier
//@participant_id Participant identifier
//@is_muted Pass true to mute the user; pass false to unmute the them
2021-12-30 05:55:02 +00:00
toggleGroupCallParticipantIsMuted group_call_id:int32 participant_id:MessageSender is_muted:Bool = Ok;
//@description Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level
2022-12-30 18:28:59 +00:00
//@group_call_id Group call identifier
//@participant_id Participant identifier
//@volume_level New participant's volume level; 1-20000 in hundreds of percents
2021-12-30 05:55:02 +00:00
setGroupCallParticipantVolumeLevel group_call_id:int32 participant_id:MessageSender volume_level:int32 = Ok;
//@description Toggles whether a group call participant hand is rased
2022-12-30 18:28:59 +00:00
//@group_call_id Group call identifier
//@participant_id Participant identifier
2021-12-30 05:55:02 +00:00
//@is_hand_raised Pass true if the user's hand needs to be raised. Only self hand can be raised. Requires groupCall.can_be_managed group call flag to lower other's hand
toggleGroupCallParticipantIsHandRaised group_call_id:int32 participant_id:MessageSender is_hand_raised:Bool = Ok;
//@description Loads more participants of a group call. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded
//@group_call_id Group call identifier. The group call must be previously received through getGroupCall and must be joined or being joined
//@limit The maximum number of participants to load; up to 100
loadGroupCallParticipants group_call_id:int32 limit:int32 = Ok;
//@description Leaves a group call @group_call_id Group call identifier
leaveGroupCall group_call_id:int32 = Ok;
//@description Ends a group call. Requires groupCall.can_be_managed @group_call_id Group call identifier
endGroupCall group_call_id:int32 = Ok;
2022-03-13 04:04:12 +00:00
//@description Returns information about available group call streams @group_call_id Group call identifier
getGroupCallStreams group_call_id:int32 = GroupCallStreams;
2021-12-30 05:55:02 +00:00
//@description Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video
//@group_call_id Group call identifier
//@time_offset Point in time when the stream segment begins; Unix timestamp in milliseconds
//@scale Segment duration scale; 0-1. Segment's duration is 1000/(2**scale) milliseconds
//@channel_id Identifier of an audio/video channel to get as received from tgcalls
//@video_quality Video quality as received from tgcalls; pass null to get the worst available quality
getGroupCallStreamSegment group_call_id:int32 time_offset:int53 scale:int32 channel_id:int32 video_quality:GroupCallVideoQuality = FilePart;
//@description Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked @sender_id Identifier of a message sender to block/unblock @is_blocked New value of is_blocked
toggleMessageSenderIsBlocked sender_id:MessageSender is_blocked:Bool = Ok;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Blocks an original sender of a message in the Replies chat
//@message_id The identifier of an incoming message in the Replies chat
2022-03-13 04:04:12 +00:00
//@delete_message Pass true to delete the message
//@delete_all_messages Pass true to delete all messages from the same sender
//@report_spam Pass true to report the sender to the Telegram moderators
2020-11-30 09:33:47 +00:00
blockMessageSenderFromReplies message_id:int53 delete_message:Bool delete_all_messages:Bool report_spam:Bool = Ok;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Returns users and chats that were blocked by the current user @offset Number of users and chats to skip in the result; must be non-negative @limit The maximum number of users and chats to return; up to 100
getBlockedMessageSenders offset:int32 limit:int32 = MessageSenders;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Adds a user to the contact list or edits an existing contact by their user identifier
//@contact The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored
//@share_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
2020-02-03 12:56:20 +00:00
addContact contact:contact share_phone_number:Bool = Ok;
//@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @contacts The list of contacts to import or edit; contacts' vCard are ignored and are not imported
2018-08-30 14:55:42 +00:00
importContacts contacts:vector<contact> = ImportedContacts;
2018-09-05 21:45:29 +00:00
//@description Returns all user contacts
getContacts = Users;
2022-12-30 18:28:59 +00:00
//@description Searches for the specified query in the first names, last names and usernames of the known user contacts
//@query Query to search for; may be empty to return all contacts
//@limit The maximum number of users to be returned
2018-08-30 14:55:42 +00:00
searchContacts query:string limit:int32 = Users;
2019-06-07 10:56:06 +00:00
//@description Removes users from the contact list @user_ids Identifiers of users to be deleted
2021-12-30 05:55:02 +00:00
removeContacts user_ids:vector<int53> = Ok;
2018-08-30 14:55:42 +00:00
//@description Returns the total number of imported contacts
getImportedContactCount = Count;
2021-12-30 05:55:02 +00:00
//@description Changes imported contacts using the list of contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts.
2022-12-30 18:28:59 +00:00
//-Query result depends on the result of the previous query, so only one query is possible at the same time
//@contacts The new list of contacts, contact's vCard are ignored and are not imported
2018-08-30 14:55:42 +00:00
changeImportedContacts contacts:vector<contact> = ImportedContacts;
2019-06-07 10:56:06 +00:00
//@description Clears all imported contacts, contact list remains unchanged
2018-08-30 14:55:42 +00:00
clearImportedContacts = Ok;
2022-12-30 18:28:59 +00:00
//@description Changes a personal profile photo of a contact user @user_id User identifier @photo Profile photo to set; pass null to delete the photo; inputChatPhotoPrevious isn't supported in this function
setUserPersonalProfilePhoto user_id:int53 photo:InputChatPhoto = Ok;
//@description Suggests a profile photo to another regular user with common messages @user_id User identifier @photo Profile photo to suggest; inputChatPhotoPrevious isn't supported in this function
suggestUserProfilePhoto user_id:int53 photo:InputChatPhoto = Ok;
2018-08-30 14:55:42 +00:00
2022-05-09 11:35:19 +00:00
//@description Searches a user by their phone number. Returns a 404 error if the user can't be found @phone_number Phone number to search for
2022-03-13 04:04:12 +00:00
searchUserByPhoneNumber phone_number:string = User;
2020-02-03 12:56:20 +00:00
//@description Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber @user_id Identifier of the user with whom to share the phone number. The user must be a mutual contact
2021-12-30 05:55:02 +00:00
sharePhoneNumber user_id:int53 = Ok;
2020-02-03 12:56:20 +00:00
2022-12-30 18:28:59 +00:00
//@description Returns the profile photos of a user. Personal and public photo aren't returned @user_id User identifier @offset The number of photos to skip; must be non-negative @limit The maximum number of photos to be returned; up to 100
2021-12-30 05:55:02 +00:00
getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@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
2022-11-07 18:50:52 +00:00
//@sticker_type Type of the stickers to return
2023-02-04 22:54:46 +00:00
//@query Search query; a space-separated list of emoji or a keyword prefix. If empty, returns all known installed stickers
2022-08-13 15:24:07 +00:00
//@limit The maximum number of stickers to be returned
2022-11-07 18:50:52 +00:00
//@chat_id Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats
getStickers sticker_type:StickerType query:string limit:int32 chat_id:int53 = Stickers;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@description Searches for stickers from public sticker sets that correspond to any of the given emoji
//@sticker_type Type of the stickers to return
//@emojis Space-separated list of emoji to search for; must be non-empty
//@limit The maximum number of stickers to be returned; 0-100
searchStickers sticker_type:StickerType emojis:string limit:int32 = Stickers;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@description Returns premium stickers from regular sticker sets @limit The maximum number of stickers to be returned; 0-100
getPremiumStickers limit:int32 = Stickers;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@description Returns a list of installed sticker sets @sticker_type Type of the sticker sets to return
getInstalledStickerSets sticker_type:StickerType = StickerSets;
//@description Returns a list of archived sticker sets @sticker_type Type of the sticker sets to return @offset_sticker_set_id Identifier of the sticker set from which to return the result @limit The maximum number of sticker sets to return; up to 100
getArchivedStickerSets sticker_type:StickerType offset_sticker_set_id:int64 limit:int32 = StickerSets;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib
2022-08-13 15:24:07 +00:00
//@sticker_type Type of the sticker sets to return
2020-11-30 09:33:47 +00:00
//@offset The offset from which to return the sticker sets; must be non-negative
2021-12-30 05:55:02 +00:00
//@limit The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached
2022-08-13 15:24:07 +00:00
getTrendingStickerSets sticker_type:StickerType offset:int32 limit:int32 = TrendingStickerSets;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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 @file_id File identifier
2018-08-30 14:55:42 +00:00
getAttachedStickerSets file_id:int32 = StickerSets;
//@description Returns information about a sticker set by its identifier @set_id Identifier of the sticker set
getStickerSet set_id:int64 = StickerSet;
//@description Searches for a sticker set by its name @name Name of the sticker set
searchStickerSet name:string = StickerSet;
2022-08-13 15:24:07 +00:00
//@description Searches for installed sticker sets by looking for specified query in their title and name @sticker_type Type of the sticker sets to search for @query Query to search for @limit The maximum number of sticker sets to return
searchInstalledStickerSets sticker_type:StickerType query:string limit:int32 = StickerSets;
2018-08-30 14:55:42 +00:00
//@description Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results @query Query to search for
searchStickerSets query:string = StickerSets;
//@description Installs/uninstalls or activates/archives a sticker set @set_id Identifier of the sticker set @is_installed The new value of is_installed @is_archived The new value of is_archived. A sticker set can't be installed and archived simultaneously
changeStickerSet set_id:int64 is_installed:Bool is_archived:Bool = Ok;
//@description Informs the server that some trending sticker sets have been viewed by the user @sticker_set_ids Identifiers of viewed trending sticker sets
viewTrendingStickerSets sticker_set_ids:vector<int64> = Ok;
2022-08-13 15:24:07 +00:00
//@description Changes the order of installed sticker sets @sticker_type Type of the sticker sets to reorder @sticker_set_ids Identifiers of installed sticker sets in the new correct order
reorderInstalledStickerSets sticker_type:StickerType sticker_set_ids:vector<int64> = Ok;
2018-08-30 14:55:42 +00:00
//@description Returns a list of recently used stickers @is_attached Pass true to return stickers and masks that were recently attached to photos or video files; pass false to return recently sent stickers
getRecentStickers is_attached:Bool = Stickers;
2022-12-30 18:28:59 +00:00
//@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
//@is_attached Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers
//@sticker Sticker file to add
2018-08-30 14:55:42 +00:00
addRecentSticker is_attached:Bool sticker:InputFile = Stickers;
//@description Removes a sticker from the list of recently used stickers @is_attached Pass true to remove the sticker from the list of stickers recently attached to photo or video files; pass false to remove the sticker from the list of recently sent stickers @sticker Sticker file to delete
removeRecentSticker is_attached:Bool sticker:InputFile = Ok;
//@description Clears the list of recently used stickers @is_attached Pass true to clear the list of stickers recently attached to photo or video files; pass false to clear the list of recently sent stickers
clearRecentStickers is_attached:Bool = Ok;
//@description Returns favorite stickers
getFavoriteStickers = Stickers;
2022-12-30 18:28:59 +00:00
//@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
2018-08-30 14:55:42 +00:00
//@sticker Sticker file to add
addFavoriteSticker sticker:InputFile = Ok;
//@description Removes a sticker from the list of favorite stickers @sticker Sticker file to delete from the list
removeFavoriteSticker sticker:InputFile = Ok;
2019-09-10 12:36:54 +00:00
//@description Returns emoji corresponding to a sticker. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object @sticker Sticker file identifier
getStickerEmojis sticker:InputFile = Emojis;
2022-12-30 18:28:59 +00:00
//@description Searches for emojis by keywords. Supported only if the file database is enabled
//@text Text to search for
//@exact_match Pass true if only emojis, which exactly match the text, needs to be returned
//@input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown
2020-11-30 09:33:47 +00:00
searchEmojis text:string exact_match:Bool input_language_codes:vector<string> = Emojis;
2019-09-10 12:36:54 +00:00
2023-02-04 22:54:46 +00:00
//@description Returns available emojis categories @type Type of emoji categories to return; pass null to get default emoji categories
getEmojiCategories type:EmojiCategoryType = EmojiCategories;
2021-12-30 05:55:02 +00:00
//@description Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji @emoji The emoji
getAnimatedEmoji emoji:string = AnimatedEmoji;
2019-09-10 12:36:54 +00:00
//@description Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation @language_code Language code for which the emoji replacements will be suggested
getEmojiSuggestionsUrl language_code:string = HttpUrl;
2018-08-30 14:55:42 +00:00
2022-08-13 15:24:07 +00:00
//@description Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned @custom_emoji_ids Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously
getCustomEmojiStickers custom_emoji_ids:vector<int64> = Stickers;
2023-02-04 22:54:46 +00:00
//@description Returns default list of custom emoji stickers for placing on a chat photo
getDefaultChatPhotoCustomEmojiStickers = Stickers;
//@description Returns default list of custom emoji stickers for placing on a profile photo
getDefaultProfilePhotoCustomEmojiStickers = Stickers;
2018-08-30 14:55:42 +00:00
//@description Returns saved animations
getSavedAnimations = Animations;
//@description Manually adds a new animation to the list of saved animations. The new animation is added to the beginning of the list. If the animation was already in the list, it is removed first. Only non-secret video animations with MIME type "video/mp4" can be added to the list
2021-12-30 05:55:02 +00:00
//@animation The animation file to be added. Only animations known to the server (i.e., successfully sent via a message) can be added to the list
2018-08-30 14:55:42 +00:00
addSavedAnimation animation:InputFile = Ok;
//@description Removes an animation from the list of saved animations @animation Animation file to be removed
removeSavedAnimation animation:InputFile = Ok;
//@description Returns up to 20 recently used inline bots in the order of their last usage
getRecentInlineBots = Users;
2020-02-03 12:56:20 +00:00
//@description Searches for recently used hashtags by their prefix @prefix Hashtag prefix to search for @limit The maximum number of hashtags to be returned
2018-08-30 14:55:42 +00:00
searchHashtags prefix:string limit:int32 = Hashtags;
//@description Removes a hashtag from the list of recently used hashtags @hashtag Hashtag to delete
removeRecentHashtag hashtag:string = Ok;
//@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 @text Message text with formatting
getWebPagePreview text:formattedText = WebPage;
2022-03-13 04:04:12 +00:00
//@description Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page @url The web page URL @force_full Pass true to get full instant view for the web page
2018-08-30 14:55:42 +00:00
getWebPageInstantView url:string force_full:Bool = WebPageInstantView;
2023-02-04 22:54:46 +00:00
//@description Changes a profile photo for the current user
//@photo Profile photo to set
//@is_public Pass true to set a public photo, which will be visible even the main photo is hidden by privacy settings
2022-12-30 18:28:59 +00:00
setProfilePhoto photo:InputChatPhoto is_public:Bool = Ok;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Deletes a profile photo @profile_photo_id Identifier of the profile photo to delete
2018-08-30 14:55:42 +00:00
deleteProfilePhoto profile_photo_id:int64 = Ok;
2021-12-30 05:55:02 +00:00
//@description Changes the first and last name of the current user @first_name The new value of the first name for the current user; 1-64 characters @last_name The new value of the optional last name for the current user; 0-64 characters
2018-08-30 14:55:42 +00:00
setName first_name:string last_name:string = Ok;
2022-12-07 20:04:16 +00:00
//@description Changes the bio of the current user @bio The new value of the user bio; 0-getOption("bio_length_max") characters without line feeds
2018-08-30 14:55:42 +00:00
setBio bio:string = Ok;
2022-12-30 18:28:59 +00:00
//@description Changes the editable username of the current user
//@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
2018-08-30 14:55:42 +00:00
setUsername username:string = Ok;
2022-12-30 18:28:59 +00:00
//@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
//@username The username to change
//@is_active Pass true to activate the username; pass false to disable it
2022-11-07 18:50:52 +00:00
toggleUsernameIsActive username:string is_active:Bool = Ok;
//@description Changes order of active usernames of the current user @usernames The new order of active usernames. All currently active usernames must be specified
reorderActiveUsernames usernames:vector<string> = Ok;
2022-09-18 01:34:29 +00:00
//@description Changes the emoji status of the current user; for Telegram Premium users only
//@emoji_status New emoji status; pass null to switch to the default badge
//@duration Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually
setEmojiStatus emoji_status:emojiStatus duration:int32 = Ok;
2022-12-07 20:04:16 +00:00
//@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 @location The new location of the user
2020-11-30 09:33:47 +00:00
setLocation location:location = Ok;
2018-08-30 14:55:42 +00:00
//@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
2022-12-30 18:28:59 +00:00
//@phone_number The new phone number of the user in international format
//@settings Settings for the authentication of the user's phone number; pass null to use default settings
2019-09-10 12:36:54 +00:00
changePhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo;
2018-08-30 14:55:42 +00:00
2022-09-18 01:34:29 +00:00
//@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
2018-08-30 14:55:42 +00:00
resendChangePhoneNumberCode = AuthenticationCodeInfo;
2021-12-30 05:55:02 +00:00
//@description Checks the authentication code sent to confirm a new phone number of the user @code Authentication code to check
2018-08-30 14:55:42 +00:00
checkChangePhoneNumberCode code:string = Ok;
2021-12-30 05:55:02 +00:00
2022-12-07 20:04:16 +00:00
//@description Returns an HTTPS link, which can be used to get information about the current user
getUserLink = UserLink;
//@description Searches a user by a token from the user's link @token Token to search for
searchUserByToken token:string = User;
2021-12-30 05:55:02 +00:00
//@description Sets the list of commands supported by the bot for the given user scope and language; for bots only
//@scope The scope to which the commands are relevant; pass null to change commands in the default bot command scope
2022-02-06 18:36:17 +00:00
//@language_code 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
2021-12-30 05:55:02 +00:00
//@commands List of the bot's commands
setCommands scope:BotCommandScope language_code:string commands:vector<botCommand> = Ok;
//@description Deletes commands supported by the bot for the given user scope and language; for bots only
//@scope The scope to which the commands are relevant; pass null to delete commands in the default bot command scope
2022-02-06 18:36:17 +00:00
//@language_code A two-letter ISO 639-1 language code or an empty string
2021-12-30 05:55:02 +00:00
deleteCommands scope:BotCommandScope language_code:string = Ok;
2023-02-04 22:54:46 +00:00
//@description Returns list of commands supported by the bot for the given user scope and language; for bots only
2021-12-30 05:55:02 +00:00
//@scope The scope to which the commands are relevant; pass null to get commands in the default bot command scope
2022-02-06 18:36:17 +00:00
//@language_code A two-letter ISO 639-1 language code or an empty string
2021-12-30 05:55:02 +00:00
getCommands scope:BotCommandScope language_code:string = BotCommands;
2020-11-30 09:33:47 +00:00
2022-04-24 20:33:39 +00:00
//@description Sets menu button for the given user or for all users; for bots only
//@user_id Identifier of the user or 0 to set menu button for all users
//@menu_button New menu button
setMenuButton user_id:int53 menu_button:botMenuButton = Ok;
//@description Returns menu button set by the bot for the given user; for bots only @user_id Identifier of the user or 0 to get the default menu button
getMenuButton user_id:int53 = BotMenuButton;
//@description Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only @default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null
setDefaultGroupAdministratorRights default_group_administrator_rights:chatAdministratorRights = Ok;
//@description Sets default administrator rights for adding the bot to channel chats; for bots only @default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null
setDefaultChannelAdministratorRights default_channel_administrator_rights:chatAdministratorRights = Ok;
2018-08-30 14:55:42 +00:00
//@description Returns all active sessions of the current user
getActiveSessions = Sessions;
//@description Terminates a session of the current user @session_id Session identifier
terminateSession session_id:int64 = Ok;
//@description Terminates all other sessions of the current user
terminateAllOtherSessions = Ok;
2022-03-13 04:04:12 +00:00
//@description Toggles whether a session can accept incoming calls @session_id Session identifier @can_accept_calls Pass true to allow accepting incoming calls by the session; pass false otherwise
2021-12-30 05:55:02 +00:00
toggleSessionCanAcceptCalls session_id:int64 can_accept_calls:Bool = Ok;
2022-03-13 04:04:12 +00:00
//@description Toggles whether a session can accept incoming secret chats @session_id Session identifier @can_accept_secret_chats Pass true to allow accepring secret chats by the session; pass false otherwise
2021-12-30 05:55:02 +00:00
toggleSessionCanAcceptSecretChats session_id:int64 can_accept_secret_chats:Bool = Ok;
//@description Changes the period of inactivity after which sessions will automatically be terminated @inactive_session_ttl_days New number of days of inactivity before sessions will be automatically terminated; 1-366 days
setInactiveSessionTtl inactive_session_ttl_days:int32 = Ok;
2018-08-30 14:55:42 +00:00
//@description Returns all website where the current user used Telegram to log in
getConnectedWebsites = ConnectedWebsites;
//@description Disconnects website from the current user's Telegram account @website_id Website identifier
disconnectWebsite website_id:int64 = Ok;
//@description Disconnects all websites from the current user's Telegram account
disconnectAllWebsites = Ok;
2022-12-30 18:28:59 +00:00
//@description Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel
//@supergroup_id Identifier of the supergroup or channel
//@username New value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username
2021-12-30 05:55:02 +00:00
setSupergroupUsername supergroup_id:int53 username:string = Ok;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
//@supergroup_id Identifier of the supergroup or channel
//@username The username to change
//@is_active Pass true to activate the username; pass false to disable it
2022-11-07 18:50:52 +00:00
toggleSupergroupUsernameIsActive supergroup_id:int53 username:string is_active:Bool = Ok;
//@description Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel
disableAllSupergroupUsernames supergroup_id:int53 = Ok;
//@description Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel @usernames The new order of active usernames. All currently active usernames must be specified
reorderSupergroupActiveUsernames supergroup_id:int53 usernames:vector<string> = Ok;
2021-12-30 05:55:02 +00:00
//@description Changes the sticker set of a supergroup; requires can_change_info administrator right @supergroup_id Identifier of the supergroup @sticker_set_id New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set
setSupergroupStickerSet supergroup_id:int53 sticker_set_id:int64 = Ok;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Toggles whether sender signature is added to sent messages in a channel; requires can_change_info administrator right @supergroup_id Identifier of the channel @sign_messages New value of sign_messages
toggleSupergroupSignMessages supergroup_id:int53 sign_messages:Bool = Ok;
2018-08-30 14:55:42 +00:00
2022-06-21 18:10:07 +00:00
//@description Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members administrator right @supergroup_id Identifier of the supergroup @join_to_send_messages New value of join_to_send_messages
toggleSupergroupJoinToSendMessages supergroup_id:int53 join_to_send_messages:Bool = Ok;
//@description Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right @supergroup_id Identifier of the channel @join_by_request New value of join_by_request
toggleSupergroupJoinByRequest supergroup_id:int53 join_by_request:Bool = Ok;
2021-12-30 05:55:02 +00:00
//@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available
toggleSupergroupIsAllHistoryAvailable supergroup_id:int53 is_all_history_available:Bool = Ok;
2018-08-30 14:55:42 +00:00
2023-02-04 22:54:46 +00:00
//@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
//@supergroup_id Identifier of the supergroup
//@has_hidden_members New value of has_hidden_members
2022-12-30 18:28:59 +00:00
toggleSupergroupHasHiddenMembers supergroup_id:int53 has_hidden_members:Bool = Ok;
//@description Toggles whether aggressive anti-spam checks are enabled in the supergroup. Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam == true
//@supergroup_id The identifier of the supergroup, which isn't a broadcast group
//@has_aggressive_anti_spam_enabled The new value of has_aggressive_anti_spam_enabled
toggleSupergroupHasAggressiveAntiSpamEnabled supergroup_id:int53 has_aggressive_anti_spam_enabled:Bool = Ok;
2022-12-07 20:04:16 +00:00
2023-02-04 22:54:46 +00:00
//@description Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums @supergroup_id Identifier of the supergroup @is_forum New value of is_forum
2022-11-07 18:50:52 +00:00
toggleSupergroupIsForum supergroup_id:int53 is_forum:Bool = Ok;
2021-12-30 05:55:02 +00:00
//@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup
toggleSupergroupIsBroadcastGroup supergroup_id:int53 = Ok;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Reports messages in a supergroup as spam; requires administrator rights in the supergroup @supergroup_id Supergroup identifier @message_ids Identifiers of messages to report
reportSupergroupSpam supergroup_id:int53 message_ids:vector<int53> = Ok;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@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
//@supergroup_id Supergroup identifier
//@message_id Identifier of the erroneously deleted message
2022-12-07 20:04:16 +00:00
reportSupergroupAntiSpamFalsePositive supergroup_id:int53 message_id:int53 = Ok;
2022-12-30 18:28:59 +00:00
//@description Returns information about members or banned users in a supergroup or channel. Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters
//@supergroup_id Identifier of the supergroup or channel
//@filter The type of users to return; pass null to use supergroupMembersFilterRecent
//@offset Number of users to skip
//@limit The maximum number of users be returned; up to 200
2021-12-30 05:55:02 +00:00
getSupergroupMembers supergroup_id:int53 filter:SupergroupMembersFilter offset:int32 limit:int32 = ChatMembers;
2018-08-30 14:55:42 +00:00
2020-02-03 12:56:20 +00:00
//@description Closes a secret chat, effectively transferring its state to secretChatStateClosed @secret_chat_id Secret chat identifier
2018-08-30 14:55:42 +00:00
closeSecretChat secret_chat_id:int32 = Ok;
2022-08-13 15:24:07 +00:00
//@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)
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@query Search query by which to filter events
//@from_event_id Identifier of an event from which to return results. Use 0 to get results from the latest events
//@limit The maximum number of events to return; up to 100
//@filters The types of events to return; pass null to get chat events of all types
//@user_ids User identifiers by which to filter events. By default, events relating to all users will be returned
2021-12-30 05:55:02 +00:00
getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector<int53> = ChatEvents;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy
2022-06-21 18:10:07 +00:00
//@input_invoice The invoice
2021-12-30 05:55:02 +00:00
//@theme Preferred payment form theme; pass null to use the default theme
2022-06-21 18:10:07 +00:00
getPaymentForm input_invoice:InputInvoice theme:themeParameters = PaymentForm;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Validates the order information provided by a user and returns the available shipping options for a flexible invoice
2022-06-21 18:10:07 +00:00
//@input_invoice The invoice
2021-12-30 05:55:02 +00:00
//@order_info The order information, provided by the user; pass null if empty
2022-03-13 04:04:12 +00:00
//@allow_save Pass true to save the order information
2022-06-21 18:10:07 +00:00
validateOrderInfo input_invoice:InputInvoice order_info:orderInfo allow_save:Bool = ValidatedOrderInfo;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Sends a filled-out payment form to the bot for final verification
//@input_invoice The invoice
//@payment_form_id Payment form identifier returned by getPaymentForm
//@order_info_id Identifier returned by validateOrderInfo, or an empty string
//@shipping_option_id Identifier of a chosen shipping option, if applicable
//@credentials The credentials chosen by user for payment
//@tip_amount Chosen by the user amount of tip in the smallest units of the currency
2022-06-21 18:10:07 +00:00
sendPaymentForm input_invoice:InputInvoice payment_form_id:int64 order_info_id:string shipping_option_id:string credentials:InputCredentials tip_amount:int53 = PaymentResult;
2018-08-30 14:55:42 +00:00
2022-12-07 20:04:16 +00:00
//@description Returns information about a successful payment @chat_id Chat identifier of the messagePaymentSuccessful message @message_id Message identifier
2018-08-30 14:55:42 +00:00
getPaymentReceipt chat_id:int53 message_id:int53 = PaymentReceipt;
2022-03-13 04:04:12 +00:00
//@description Returns saved order information. Returns a 404 error if there is no saved order information
2018-08-30 14:55:42 +00:00
getSavedOrderInfo = OrderInfo;
2022-03-13 04:04:12 +00:00
//@description Deletes saved order information
2018-08-30 14:55:42 +00:00
deleteSavedOrderInfo = Ok;
//@description Deletes saved credentials for all payment provider bots
deleteSavedCredentials = Ok;
2022-06-21 18:10:07 +00:00
//@description Creates a link for the given invoice; for bots only @invoice Information about the invoice of the type inputMessageInvoice
createInvoiceLink invoice:InputMessageContent = HttpUrl;
2018-08-30 14:55:42 +00:00
//@description Returns a user that can be contacted to get support
getSupportUser = User;
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
//@description Returns backgrounds installed by the user @for_dark_theme Pass true to order returned backgrounds for a dark theme
2019-09-10 12:36:54 +00:00
getBackgrounds for_dark_theme:Bool = Backgrounds;
//@description Constructs a persistent HTTP URL for a background @name Background name @type Background type
getBackgroundUrl name:string type:BackgroundType = HttpUrl;
//@description Searches for a background by its name @name The name of the background
searchBackground name:string = Background;
//@description Changes the background selected by the user; adds background to the list of installed backgrounds
2021-12-30 05:55:02 +00:00
//@background The input background to use; pass null to create a new filled backgrounds or to remove the current background
//@type Background type; pass null to use the default type of the remote background or to remove the current background
2022-03-13 04:04:12 +00:00
//@for_dark_theme Pass true if the background is changed for a dark theme
2019-09-10 12:36:54 +00:00
setBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background;
2020-02-03 12:56:20 +00:00
//@description Removes background from the list of installed backgrounds @background_id The background identifier
2019-09-10 12:36:54 +00:00
removeBackground background_id:int64 = Ok;
//@description Resets list of installed backgrounds to its default value
resetBackgrounds = Ok;
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
//@description Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization @only_local Pass true to get only locally available information without sending network requests
2018-09-05 21:45:29 +00:00
getLocalizationTargetInfo only_local:Bool = LocalizationTargetInfo;
2019-06-07 10:56:06 +00:00
//@description Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization @language_pack_id Language pack identifier
getLanguagePackInfo language_pack_id:string = LanguagePackInfo;
2022-12-30 18:28:59 +00:00
//@description Returns strings from a language pack in the current localization target by their keys. Can be called before authorization
//@language_pack_id Language pack identifier of the strings to be returned
//@keys Language pack keys of the strings to be returned; leave empty to request all available strings
2018-09-05 21:45:29 +00:00
getLanguagePackStrings language_pack_id:string keys:vector<string> = LanguagePackStrings;
2021-12-30 05:55:02 +00:00
//@description Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization @language_pack_id Language pack identifier
2019-06-07 10:56:06 +00:00
synchronizeLanguagePack language_pack_id:string = Ok;
//@description Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization @language_pack_id Identifier of a language pack to be added; may be different from a name that is used in an "https://t.me/setlanguage/" link
addCustomServerLanguagePack language_pack_id:string = Ok;
2022-12-30 18:28:59 +00:00
//@description Adds or changes a custom local language pack to the current localization target
//@info 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
//@strings Strings of the new language pack
2018-09-05 21:45:29 +00:00
setCustomLanguagePack info:languagePackInfo strings:vector<languagePackString> = Ok;
2019-06-07 10:56:06 +00:00
//@description Edits information about a custom local language pack in the current localization target. Can be called before authorization @info New information about the custom local language pack
2018-09-05 21:45:29 +00:00
editCustomLanguagePackInfo info:languagePackInfo = Ok;
2019-06-07 10:56:06 +00:00
//@description Adds, edits or deletes a string in a custom local language pack. Can be called before authorization @language_pack_id Identifier of a previously added custom local language pack in the current localization target @new_string New language pack string
2018-09-05 21:45:29 +00:00
setCustomLanguagePackString language_pack_id:string new_string:languagePackString = Ok;
2022-12-30 18:28:59 +00:00
//@description Deletes all information about a language pack in the current localization target. The language pack which is currently in use (including base language pack) or is being synchronized can't be deleted.
//-Can be called before authorization
//@language_pack_id Identifier of the language pack to delete
2018-09-05 21:45:29 +00:00
deleteLanguagePack language_pack_id:string = Ok;
2020-11-30 09:33:47 +00:00
//@description Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription @device_token Device token @other_user_ids List of user identifiers of other users currently using the application
2021-12-30 05:55:02 +00:00
registerDevice device_token:DeviceToken other_user_ids:vector<int53> = PushReceiverId;
2019-06-07 10:56:06 +00:00
//@description Handles a push notification. Returns error with code 406 if the push notification is not supported and connection to the server is required to fetch new data. Can be called before authorization
//@payload JSON-encoded push notification payload with all fields sent by the server, and "google.sent_time" and "google.notification.sound" fields added
processPushNotification payload:string = Ok;
2020-11-30 09:33:47 +00:00
//@description Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. Can be called synchronously @payload JSON-encoded push notification payload
2019-06-07 10:56:06 +00:00
getPushReceiverId payload:string = PushReceiverId;
2018-08-30 14:55:42 +00:00
//@description Returns t.me URLs recently visited by a newly registered user @referrer Google Play referrer to identify the user
getRecentlyVisitedTMeUrls referrer:string = TMeUrls;
//@description Changes user privacy settings @setting The privacy setting @rules The new privacy rules
setUserPrivacySettingRules setting:UserPrivacySetting rules:userPrivacySettingRules = Ok;
//@description Returns the current privacy settings @setting The privacy setting
getUserPrivacySettingRules setting:UserPrivacySetting = UserPrivacySettingRules;
2022-08-13 15:24:07 +00:00
//@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"
2018-08-30 14:55:42 +00:00
//@name The name of the option
getOption name:string = OptionValue;
//@description Sets the value of an option. (Check the list of available options on https://core.telegram.org/tdlib/options.) Only writable options can be set. Can be called before authorization
2022-12-30 18:28:59 +00:00
//@name The name of the option
//@value The new value of the option; pass null to reset option value to a default value
2018-08-30 14:55:42 +00:00
setOption name:string value:OptionValue = Ok;
//@description Changes the period of inactivity after which the account of the current user will automatically be deleted @ttl New account TTL
setAccountTtl ttl:accountTtl = Ok;
//@description Returns the period of inactivity after which the account of the current user will automatically be deleted
getAccountTtl = AccountTtl;
2022-12-30 18:28:59 +00:00
//@description 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
//@reason The reason why the account was deleted; optional
//@password The 2-step verification password of the current user. If not specified, account deletion can be canceled within one week
2022-08-13 15:24:07 +00:00
deleteAccount reason:string password:string = Ok;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Changes the default message auto-delete time for new chats @message_auto_delete_time 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
setDefaultMessageAutoDeleteTime message_auto_delete_time:messageAutoDeleteTime = Ok;
2022-12-07 20:04:16 +00:00
2022-12-30 18:28:59 +00:00
//@description Returns default message auto-delete time setting for new chats
getDefaultMessageAutoDeleteTime = MessageAutoDeleteTime;
2022-12-07 20:04:16 +00:00
2020-02-03 12:56:20 +00:00
//@description Removes a chat action bar without any other action @chat_id Chat identifier
removeChatActionBar chat_id:int53 = Ok;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@message_ids Identifiers of reported messages; may be empty to report the whole chat
//@reason The reason for reporting the chat
//@text Additional report details; 0-1024 characters
2021-12-30 05:55:02 +00:00
reportChat chat_id:int53 message_ids:vector<int53> reason:ChatReportReason text:string = Ok;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported
//@reason The reason for reporting the chat photo
//@text Additional report details; 0-1024 characters
2021-12-30 05:55:02 +00:00
reportChatPhoto chat_id:int53 file_id:int32 reason:ChatReportReason text:string = Ok;
2018-08-30 14:55:42 +00:00
2022-09-18 01:34:29 +00:00
//@description Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions
2022-12-30 18:28:59 +00:00
//@chat_id Chat identifier
//@message_id Message identifier
//@sender_id Identifier of the sender, which added the reaction
2022-09-18 01:34:29 +00:00
reportMessageReactions chat_id:int53 message_id:int53 sender_id:MessageSender = Ok;
2021-12-30 05:55:02 +00:00
//@description Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application
2020-11-30 09:33:47 +00:00
getChatStatistics chat_id:int53 is_dark:Bool = ChatStatistics;
2021-12-30 05:55:02 +00:00
//@description Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true @chat_id Chat identifier @message_id Message identifier @is_dark Pass true if a dark theme is used by the application
2020-11-30 09:33:47 +00:00
getMessageStatistics chat_id:int53 message_id:int53 is_dark:Bool = MessageStatistics;
//@description Loads an asynchronous or a zoomed in statistical graph @chat_id Chat identifier @token The token for graph loading @x X-value for zoomed in graph or 0 otherwise
getStatisticalGraph chat_id:int53 token:string x:int53 = StatisticalGraph;
2019-06-07 10:56:06 +00:00
2022-12-30 18:28:59 +00:00
//@description Returns storage usage statistics. Can be called before authorization
//@chat_limit The maximum number of chats with the largest storage usage for which separate statistics need to be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0
2018-08-30 14:55:42 +00:00
getStorageStatistics chat_limit:int32 = StorageStatistics;
2019-06-07 10:56:06 +00:00
//@description Quickly returns approximate storage usage statistics. Can be called before authorization
2018-08-30 14:55:42 +00:00
getStorageStatisticsFast = StorageStatisticsFast;
2019-06-07 10:56:06 +00:00
//@description Returns database statistics
getDatabaseStatistics = DatabaseStatistics;
2018-08-30 14:55:42 +00:00
//@description Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted
2021-12-30 05:55:02 +00:00
//@size Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit
2018-08-30 14:55:42 +00:00
//@ttl Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit
2022-03-13 04:04:12 +00:00
//@count Limit on the total number of files after deletion. Pass -1 to use the default limit
2018-08-30 14:55:42 +00:00
//@immunity_delay The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value
2021-12-30 05:55:02 +00:00
//@file_types If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted
//@chat_ids If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos)
//@exclude_chat_ids If non-empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos)
2020-11-30 09:33:47 +00:00
//@return_deleted_file_statistics Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics
2018-08-30 14:55:42 +00:00
//@chat_limit Same as in getStorageStatistics. Affects only returned statistics
2020-11-30 09:33:47 +00:00
optimizeStorage size:int53 ttl:int32 count:int32 immunity_delay:int32 file_types:vector<FileType> chat_ids:vector<int53> exclude_chat_ids:vector<int53> return_deleted_file_statistics:Bool chat_limit:int32 = StorageStatistics;
2018-08-30 14:55:42 +00:00
2022-12-30 18:28:59 +00:00
//@description Sets the current network type. Can be called before authorization. Calling this method forces all network connections to reopen, mitigating the delay in switching between different networks,
//-so it must be called whenever the network is changed, even if the network type remains the same. Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics
//@type The new network type; pass null to set network type to networkTypeOther
2018-08-30 14:55:42 +00:00
setNetworkType type:NetworkType = Ok;
2022-03-13 04:04:12 +00:00
//@description Returns network data usage statistics. Can be called before authorization @only_current Pass true to get statistics only for the current library launch
2018-08-30 14:55:42 +00:00
getNetworkStatistics only_current:Bool = NetworkStatistics;
//@description Adds the specified data to data usage statistics. Can be called before authorization @entry The network statistics entry with the data to be added to statistics
addNetworkStatistics entry:NetworkStatisticsEntry = Ok;
//@description Resets all network data usage statistics to zero. Can be called before authorization
resetNetworkStatistics = Ok;
2020-11-30 09:33:47 +00:00
//@description Returns auto-download settings presets for the current user
2019-09-10 12:36:54 +00:00
getAutoDownloadSettingsPresets = AutoDownloadSettingsPresets;
2021-12-30 05:55:02 +00:00
//@description Sets auto-download settings @settings New user auto-download settings @type Type of the network for which the new settings are relevant
2019-09-10 12:36:54 +00:00
setAutoDownloadSettings settings:autoDownloadSettings type:NetworkType = Ok;
2023-02-04 22:54:46 +00:00
//@description Returns autosave settings for the current user
getAutosaveSettings = AutosaveSettings;
//@description Sets autosave settings for the given scope @scope Autosave settings scope @settings New autosave settings for the scope; pass null to set autosave settings to default
setAutosaveSettings scope:AutosaveSettingsScope settings:scopeAutosaveSettings = Ok;
//@description Clears the list of all autosave settings exceptions
clearAutosaveSettingsExceptions = Ok;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Returns information about a bank card @bank_card_number The bank card number
getBankCardInfo bank_card_number:string = BankCardInfo;
2022-08-13 15:24:07 +00:00
//@description Returns one of the available Telegram Passport elements @type Telegram Passport element type @password The 2-step verification password of the current user
2018-09-05 21:45:29 +00:00
getPassportElement type:PassportElementType password:string = PassportElement;
2022-08-13 15:24:07 +00:00
//@description Returns all available Telegram Passport elements @password The 2-step verification password of the current user
2018-09-05 21:45:29 +00:00
getAllPassportElements password:string = PassportElements;
2022-12-30 18:28:59 +00:00
//@description Adds an element to the user's Telegram Passport. May return an error with a message "PHONE_VERIFICATION_NEEDED" or "EMAIL_VERIFICATION_NEEDED" if the chosen phone number or the chosen email address must be verified first
//@element Input Telegram Passport element
//@password The 2-step verification password of the current user
2018-09-05 21:45:29 +00:00
setPassportElement element:InputPassportElement password:string = PassportElement;
//@description Deletes a Telegram Passport element @type Element type
deletePassportElement type:PassportElementType = Ok;
//@description Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed @user_id User identifier @errors The errors
2021-12-30 05:55:02 +00:00
setPassportElementErrors user_id:int53 errors:vector<inputPassportElementError> = Ok;
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
//@description Returns an IETF language tag of the language preferred in the country, which must be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown @country_code A two-letter ISO 3166-1 alpha-2 country code
2018-09-05 21:45:29 +00:00
getPreferredCountryLanguage country_code:string = Text;
//@description Sends a code to verify a phone number to be added to a user's Telegram Passport
2022-12-30 18:28:59 +00:00
//@phone_number The phone number of the user, in international format
//@settings Settings for the authentication of the user's phone number; pass null to use default settings
2019-09-10 12:36:54 +00:00
sendPhoneNumberVerificationCode phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo;
2018-09-05 21:45:29 +00:00
2022-09-18 01:34:29 +00:00
//@description Resends the code to verify a phone number to be added to a user's Telegram Passport
2018-09-05 21:45:29 +00:00
resendPhoneNumberVerificationCode = AuthenticationCodeInfo;
2021-12-30 05:55:02 +00:00
//@description Checks the phone number verification code for Telegram Passport @code Verification code to check
2018-09-05 21:45:29 +00:00
checkPhoneNumberVerificationCode code:string = Ok;
//@description Sends a code to verify an email address to be added to a user's Telegram Passport @email_address Email address
sendEmailAddressVerificationCode email_address:string = EmailAddressAuthenticationCodeInfo;
2022-09-18 01:34:29 +00:00
//@description Resends the code to verify an email address to be added to a user's Telegram Passport
2018-09-05 21:45:29 +00:00
resendEmailAddressVerificationCode = EmailAddressAuthenticationCodeInfo;
2021-12-30 05:55:02 +00:00
//@description Checks the email address verification code for Telegram Passport @code Verification code to check
2018-09-05 21:45:29 +00:00
checkEmailAddressVerificationCode code:string = Ok;
2022-12-30 18:28:59 +00:00
//@description Returns a Telegram Passport authorization form for sharing data with a service
//@bot_user_id User identifier of the service's bot
//@scope Telegram Passport element types requested by the service
//@public_key Service's public key
//@nonce Unique request identifier provided by the service
2021-12-30 05:55:02 +00:00
getPassportAuthorizationForm bot_user_id:int53 scope:string public_key:string nonce:string = PassportAuthorizationForm;
2019-06-07 10:56:06 +00:00
2022-12-30 18:28:59 +00:00
//@description Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form
//@authorization_form_id Authorization form identifier
//@password The 2-step verification password of the current user
getPassportAuthorizationFormAvailableElements authorization_form_id:int32 password:string = PassportElementsWithErrors;
2018-09-05 21:45:29 +00:00
2020-11-30 09:33:47 +00:00
//@description Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements are going to be reused
2022-12-30 18:28:59 +00:00
//@authorization_form_id Authorization form identifier
//@types Types of Telegram Passport elements chosen by user to complete the authorization form
sendPassportAuthorizationForm authorization_form_id:int32 types:vector<PassportElementType> = Ok;
2018-09-05 21:45:29 +00:00
2022-12-30 18:28:59 +00:00
//@description Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation
//@hash Hash value from the link
//@phone_number Phone number value from the link
//@settings Settings for the authentication of the user's phone number; pass null to use default settings
2019-09-10 12:36:54 +00:00
sendPhoneNumberConfirmationCode hash:string phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo;
2018-09-05 21:45:29 +00:00
//@description Resends phone number confirmation code
resendPhoneNumberConfirmationCode = AuthenticationCodeInfo;
2021-12-30 05:55:02 +00:00
//@description Checks phone number confirmation code @code Confirmation code to check
2018-09-05 21:45:29 +00:00
checkPhoneNumberConfirmationCode code:string = Ok;
2018-08-30 14:55:42 +00:00
//@description Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only @pending_update_count The number of pending updates @error_message The last error message
setBotUpdatesStatus pending_update_count:int32 error_message:string = Ok;
2021-12-30 05:55:02 +00:00
//@description Uploads a file with a sticker; returns the uploaded file @user_id Sticker file owner; ignored for regular users @sticker Sticker file to upload
2022-02-06 18:36:17 +00:00
uploadStickerFile user_id:int53 sticker:inputSticker = File;
2021-12-30 05:55:02 +00:00
//@description Returns a suggested name for a new sticker set with a given title @title Sticker set title; 1-64 characters
getSuggestedStickerSetName title:string = Text;
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
//@description Checks whether a name can be used for a new sticker set @name Name to be checked
checkStickerSetName name:string = CheckStickerSetNameResult;
//@description Creates a new sticker set. Returns the newly created sticker set
//@user_id Sticker set owner; ignored for regular users
2020-11-30 09:33:47 +00:00
//@title Sticker set title; 1-64 characters
2021-12-30 05:55:02 +00:00
//@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_<bot username>"* (*<bot_username>* is case insensitive) for bots; 1-64 characters
2022-08-13 15:24:07 +00:00
//@sticker_type Type of the stickers in the set
2022-02-06 18:36:17 +00:00
//@stickers 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
2021-12-30 05:55:02 +00:00
//@source Source of the sticker set; may be empty if unknown
2022-08-13 15:24:07 +00:00
createNewStickerSet user_id:int53 title:string name:string sticker_type:StickerType stickers:vector<inputSticker> source:string = StickerSet;
2020-11-30 09:33:47 +00:00
//@description Adds a new sticker to a set; for bots only. Returns the sticker set
2022-12-30 18:28:59 +00:00
//@user_id Sticker set owner
//@name Sticker set name
//@sticker Sticker to add to the set
2022-02-06 18:36:17 +00:00
addStickerToSet user_id:int53 name:string sticker:inputSticker = StickerSet;
2020-11-30 09:33:47 +00:00
//@description Sets a sticker set thumbnail; for bots only. Returns the sticker set
2022-12-30 18:28:59 +00:00
//@user_id Sticker set owner
//@name Sticker set name
2022-02-06 18:36:17 +00:00
//@thumbnail 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
2021-12-30 05:55:02 +00:00
setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile = StickerSet;
2020-11-30 09:33:47 +00:00
//@description Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot
2022-12-30 18:28:59 +00:00
//@sticker Sticker
//@position New position of the sticker in the set, 0-based
2018-08-30 14:55:42 +00:00
setStickerPositionInSet sticker:InputFile position:int32 = Ok;
//@description Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot @sticker Sticker
removeStickerFromSet sticker:InputFile = Ok;
2022-12-30 18:28:59 +00:00
//@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
//@location Location of the map center
//@zoom Map zoom level; 13-20
//@width Map width in pixels before applying scale; 16-1024
//@height Map height in pixels before applying scale; 16-1024
//@scale Map scale; 1-3
//@chat_id Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown
2018-09-05 21:45:29 +00:00
getMapThumbnailFile location:location zoom:int32 width:int32 height:int32 scale:int32 chat_id:int53 = File;
2022-06-21 18:10:07 +00:00
//@description Returns information about a limit, increased for Premium users. Returns a 404 error if the limit is unknown @limit_type Type of the limit
getPremiumLimit limit_type:PremiumLimitType = PremiumLimit;
//@description Returns information about features, available to Premium users @source Source of the request; pass null if the method is called from some non-standard source
getPremiumFeatures source:PremiumSource = PremiumFeatures;
//@description Returns examples of premium stickers for demonstration purposes
2022-08-13 15:24:07 +00:00
getPremiumStickerExamples = Stickers;
2022-06-21 18:10:07 +00:00
//@description Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen @feature The viewed premium feature
viewPremiumFeature feature:PremiumFeature = Ok;
//@description Informs TDLib that the user clicked Premium subscription button on the Premium features screen
clickPremiumSubscriptionButton = Ok;
//@description Returns state of Telegram Premium subscription and promotion videos for Premium features
getPremiumState = PremiumState;
2022-08-13 15:24:07 +00:00
//@description Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase @purpose Transaction purpose
canPurchasePremium purpose:StorePaymentPurpose = Ok;
//@description Informs server about a purchase through App Store. For official applications only @receipt App Store receipt @purpose Transaction purpose
assignAppStoreTransaction receipt:bytes purpose:StorePaymentPurpose = Ok;
2022-12-30 18:28:59 +00:00
//@description Informs server about a purchase through Google Play. For official applications only
//@package_name Application package name
//@store_product_id Identifier of the purchased store product
//@purchase_token Google Play purchase token
//@purpose Transaction purpose
2022-08-13 15:24:07 +00:00
assignGooglePlayTransaction package_name:string store_product_id:string purchase_token:string purpose:StorePaymentPurpose = Ok;
2022-06-21 18:10:07 +00:00
2018-09-05 21:45:29 +00:00
//@description Accepts Telegram terms of services @terms_of_service_id Terms of service identifier
acceptTermsOfService terms_of_service_id:string = Ok;
2018-08-30 14:55:42 +00:00
//@description Sends a custom request; for bots only @method The method name @parameters JSON-serialized method parameters
sendCustomRequest method:string parameters:string = CustomRequestResult;
//@description Answers a custom query; for bots only @custom_query_id Identifier of a custom query @data JSON-serialized answer to the query
answerCustomQuery custom_query_id:int64 data:string = Ok;
2020-11-30 09:33:47 +00:00
//@description Succeeds after a specified amount of time has passed. Can be called before initialization @seconds Number of seconds before the function returns
2018-08-30 14:55:42 +00:00
setAlarm seconds:double = Ok;
2020-11-30 09:33:47 +00:00
//@description Returns information about existing countries. Can be called before authorization
getCountries = Countries;
2021-12-30 05:55:02 +00:00
//@description Uses the current IP address to find the current country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization
2018-08-30 14:55:42 +00:00
getCountryCode = Text;
2020-11-30 09:33:47 +00:00
//@description Returns information about a phone number by its prefix. Can be called before authorization @phone_number_prefix The phone number prefix
getPhoneNumberInfo phone_number_prefix:string = PhoneNumberInfo;
2021-12-30 05:55:02 +00:00
//@description Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after changing localization to the specified language if properly localized country information is expected. Can be called synchronously
2022-12-30 18:28:59 +00:00
//@language_code A two-letter ISO 639-1 language code for country information localization
//@phone_number_prefix The phone number prefix
2021-12-30 05:55:02 +00:00
getPhoneNumberInfoSync language_code:string phone_number_prefix:string = PhoneNumberInfo;
//@description Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram
getApplicationDownloadLink = HttpUrl;
2018-08-30 14:55:42 +00:00
2018-09-05 21:45:29 +00:00
//@description Returns information about a tg:// deep link. Use "tg://need_update_for_some_feature" or "tg:some_unsupported_feature" for testing. Returns a 404 error for unknown links. Can be called before authorization @link The link
getDeepLinkInfo link:string = DeepLinkInfo;
2019-06-07 10:56:06 +00:00
//@description Returns application config, provided by the server. Can be called before authorization
getApplicationConfig = JsonValue;
//@description Saves application log event on the server. Can be called before authorization @type Event type @chat_id Optional chat identifier, associated with the event @data The log event data
saveApplicationLogEvent type:string chat_id:int53 data:JsonValue = Ok;
2022-12-30 18:28:59 +00:00
//@description Adds a proxy server for network requests. Can be called before authorization
//@server Proxy server IP address
//@port Proxy server port
//@enable Pass true to immediately enable the proxy
//@type Proxy type
2018-09-05 21:45:29 +00:00
addProxy server:string port:int32 enable:Bool type:ProxyType = Proxy;
2022-12-30 18:28:59 +00:00
//@description Edits an existing proxy server for network requests. Can be called before authorization
//@proxy_id Proxy identifier
//@server Proxy server IP address
//@port Proxy server port
//@enable Pass true to immediately enable the proxy
//@type Proxy type
2018-09-05 21:45:29 +00:00
editProxy proxy_id:int32 server:string port:int32 enable:Bool type:ProxyType = Proxy;
//@description Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization @proxy_id Proxy identifier
enableProxy proxy_id:int32 = Ok;
//@description Disables the currently enabled proxy. Can be called before authorization
disableProxy = Ok;
//@description Removes a proxy server. Can be called before authorization @proxy_id Proxy identifier
removeProxy proxy_id:int32 = Ok;
2018-08-30 14:55:42 +00:00
2018-09-05 21:45:29 +00:00
//@description Returns list of proxies that are currently set up. Can be called before authorization
getProxies = Proxies;
2018-08-30 14:55:42 +00:00
2018-09-05 21:45:29 +00:00
//@description Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization @proxy_id Proxy identifier
2021-12-30 05:55:02 +00:00
getProxyLink proxy_id:int32 = HttpUrl;
2018-08-30 14:55:42 +00:00
2018-09-05 21:45:29 +00:00
//@description Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization @proxy_id Proxy identifier. Use 0 to ping a Telegram server without a proxy
pingProxy proxy_id:int32 = Seconds;
2018-08-30 14:55:42 +00:00
2020-11-30 09:33:47 +00:00
//@description Sets new log stream for internal logging of TDLib. Can be called synchronously @log_stream New log stream
2019-06-07 10:56:06 +00:00
setLogStream log_stream:LogStream = Ok;
2020-11-30 09:33:47 +00:00
//@description Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously
2019-06-07 10:56:06 +00:00
getLogStream = LogStream;
2020-11-30 09:33:47 +00:00
//@description Sets the verbosity level of the internal logging of TDLib. Can be called synchronously
2022-12-30 18:28:59 +00:00
//@new_verbosity_level New value of the verbosity level for logging. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings,
//-value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1023 can be used to enable even more logging
2019-06-07 10:56:06 +00:00
setLogVerbosityLevel new_verbosity_level:int32 = Ok;
2020-11-30 09:33:47 +00:00
//@description Returns current verbosity level of the internal logging of TDLib. Can be called synchronously
2019-06-07 10:56:06 +00:00
getLogVerbosityLevel = LogVerbosityLevel;
2020-11-30 09:33:47 +00:00
//@description Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously
2019-06-07 10:56:06 +00:00
getLogTags = LogTags;
2020-11-30 09:33:47 +00:00
//@description Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously
2022-12-30 18:28:59 +00:00
//@tag Logging tag to change verbosity level
//@new_verbosity_level New verbosity level; 1-1024
2019-06-07 10:56:06 +00:00
setLogTagVerbosityLevel tag:string new_verbosity_level:int32 = Ok;
2020-11-30 09:33:47 +00:00
//@description Returns current verbosity level for a specified TDLib internal log tag. Can be called synchronously @tag Logging tag to change verbosity level
2019-06-07 10:56:06 +00:00
getLogTagVerbosityLevel tag:string = LogVerbosityLevel;
2020-11-30 09:33:47 +00:00
//@description Adds a message to TDLib internal log. Can be called synchronously
2022-12-30 18:28:59 +00:00
//@verbosity_level The minimum verbosity level needed for the message to be logged; 0-1023
//@text Text of a message to log
2019-06-07 10:56:06 +00:00
addLogMessage verbosity_level:int32 text:string = Ok;
2022-09-18 01:34:29 +00:00
//@description Returns support information for the given user; for Telegram support only @user_id User identifier
getUserSupportInfo user_id:int53 = UserSupportInfo;
//@description Sets support information for the given user; for Telegram support only @user_id User identifier @message New information message
setUserSupportInfo user_id:int53 message:formattedText = UserSupportInfo;
2019-06-07 10:56:06 +00:00
//@description Does nothing; for testing only. This is an offline method. Can be called before authorization
2018-08-30 14:55:42 +00:00
testCallEmpty = Ok;
2022-12-30 18:28:59 +00:00
2019-06-07 10:56:06 +00:00
//@description Returns the received string; for testing only. This is an offline method. Can be called before authorization @x String to return
2018-08-30 14:55:42 +00:00
testCallString x:string = TestString;
2022-12-30 18:28:59 +00:00
2019-06-07 10:56:06 +00:00
//@description Returns the received bytes; for testing only. This is an offline method. Can be called before authorization @x Bytes to return
2018-08-30 14:55:42 +00:00
testCallBytes x:bytes = TestBytes;
2022-12-30 18:28:59 +00:00
2019-06-07 10:56:06 +00:00
//@description Returns the received vector of numbers; for testing only. This is an offline method. Can be called before authorization @x Vector of numbers to return
2018-08-30 14:55:42 +00:00
testCallVectorInt x:vector<int32> = TestVectorInt;
2022-12-30 18:28:59 +00:00
2019-06-07 10:56:06 +00:00
//@description Returns the received vector of objects containing a number; for testing only. This is an offline method. Can be called before authorization @x Vector of objects to return
2018-08-30 14:55:42 +00:00
testCallVectorIntObject x:vector<testInt> = TestVectorIntObject;
2022-12-30 18:28:59 +00:00
2019-06-07 10:56:06 +00:00
//@description Returns the received vector of strings; for testing only. This is an offline method. Can be called before authorization @x Vector of strings to return
2018-08-30 14:55:42 +00:00
testCallVectorString x:vector<string> = TestVectorString;
2022-12-30 18:28:59 +00:00
2019-06-07 10:56:06 +00:00
//@description Returns the received vector of objects containing a string; for testing only. This is an offline method. Can be called before authorization @x Vector of objects to return
2018-08-30 14:55:42 +00:00
testCallVectorStringObject x:vector<testString> = TestVectorStringObject;
2022-12-30 18:28:59 +00:00
2019-06-07 10:56:06 +00:00
//@description Returns the squared received number; for testing only. This is an offline method. Can be called before authorization @x Number to square
2018-08-30 14:55:42 +00:00
testSquareInt x:int32 = TestInt;
2022-12-30 18:28:59 +00:00
2019-06-07 10:56:06 +00:00
//@description Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization
2018-08-30 14:55:42 +00:00
testNetwork = Ok;
2022-12-30 18:28:59 +00:00
//@description Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization
//@server Proxy server IP address
//@port Proxy server port
//@type Proxy type
//@dc_id Identifier of a datacenter with which to test connection
//@timeout The maximum overall timeout for the request
2020-02-03 12:56:20 +00:00
testProxy server:string port:int32 type:ProxyType dc_id:int32 timeout:double = Ok;
2022-12-30 18:28:59 +00:00
2018-08-30 14:55:42 +00:00
//@description Forces an updates.getDifference call to the Telegram servers; for testing only
testGetDifference = Ok;
2022-12-30 18:28:59 +00:00
2019-06-07 10:56:06 +00:00
//@description Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization
2018-08-30 14:55:42 +00:00
testUseUpdate = Update;
2022-12-30 18:28:59 +00:00
2020-11-30 09:33:47 +00:00
//@description Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously @error The error to be returned
2019-09-10 12:36:54 +00:00
testReturnError error:error = Error;