· 8 years ago · Feb 16, 2018, 07:02 AM
1double ? = Double;
2string ? = String;
3
4int32 = Int32;
5int53 = Int53;
6int64 = Int64;
7bytes = Bytes;
8
9boolFalse = Bool;
10boolTrue = Bool;
11
12vector {t:Type} # [ t ] = Vector t;
13
14
15//@description Object of this type may be returned on every function call in case of the error
16//@code Error code, maybe changed in the future. If code == 406, error message should not be processed in any way and shouldn't be showed to the user
17//@message Error message, may be changed in the future
18error code:int32 message:string = Error;
19
20
21//@description Object of this type returns on successful function call for some functions
22ok = Ok;
23
24
25//@class AuthCodeType @description Provides information about the way an authentication code is delivered to the user
26
27//@description Code is delivered through private Telegram message, which can be viewed in the other client @length Length of the code
28authCodeTypeMessage length:int32 = AuthCodeType;
29
30//@description Code is delivered by SMS to the specified phone number @length Length of the code
31authCodeTypeSms length:int32 = AuthCodeType;
32
33//@description Code is delivered by phone call to the specified phone number @length Length of the code
34authCodeTypeCall length:int32 = AuthCodeType;
35
36//@description Code is delivered by the immediately cancelled call to the specified phone number. Number from which the call was done is the code @pattern Pattern of the phone number from which the call will be done
37authCodeTypeFlashCall pattern:string = AuthCodeType;
38
39
40//@class AuthState @description Represents current authorization state of the Client
41
42//@description TDLib needs user's phone number to authorize
43authStateWaitPhoneNumber = AuthState;
44
45//@description TDLib needs user authentication code to finish authorization @is_registered True, if user is already registered @code_type Describes the way, code was sent to the user @next_code_type Describes the way, next code will be sent to the user, nullable @timeout Timeout in seconds before code should be resent by calling resendAuthCode
46authStateWaitCode is_registered:Bool code_type:AuthCodeType next_code_type:AuthCodeType timeout:int32 = AuthState;
47
48//@description User is authorized but he needs to enter its password to begin to use application @password_hint Hint on password, can be empty @has_recovery_email Is recovery email set up
49//@recovery_email_pattern Pattern of email to which recovery mail was sent, empty before recovery email was sent
50authStateWaitPassword password_hint:string has_recovery_email:Bool recovery_email_pattern:string = AuthState;
51
52//@description User is successfully authorized. TDLib can answer queries
53authStateOk = AuthState;
54
55//@description User is currently logging out
56authStateLoggingOut = AuthState;
57
58
59//@description Represents current state of the two-step verification @has_password Is password set up @password_hint Hint on password, can be empty @has_recovery_email Is recovery email set up @unconfirmed_recovery_email_pattern Pattern of email to which confirmation mail was sent
60passwordState has_password:Bool password_hint:string has_recovery_email:Bool unconfirmed_recovery_email_pattern:string = PasswordState;
61
62//@description Contains information available to the user after requesting password recovery @recovery_email_pattern Pattern of email to which recovery mail was sent
63passwordRecoveryInfo recovery_email_pattern:string = PasswordRecoveryInfo;
64
65//@description Contains information about set up recovery email @recovery_email Recovery email
66recoveryEmail recovery_email:string = RecoveryEmail;
67
68
69//@description Returns information about availability of temporary password, which should be used for payments @has_password True, if we have temporary password @valid_for Time left before temporary password expires, seconds
70temporaryPasswordState has_password:Bool valid_for:int32 = TemporaryPasswordState;
71
72
73//@description Represents a file
74//@id Unique file identifier
75//@persistent_id Persistent file identifier, if exists. Can be used across application restarts or even other devices for current logged user. If begins with "http://" or "https://", it is HTTP URL of the file. Currently, TDLib is unable to download files if only they URL is known.
76//-If downloadFile is called on a such file or it is sended to a secret chat TDLib starts file generation process by sending to the client updateFileGenerationStart with HTTP URL in the original_path and "#url#" as conversion string. Client supposed to generate the file by downloading it to the specified location
77//@size File size, 0 if unknown
78//@is_being_downloaded True, if the file is currently being downloaded
79//@local_size Size of locally available part of the file. If size != 0 && local_size == size, full file is available locally
80//@is_being_uploaded True, if the file is currently being uploaded
81//@remote_size Size of remotely available part of the file. If size != 0 && remote_size == size, the file is available remotely
82//@path Local path to the available file part, may be empty
83file id:int32 persistent_id:string size:int32 is_being_downloaded:Bool local_size:int32 is_being_uploaded:Bool remote_size:int32 path:string = File;
84
85//@class InputFile @description Points to some file
86
87//@description File defined by its id @id Unique file identifier
88inputFileId id:int32 = InputFile;
89
90//@description File defined by its persistent id @persistent_id Persistent file identifier
91inputFilePersistentId persistent_id:string = InputFile;
92
93//@description File deifned by local path @path Local path to the file
94inputFileLocal path:string = InputFile;
95
96//@description File generated by the client @original_path Local path to a file from which the file is generated, may be empty if there is no such file @conversion String specifying conversion applied to the original file, should be persistent across application restart @expected_size Expected size of the generated file, 0 if unknown
97inputFileGenerated original_path:string conversion:string expected_size:int32 = InputFile;
98
99
100//@description Photo description @type Thumbnail type (see https://core.telegram.org/constructor/photoSize) @photo Information about photo file @width Photo width @height Photo height
101photoSize type:string photo:file width:int32 height:int32 = PhotoSize;
102
103//@description Position on a photo where a mask should be placed @point Part of a face relative to which the mask should be placed. 0 - forehead, 1 - eyes, 2 - mouth, 3 - chin
104//@x_shift Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position
105//@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.
106//@scale Mask scaling coefficient. For example, 2.0 means double size
107maskPosition point:int32 x_shift:double y_shift:double scale:double = MaskPosition;
108
109
110//@description Represent part of the text which needs to be formatted in some unusual way @offset Offset of the entity in UTF-16 code points @length Length of the entity in UTF-16 code points @type Type of the entity
111textEntity offset:int32 length:int32 type:TextEntityType = TextEntity;
112
113
114//@description Describes animation file. Animation should be encoded in gif or mp4 format @duration Duration of the animation in seconds as defined by sender @width Width of the animation @height Height of the animation
115//@file_name Original name of a file as defined by sender @mime_type MIME type of a file, usually "image/gif" or "video/mp4" @thumb Animation thumb, nullable @animation File with the animation
116animation duration:int32 width:int32 height:int32 file_name:string mime_type:string thumb:photoSize animation:file = Animation;
117
118//@description Describes audio file. Audio is usually in mp3 format @duration Duration of the audio in seconds as defined by sender @title Title of the audio as defined by sender @performer Performer of the audio as defined by sender
119//@file_name Original name of a file as defined by sender @mime_type MIME type of a file as defined by sender @album_cover_thumb Thumb of the album's cover as defined by sender. Full size thumb should be extracted from the downloaded file, nullable @audio File with the audio
120audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_thumb:photoSize audio:file = Audio;
121
122//@description Describes document of any type @file_name Original name of a file as defined by sender @mime_type MIME type of file as defined by sender
123//@thumb Document thumb as defined by sender, nullable @document File with document
124document file_name:string mime_type:string thumb:photoSize document:file = Document;
125
126//@description Describes photo @id Photo identifier, 0 for deleted photo @has_stickers True, if some stickers was added to the photo @sizes Available variants of photo of different sizes
127photo id:int64 has_stickers:Bool sizes:vector<photoSize> = Photo;
128
129//@description Describes sticker @set_id Identifier of sticker set to which the sticker belongs or 0 if none @width Sticker width as defined by sender @height Sticker height as defined by sender
130//@emoji Emoji corresponding to the sticker @is_mask True, if the sticker is a mask @mask_position Position where the mask should be placed, nullable @thumb Sticker thumb in webp or jpeg format, nullable @sticker File with sticker
131sticker set_id:int64 width:int32 height:int32 emoji:string is_mask:Bool mask_position:maskPosition thumb:photoSize sticker:file = Sticker;
132
133//@description Describes video file @duration Duration of the video in seconds as defined by sender @width Video width as defined by sender @height Video height as defined by sender
134//@file_name Original name of a file as defined by sender @mime_type MIME type of a file as defined by sender @has_stickers True, if some stickers was added to the photo @thumb Video thumb as defined by sender, nullable @video File with the video
135video duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool thumb:photoSize video:file = Video;
136
137//@description Describes video note. Video must have equal width and height, cropped to circle and stored in mpeg4 format @duration Duration of the video in seconds as defined by sender @length Video width and height as defined by sender @thumb Video thumb as defined by sender, nullable @video File with the video
138videoNote duration:int32 length:int32 thumb:photoSize video:file = VideoNote;
139
140//@description Describes voice note. Voice must be encoded with Opus codec and must be stored inside Ogg container @duration Duration of the voice record in seconds as defined by sender
141//@waveform Waveform representation of the voice in 5-bit format @mime_type MIME type of a file as defined by sender @voice File with the voice record
142voice duration:int32 waveform:bytes mime_type:string voice:file = Voice;
143
144//@description Describes user contact @phone_number User's phone number @first_name User first name, 1-255 characters @last_name User last name @user_id User identifier if known, 0 otherwise
145contact phone_number:string first_name:string last_name:string user_id:int32 = Contact;
146
147//@description Describes location on Earth @latitude Latitude of location in degrees as defined by sender @longitude Longitude of location in degrees as defined by sender
148location latitude:double longitude:double = Location;
149
150//@description Describes venue @location Venue location as defined by sender @title Venue name as defined by sender @address Venue address as defined by sender @provider Provider of venue database as defined by sender. Only "foursquare" need to be supported currently
151//@id Identifier of the venue in provider database as defined by sender
152venue location:location title:string address:string provider:string id:string = Venue;
153
154//@description Describes a game @id Game id @short_name Game short name, to share a game use a URL https://t.me/{bot_username}?game={game_short_name} @title Game title @text Game text, usually containing game scoreboards
155//@text_entities Entities contained in the text @param_description Game description @photo Game photo @animation Game animation, nullable
156game id:int64 short_name:string title:string text:string text_entities:vector<textEntity> description:string photo:photo animation:animation = Game;
157
158
159//@description Describes user profile photo @id Photo identifier, 0 for empty photo. Can be used to find photo in list of userProfilePhotos
160//@small Small (160x160) user profile photo @big Big (640x640) user profile photo
161profilePhoto id:int64 small:file big:file = ProfilePhoto;
162
163//@description Describes chat photo @small Small (160x160) chat photo @big Big (640x640) chat photo
164chatPhoto small:file big:file = ChatPhoto;
165
166
167//@class LinkState @description Represents ordered relationship between two users
168
169//@description Other user's phone number doesn't known
170linkStateNone = LinkState;
171
172//@description Other user's phone number is known but user not in contacts list
173linkStateKnowsPhoneNumber = LinkState;
174
175//@description Other user is in contacts list, particularly its phone number is known
176linkStateContact = LinkState;
177
178
179//@class UserType @description Allows to distinguish different kinds of users: general users, deleted users and bots
180
181//@description General user
182userTypeGeneral = UserType;
183
184//@description Deleted user or deleted bot. There is no any information about it except user_id. None of active action can be performed with deleted user
185userTypeDeleted = UserType;
186
187//@description Bot (see https://core.telegram.org/bots) @can_join_group_chats If true, bot can be invited to group and supergroup chats
188//@can_read_all_group_chat_messages If true, bot can read all group or supergroup chat messages, not only addressed to him. In private chats bot always can read all messages
189//@is_inline True, if bot supports inline queries @inline_query_placeholder Placeholder for inline query @need_location If true, user location should be sent with every inline query to this bot
190userTypeBot can_join_group_chats:Bool can_read_all_group_chat_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool = UserType;
191
192//@description Currently there is no any information about the user except user_id. It can happens very-very rarely. None of active action can be performed with unknown user
193userTypeUnknown = UserType;
194
195
196//@description Represents command supported by bot @command Text of the bot command @param_description Description of the bot command
197botCommand command:string description:string = BotCommand;
198
199//@description Provides information about bot and command supported by him @param_description Big description shown in user info page @commands List of commands cupported by bot
200botInfo description:string commands:vector<botCommand> = BotInfo;
201
202
203//@description Represents user @id User identifier @first_name User first name @last_name User last name @username User username
204//@phone_number User's phone number @status User's online status @profile_photo User profile photo, nullable
205//@my_link Relationships from me to other user @foreign_link Relationships from other user to me @is_verified True, if user is verified @restriction_reason If non-empty, contains the reason, why access to this user must be restricted. Format of the string is "{type}: {description}".
206//-{type} contains type of the restriction and at least one of the suffixes "-all", "-ios", "-android", "-wp", which describes platforms on which access should be restricted. For example, "terms-ios-android". {description} contains human-readable description of the restriction, which can be showed to the user
207//@have_access If false, the user is inaccessible and the only known information about it is inside this class. It can't be passed to any method except GetUser. Currently it can be false only for inaccessible authors of the channel posts @type Type of the user @language_code Bots only. IETF language tag of users language
208user id:int32 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto my_link:LinkState foreign_link:LinkState is_verified:Bool restriction_reason:string have_access:Bool type:UserType language_code:string = User;
209
210//@description Gives full information about a user (except full list of profile photos) @is_blocked Is user blacklisted by the current user @can_be_called True, if the user can be called @has_private_calls True, if the user can't be called only because of his privacy settings
211//@about Short user bio or bot share text @common_chat_count Number of common chats between the user and current user, 0 for the current user @bot_info Information about bot if user is a bot, nullable
212userFull is_blocked:Bool can_be_called:Bool has_private_calls:Bool about:string common_chat_count:int32 bot_info:botInfo = UserFull;
213
214//@description Contains part of the list of user photos @total_count Total number of user profile photos @photos List of photos
215userProfilePhotos total_count:int32 photos:vector<photo> = UserProfilePhotos;
216
217//@description Represents list of users @total_count Approximate total count of found users @user_ids List of user identifiers
218users total_count:int32 user_ids:vector<int32> = Users;
219
220
221//@class ChatMemberStatus @description Provides information about status of a member in the chat
222
223//@description User is creator of the chat which has all administrator priviledges
224chatMemberStatusCreator = ChatMemberStatus;
225
226//@description User is a chat member with some additional priviledges. In groups, administrators can edit and delete other messages, add new members and ban unpriviledged members
227//@can_be_edited True, if current user has rights to edit administrator privileges of that user
228//@can_change_info True, if the administrator can change chat title, photo and other settings
229//@can_post_messages True, if the administrator can create channel posts, broadcast channels only
230//@can_edit_messages True, if the administrator can edit messages of other users, broadcast channels only
231//@can_delete_messages True, if the administrator can delete messages of other users
232//@can_invite_users True, if the administrator can invite new users to the chat
233//@can_restrict_members True, if the administrator can restrict, ban or unban chat members
234//@can_pin_messages True, if the administrator can pin messages, supergroup channels only
235//@can_promote_members True, if the administrator can add new administrators with a subset of his own privileges or demote administrators directly or indirectly promoted by him
236chatMemberStatusAdministrator can_be_edited:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool = ChatMemberStatus;
237
238//@description User is a member of the chat, but have no any additional privileges or restrictions
239chatMemberStatusMember = ChatMemberStatus;
240
241//@description User has some additional restrictions in the chat. Unsupported in group chats and broadcast channels
242//@is_member True, if user is chat member
243//@restricted_until_date Date when the user will be unrestricted, 0 if never. Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time it considered to be restricted forever
244//@can_send_messages True, if the user can send text messages, contacts, locations and venues
245//@can_send_media_messages True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
246//@can_send_other_messages True, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages
247//@can_add_web_page_previews True, if user may add web page preview to his messages, implies can_send_messages
248chatMemberStatusRestricted is_member:Bool restricted_until_date:int32 can_send_messages:Bool can_send_media_messages:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool = ChatMemberStatus;
249
250//@description User is not a chat member
251chatMemberStatusLeft = ChatMemberStatus;
252
253//@description User was banned (and obviously is not a chat member) and can't return to the chat or view messages
254//@banned_until_date Date when the user will be unbanned, 0 if never. Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time it considered to be banned forever
255chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus;
256
257
258//@description User with information about its chat joining/leaving @user_id User identifier of the chat member @inviter_user_id Identifier of a user invited/promoted/banned this member in the chat, 0 if unknown
259//@join_date Date the user has joined a chat, unix time @status Status of the member in the chat @bot_info Information about bot if user is a bot, nullable. Can be null even for bot if bot is not a chat member
260chatMember user_id:int32 inviter_user_id:int32 join_date:int32 status:ChatMemberStatus bot_info:botInfo = ChatMember;
261
262//@description Contains list of chat members @total_count Approximate total count of found chat members @members List of members
263chatMembers total_count:int32 members:vector<chatMember> = ChatMembers;
264
265
266//@class ChannelMembersFilter @description Specifies kind of chat users to return in getChannelMembers
267
268//@description Return recently active users in reverse chronological order
269channelMembersFilterRecent = ChannelMembersFilter;
270
271//@description Return creator and administrators
272channelMembersFilterAdministrators = ChannelMembersFilter;
273
274//@description Searches for channel members using specified query @query Query to search for
275channelMembersFilterSearch query:string = ChannelMembersFilter;
276
277//@description Return restricted channel members, administrators only @query Query to search for
278channelMembersFilterRestricted query:string = ChannelMembersFilter;
279
280//@description Return banned from the channel users, administrators only @query Query to search for
281channelMembersFilterBanned query:string = ChannelMembersFilter;
282
283//@description Return bot members of the channel
284channelMembersFilterBots = ChannelMembersFilter;
285
286
287//@description Represents a group of zero or more other users @id Group identifier
288//@member_count Group member count
289//@status Status of the current user in the group
290//@everyone_is_administrator True, if all members granted administrator rights in the group
291//@is_active True, if group is active
292//@migrated_to_channel_id Identifier of channel (supergroup) to which this group was migrated or 0 if none
293group id:int32 member_count:int32 status:ChatMemberStatus everyone_is_administrator:Bool is_active:Bool migrated_to_channel_id:int32 = Group;
294
295//@description Gives full information about a group @creator_user_id User identifier of the group creator, 0 if unknown @members Group members @invite_link Invite link for this group, available only for group creator and only after it is generated at least once
296groupFull creator_user_id:int32 members:vector<chatMember> invite_link:string = GroupFull;
297
298
299//@description Represents a channel with zero or more subscribers. There two different kinds of channels: supergroups and broadcast channels
300//@id Channel identifier
301//@username Channel username, empty for private channels
302//@date Date when current user has joined the channel or date when channel was created, if user is not a member. Unix time
303//@status Status of the current user in the channel
304//@anyone_can_invite True, if any member of the supergroup can invite other members. If the channel is not a supergroup, the field is meaningless
305//@sign_messages True, if messages sent to the channel should content information about the sender. If the channel is a supergroup, the field is meaningless
306//@is_supergroup True, if channel is a supergroup and is not a broadcast
307//@is_verified True, if the channel is verified
308//@restriction_reason If non-empty, contains the reason, why access to this channel must be restricted. Format of the string is "{type}: {description}".
309//-{type} contains type of the restriction and at least one of the suffixes "-all", "-ios", "-android", "-wp", which describes platforms on which access should be restricted. For example, "terms-ios-android". {description} contains human-readable description of the restriction, which can be showed to the user
310channel id:int32 username:string date:int32 status:ChatMemberStatus anyone_can_invite:Bool sign_messages:Bool is_supergroup:Bool is_verified:Bool restriction_reason:string = Channel;
311
312//@description Gives full information about a channel
313//@param_description Channel description
314//@member_count Channel member count, 0 if unknown
315//@administrator_count Number of privileged users in the channel, 0 if unknown
316//@restricted_count Number of restricted users in the channel, 0 if unknown
317//@banned_count Number of users banned from the channel, 0 if unknown
318//@can_get_members True, if members of the channel can be retrieved
319//@can_set_username True, if the channel can be made public
320//@can_set_sticker_set True, if the channel sticker set can be changed
321//@sticker_set_id Identifier of channel sticker set, or 0 if none
322//@invite_link Invite link for this channel
323//@pinned_message_id Identifier of the pinned message in the channel chat, or 0 if none
324//@migrated_from_group_id Identifier of the group, this supergroup migrated from, or 0 if none
325//@migrated_from_max_message_id Identifier of last message in the group chat migrated from, or 0 if none
326channelFull description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 can_get_members:Bool can_set_username:Bool can_set_sticker_set:Bool sticker_set_id:int64 invite_link:string pinned_message_id:int53 migrated_from_group_id:int32 migrated_from_max_message_id:int53 = ChannelFull;
327
328
329//@description Represents a secret chat
330//@id Secret chat identifier
331//@user_id Identifier of the interlocutor
332//@state State of the secret chat, 0 - yet not created, 1 - active, 2 - closed
333//@is_outbound True if chat was created by the current logged in user, false otherwise
334//@ttl Current message TTL setting for the chat in seconds
335//@key_hash Hash of the current used key for comparison with the hash of the interlocutor's key. String of 36 bytes, which should be used to make a 12x12 square image with a color depth of 4. First 16 bytes should be used to make a central 8 * 8 square, left 20 bytes should be used to construct a border of width 2 around that square.
336//-Alternatively first 32 bytes of the hash can be converted to hex and printed as 32 2-digit hex numbers
337//@layer Secret chat layer, determining features supported by other client. Video notes are supported if layer >= 66
338secretChat id:int32 user_id:int32 state:int32 is_outbound:Bool ttl:int32 key_hash:bytes layer:int32 = SecretChat;
339
340
341//@description Contains chat invite link @invite_link Chat invite link
342chatInviteLink invite_link:string = ChatInviteLink;
343
344//@description Contains information about chat invite link @chat_id Chat identifier of the invite link or 0 if user is not a member of this chat @title Title of the chat @photo Chat photo, nullable @member_count Total member count @member_user_ids User identifiers of some chat members that may be known to the current user
345//@is_group True, if the chat is a group chat @is_channel True, if the chat is a channel chat @is_public_channel True, if the chat is a channel chat with set up username @is_supergroup_channel True, if the chat is a supergroup channel chat
346chatInviteLinkInfo chat_id:int53 title:string photo:chatPhoto member_count:int32 member_user_ids:vector<int32> is_group:Bool is_channel:Bool is_public_channel:Bool is_supergroup_channel:Bool = ChatInviteLinkInfo;
347
348
349//@class MessageForwardInfo @description Contains information about initial sender of forwarded message
350
351//@description Message is originally written by known user @sender_user_id Identifier of a user, who originally sent this message @date Date when message was originally sent
352messageForwardedFromUser sender_user_id:int32 date:int32 = MessageForwardInfo;
353
354//@description Message is orifinally a channel post @chat_id Identifier of a chat from which message is forwarded @author_signature Post author signature
355//@date Date when message was originally sent @message_id Message identifier of the message from which the message is forwarded, 0 if unknown
356messageForwardedPost chat_id:int53 author_signature:string date:int32 message_id:int53 = MessageForwardInfo;
357
358
359//@class MessageSendState @description Contains information about sending state of the message
360
361//@description Message is incoming
362messageIsIncoming = MessageSendState;
363
364//@description Message is outgoing but is yet not delivered to the server
365messageIsBeingSent = MessageSendState;
366
367//@description Message was synchronized with the server
368messageIsSuccessfullySent = MessageSendState;
369
370//@description Message is failed to send
371messageIsFailedToSend = MessageSendState;
372
373
374//@description Describes message
375//@id Unique message identifier
376//@sender_user_id Identifier of the user who sent the message, 0 if unknown. It is unknown for channel posts
377//@chat_id Chat identifier
378//@send_state Information about sending state of the message
379//@can_be_edited True, if message can be edited
380//@can_be_forwarded True, if message can be forwarded
381//@can_be_deleted_only_for_self True, if message can be deleted only for self, other users will continue to see it
382//@can_be_deleted_for_everyone True, if message can be deleted for everyone
383//@is_post True, if message is channel post. All messages to broadcast channels are posts, all other messages are not posts
384//@contains_unread_mention True, if message contains unread mention of the current user
385//@date Date when message was sent, unix time
386//@edit_date Date when message was edited last time, unix time
387//@forward_info Information about initial message sender, nullable
388//@reply_to_message_id If non-zero, identifier of the message this message replies to, can be identifier of deleted message
389//@ttl Message TTL in seconds, 0 if none. TDLib will send updateDeleteMessages or updateMessageContent when TTL expires
390//@ttl_expires_in Time left for message TTL to expire in seconds
391//@via_bot_user_id If non-zero, user identifier of the bot this message is sent via
392//@author_signature For channel posts, optional author signature
393//@views Number of times this message was viewed
394//@content Content of the message
395//@reply_markup Reply markup for the message, nullable
396message id:int53 sender_user_id:int32 chat_id:int53 send_state:MessageSendState can_be_edited:Bool can_be_forwarded:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_everyone:Bool is_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:MessageForwardInfo reply_to_message_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int32 author_signature:string views:int32 content:MessageContent reply_markup:ReplyMarkup = Message;
397
398//@description Contains list of messages @total_count Approximate total count of found messages @messages List of messages
399messages total_count:int32 messages:vector<message> = Messages;
400
401//@description Contains list of found by search messages @messages List of messages @next_from_search_id Value to pass as from_search_id to get more results
402foundMessages messages:vector<message> next_from_search_id:int64 = FoundMessages;
403
404
405//@class NotificationSettingsScope @description Describes kinds of chat for which notification settings are applied
406
407//@description Notification settings applied to particular chat @chat_id Chat identifier
408notificationSettingsScopeChat chat_id:int53 = NotificationSettingsScope;
409
410//@description Notification settings applied to all private chats
411notificationSettingsScopePrivateChats = NotificationSettingsScope;
412
413//@description Notification settings applied to all group and broadcast channel chats (supergroup channels have no common settings)
414notificationSettingsScopeGroupChats = NotificationSettingsScope;
415
416//@description Notification settings applied to all chats
417notificationSettingsScopeAllChats = NotificationSettingsScope;
418
419
420//@description Contains information about notification settings for chat or chats @mute_for Time left before notifications will be unmuted, seconds @sound Audio file name for notifications, iPhone apps only @show_preview Display message text/media in notification
421notificationSettings mute_for:int32 sound:string show_preview:Bool = NotificationSettings;
422
423
424//@description Contains information about draft of a message @reply_to_message_id Identifier of a message to reply to or 0 @input_message_text Content of a draft message, always should be of a type inputMessageText
425draftMessage reply_to_message_id:int53 input_message_text:InputMessageContent = DraftMessage;
426
427
428//@class ChatType @description Describes type of a chat
429
430//@description Ordinary chat with a user @user_id User identifier
431chatTypePrivate user_id:int32 = ChatType;
432
433//@description Chat with zero or more other users @group_id Group identifier
434chatTypeGroup group_id:int32 = ChatType;
435
436//@description Chat with unlimited number of members @channel_id Channel identifier @is_supergroup True, if the channel is a supergroup and is not a broadcast
437chatTypeChannel channel_id:int32 is_supergroup:Bool = ChatType;
438
439//@description Secret chat with a user @secret_chat_id Secret chat identifier @user_id User identifier of the peer
440chatTypeSecret secret_chat_id:int32 user_id:int32 = ChatType;
441
442
443//@description Chat (private chat or group chat or channel chat)
444//@id Chat unique identifier
445//@type Information about type of the chat
446//@title Chat title
447//@photo Chat photo, nullable
448//@top_message Last message in the chat, nullable
449//@order Parameter by descending of which chats are sorted in the chat list. If order of two chats is equal, then they need to be sorted by id also in descending order. If order == 0, position of the chat in the list is undetermined
450//@is_pinned True, if the chat is pinned
451//@unread_count Count of unread messages in the chat
452//@last_read_inbox_message_id Identifier of last read incoming message
453//@last_read_outbox_message_id Identifier of last read outgoing message
454//@unread_mention_count Count of unread messages with mention/reply in the chat
455//@notification_settings Notification settings for this chat
456//@reply_markup_message_id Identifier of the message from which reply markup need to be used or 0 if there is no default custom reply markup in the chat
457//@draft_message Draft of a message in the chat, nullable. parse_mode in input_message_text always will be null
458//@client_data Client specified data, associated with the chat. For example, chat position or local chat notification settings may be stored here. Persistent if message db is used
459chat id:int53 type:ChatType title:string photo:chatPhoto top_message:message order:int64 is_pinned:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:notificationSettings reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat;
460
461//@description Represents list of chats @chat_ids List of chat identifiers
462chats chat_ids:vector<int53> = Chats;
463
464
465//@class KeyboardButtonType @description Describes type of the keyboard button
466
467//@description Simple button with a text, which should be sent when the button is pressed
468keyboardButtonTypeText = KeyboardButtonType;
469
470//@description A button which sends user's phone number when pressed, available only in private chats
471keyboardButtonTypeRequestPhoneNumber = KeyboardButtonType;
472
473//@description A button which sends user location when pressed, available only in private chats
474keyboardButtonTypeRequestLocation = KeyboardButtonType;
475
476
477//@description Represents one button of the bot keyboard @text Text of the button @type Type of the button
478keyboardButton text:string type:KeyboardButtonType = KeyboardButton;
479
480
481//@class InlineKeyboardButtonType @description Describes type of the inline keyboard button
482
483//@description A button which opens the specified URL @url URL to open
484inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType;
485
486//@description A button which sends to the bot special callback query @data Data to be sent to the bot through a callack query
487inlineKeyboardButtonTypeCallback data:bytes = InlineKeyboardButtonType;
488
489//@description A button with a game which sends to the bot special callback query, must be in the first column and row of the keyboard, can be attached only to a message with content of the type messageGame
490inlineKeyboardButtonTypeCallbackGame = InlineKeyboardButtonType;
491
492//@description A button which forces inline query to the bot to be substitued in the input field @query Inline query to be sent to the bot @in_current_chat True, if the inline query should be sent from the current chat
493inlineKeyboardButtonTypeSwitchInline query:string in_current_chat:Bool = InlineKeyboardButtonType;
494
495//@description A button for buying, must be in the first column and row of the keyboard, can be attached only to a message with content of the type messageInvoice
496inlineKeyboardButtonTypeBuy = InlineKeyboardButtonType;
497
498
499//@description Represents one button of the inline keyboard @text Text of the button @type Type of the button
500inlineKeyboardButton text:string type:InlineKeyboardButtonType = InlineKeyboardButton;
501
502
503//@class ReplyMarkup @description Contains description of custom keyboard and actions with it for fast reply to bots
504
505//@description Instruct clients to remove keyboard after receiving this message. This kind of keyboard can't be received. Instead UpdateChatReplyMarkup with message_id == 0 will be send
506//@personal Keyboard is removed only for mentioned users or replied to user
507replyMarkupRemoveKeyboard personal:Bool = ReplyMarkup;
508
509//@description Instruct clients to force reply to this message @personal Forced reply is used automatically only for mentioned users or replied to chat user, for incoming messages it is true if and only if forced reply needs to be automatically showed to the current user
510replyMarkupForceReply personal:Bool = ReplyMarkup;
511
512//@description Contains custom keyboard layout for fast reply to bot
513//@rows List of rows of bot keyboard buttons
514//@resize_keyboard Do clients need to resize keyboard vertically
515//@one_time Do clients need to hide keyboard after use
516//@personal Keyboard is showed automatically only for mentioned users or replied to user, for incoming messages it is true if and only if keyboard needs to be automatically showed to current user
517replyMarkupShowKeyboard rows:vector<vector<keyboardButton>> resize_keyboard:Bool one_time:Bool personal:Bool = ReplyMarkup;
518
519//@description Contains inline keyboard layout
520//@rows List of rows of inline keyboard buttons
521replyMarkupInlineKeyboard rows:vector<vector<inlineKeyboardButton>> = ReplyMarkup;
522
523
524//@class RichText @description Describes a text inside web page instant view
525
526//@description Plain text @text The text
527richTextPlain text:string = RichText;
528
529//@description Bold rich text @text The text
530richTextBold text:RichText = RichText;
531
532//@description Italicized rich text @text The text
533richTextItalic text:RichText = RichText;
534
535//@description Underlined rich text @text The text
536richTextUnderline text:RichText = RichText;
537
538//@description Striked through rich text @text The text
539richTextStrikethrough text:RichText = RichText;
540
541//@description Fixed width rich text @text The text
542richTextFixed text:RichText = RichText;
543
544//@description Rich text URL link @text The text @url The URL
545richTextUrl text:RichText url:string = RichText;
546
547//@description Rich text email link @text The text @email The email
548richTextEmail text:RichText email:string = RichText;
549
550//@description Concatenation of rich texts @texts The texts
551richTextConcatenation texts:vector<RichText> = RichText;
552
553
554//@class PageBlock @description Describes a block of web page instant view
555
556//@description Title of a page @title The title
557pageBlockTitle title:RichText = PageBlock;
558
559//@description Subtitle of a page @subtitle The subtitle
560pageBlockSubtitle subtitle:RichText = PageBlock;
561
562//@description Author and publish date of a page @author The author @publish_date Date of article publish, unix time. 0 if unknown
563pageBlockAuthorDate author:RichText publish_date:int32 = PageBlock;
564
565//@description A header @header The header
566pageBlockHeader header:RichText = PageBlock;
567
568//@description A subheader @subheader The subheader
569pageBlockSubheader subheader:RichText = PageBlock;
570
571//@description A text paragraph @text Paragraph text
572pageBlockParagraph text:RichText = PageBlock;
573
574//@description Preformatted text paragraph @text Paragraph text @language Programming language for which the text should be formatted
575pageBlockPreformatted text:RichText language:string = PageBlock;
576
577//@description Footer of a page @footer The footer
578pageBlockFooter footer:RichText = PageBlock;
579
580//@description An empty block separating parts of a page
581pageBlockDivider = PageBlock;
582
583//@description Invisible anchor on a page which can be used in a URL to open a page from the specified anchor @name Name of the anchor
584pageBlockAnchor name:string = PageBlock;
585
586//@description List of texts @items Texts @is_ordered True, if items should be marked with numbers
587pageBlockList items:vector<RichText> is_ordered:Bool = PageBlock;
588
589//@description Block quote @text Quote text @caption Quote caption
590pageBlockBlockQuote text:RichText caption:RichText = PageBlock;
591
592//@description Pull quote @text Quote text @caption Quote caption
593pageBlockPullQuote text:RichText caption:RichText = PageBlock;
594
595//@description An animation @animation The animation, nullable @caption Animation caption @need_autoplay True, if the animation should be autoplayed
596pageBlockAnimation animation:animation caption:RichText need_autoplay:Bool = PageBlock;
597
598//@description An audio @audio The audio, nullable @caption Audio caption
599pageBlockAudio audio:audio caption:RichText = PageBlock;
600
601//@description A photo @photo The photo, nullable @caption Photo caption
602pageBlockPhoto photo:photo caption:RichText = PageBlock;
603
604//@description A video @video The video, nullable @caption Video caption @need_autoplay True, if the video should be autoplayed @is_looped True, if the video is looped
605pageBlockVideo video:video caption:RichText need_autoplay:Bool is_looped:Bool = PageBlock;
606
607//@description Page cover @cover The cover
608pageBlockCover cover:PageBlock = PageBlock;
609
610//@description Embedded web page @url Web page URL, if available @html HTML-markup of the embedded page @poster_photo Poster photo if available, nullable @width Block width @height Block height @caption Block caption @is_full_width True, if the block should be full width @allow_scrolling True, if scrolling should be allowed
611pageBlockEmbedded url:string html:string poster_photo:photo width:int32 height:int32 caption:RichText is_full_width:Bool allow_scrolling:Bool = PageBlock;
612
613//@description Embedded post @url Web page URL @author Post author @author_photo Post author photo @date Post date, unix time. 0 if unknown @page_blocks Post content @caption Post caption
614pageBlockEmbeddedPost url:string author:string author_photo:photo date:int32 page_blocks:vector<PageBlock> caption:RichText = PageBlock;
615
616//@description A collage @page_blocks Collage item contents @caption Block caption
617pageBlockCollage page_blocks:vector<PageBlock> caption:RichText = PageBlock;
618
619//@description A slideshow @page_blocks Slideshow item contents @caption Block caption
620pageBlockSlideshow page_blocks:vector<PageBlock> caption:RichText = PageBlock;
621
622//@description A link to a chat @title Chat title @photo Chat photo, nullable @username Chat username by which all other information about the chat should be resolved
623pageBlockChatLink title:string photo:chatPhoto username:string = PageBlock;
624
625
626//@description Describes instant view of a web page @page_blocks Content of the web page @is_full True, if instant view contains full page. Network request may be needed to get full web page instant view
627webPageInstantView page_blocks:vector<PageBlock> is_full:Bool = WebPageInstantView;
628
629
630//@description Describes web page preview @url Original URL of link @display_url URL to display
631//@type Type of web page: article, photo, audio, video, document, profile, app or something other
632//@site_name Short name of the site (i.e. Google Docs or App Store) @title Title of the content @param_description Description of the content
633//@photo Image representing the content, nullable
634//@embed_url Url to show embedded preview
635//@embed_type MIME type of embedded preview, i.e. text/html or video/mp4
636//@embed_width Width of embedded preview
637//@embed_height Height of embedded preview
638//@duration Duration of the content in seconds
639//@author Author of the content
640//@animation Preview as an Animation if available, nullable
641//@audio Preview as an Audio if available, nullable
642//@document Preview as a Document if available (currently only for small pdf files and zip archives), nullable
643//@sticker Preview as a Sticker for small .webp files if available, nullable
644//@video Preview as a Video if available, nullable
645//@video_note Preview as a VideoNote if available, nullable
646//@voice Preview as a Voice if available, nullable
647//@has_instant_view True if web page has instant view
648webPage url:string display_url:string type:string site_name:string title:string description:string 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:voice has_instant_view:Bool = WebPage;
649
650
651//@description Goods price portion @label Portion label @amount Currency amount in minimal quantity of the currency
652labeledPrice label:string amount:int53 = LabeledPrice;
653
654//@description Goods invoice @currency ISO 4217 currency code @prices List of objects used to calculate total price @is_test True, if payment is test @need_name True, if user's name is needed for payment @need_phone_number True, if user's phone number is needed for payment @need_email True, if user's email is needed for payment
655//@need_shipping_address True, if user's shipping address is needed for payment @is_flexible True, if total price depends on shipping method
656invoice currency:string prices:vector<labeledPrice> is_test:Bool need_name:Bool need_phone_number:Bool need_email:Bool need_shipping_address:Bool is_flexible:Bool = Invoice;
657
658//@description Describes shipping address @country_code Two letter ISO 3166-1 alpha-2 country code @state State if applicable @city City @street_line1 First line for the address @street_line2 Second line for the address @post_code Address post code
659shippingAddress country_code:string state:string city:string street_line1:string street_line2:string post_code:string = ShippingAddress;
660
661//@description Order information @name User name @phone_number User's phone number @email User email @shipping_address User shipping address, nullable
662orderInfo name:string phone_number:string email:string shipping_address:shippingAddress = OrderInfo;
663
664//@description One shipping option @id Shipping option identifier @title Option title @prices List of objects used to calculate total shipping price
665shippingOption id:string title:string prices:vector<labeledPrice> = ShippingOption;
666
667//@description Information about saved card credentials @id Unique identifier of the saved credentials @title Title of the saved credentials
668savedCredentials id:string title:string = SavedCredentials;
669
670//@class InputCredentials @description Contains information about payment method chosen by user
671
672//@description User chooses previosly saved payment credentials. To use previously saved credentials user should have valid temporary password @saved_credentials_id Identifier of saved credentials
673inputCredentialsSaved saved_credentials_id:string = InputCredentials;
674
675//@description User enters new credentials on payment provider web site @data JSON-encoded data with credentials identifier from the payment provider @allow_save True, if credentials identifier can be saved server-side
676inputCredentialsNew data:string allow_save:Bool = InputCredentials;
677
678//@description Stripe payments provider @publishable_key Stripe API publishable key @need_country True, if user country should be entered @need_zip True, if user zip code should be entered @need_cardholder_name True, if cardholder name should be entered
679paymentsProviderStripe publishable_key:string need_country:Bool need_zip:Bool need_cardholder_name:Bool = PaymentsProviderStripe;
680
681//@description Information about invoice payment form @invoice Full information about the invoice @url Payment form URL @payments_provider Information about payment provider if available, to support it natively without opening the URL, nullable
682//@saved_order_info Saved server-side order information, nullable @saved_credentials Information about saved card credentials, nullable @can_save_credentials True, if the user can choose to save credentials @need_password True, if the user will be able to save credentials if he set up a password
683paymentForm invoice:invoice url:string payments_provider:paymentsProviderStripe saved_order_info:orderInfo saved_credentials:savedCredentials can_save_credentials:Bool need_password:Bool = PaymentForm;
684
685//@description Contains temporary identifier of validated order information stored for an hour and available shipping options @order_info_id Temporary identifier of order information @shipping_options Available shipping options
686validatedOrderInfo order_info_id:string shipping_options:vector<shippingOption> = ValidatedOrderInfo;
687
688//@description Contains result of a payment query @success True, if payment request was successful. If false, verification_url will be not empty @verification_url Url for additional payments credentials verification
689paymentResult success:Bool verification_url:string = PaymentResult;
690
691//@description Contains information about successful payment @date Payment date, unix time @payments_provider_user_id User identifier of payments provider bot @invoice Information about the invoice
692//@order_info Order information, nullable @shipping_option Chosen shipping option, nullable @credentials_title Title of the saved credentials
693paymentReceipt date:int32 payments_provider_user_id:int32 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string = PaymentReceipt;
694
695
696//@class MessageContent @description Content of a message
697
698//@description Text message @text Text of the message @entities Entities contained in the text @web_page Preview of a web page mentioned in the text, nullable
699messageText text:string entities:vector<textEntity> web_page:webPage = MessageContent;
700
701//@description Animation message @animation Message content @caption Animation caption
702messageAnimation animation:animation caption:string = MessageContent;
703
704//@description Audio message @audio Message content @caption Audio caption
705messageAudio audio:audio caption:string = MessageContent;
706
707//@description Document message @document Message content @caption Document caption
708messageDocument document:document caption:string = MessageContent;
709
710//@description Photo message @photo Message content @caption Photo caption
711messagePhoto photo:photo caption:string = MessageContent;
712
713//@description Photo message expired by TTL
714messageExpiredPhoto = MessageContent;
715
716//@description Sticker message @sticker Message content
717messageSticker sticker:sticker = MessageContent;
718
719//@description Video message @video Message content @caption Video caption
720messageVideo video:video caption:string = MessageContent;
721
722//@description Video message expired by TTL
723messageExpiredVideo = MessageContent;
724
725//@description Video note message @video_note Message content @is_viewed True, if the video note message was viewed
726messageVideoNote video_note:videoNote is_viewed:Bool = MessageContent;
727
728//@description Voice message @voice Message content @caption Voice caption @is_listened True, if the voice message was listened to
729messageVoice voice:voice caption:string is_listened:Bool = MessageContent;
730
731//@description Message with location @location Message content
732messageLocation location:location = MessageContent;
733
734//@description Message with information about venue @venue Message content
735messageVenue venue:venue = MessageContent;
736
737//@description User contact message @contact Message content
738messageContact contact:contact = MessageContent;
739
740//@description Message with a game @game The game
741messageGame game:game = MessageContent;
742
743//@description Message with an invoice from a bot @title Goods title @param_description Goods description @photo Goods photo, nullable @currency Currency for goods price @total_amount Goods total price in minimal quantity of the currency
744//@start_parameter Unique invoice bot start_parameter. To share an invoice use a URL https://t.me/{bot_username}?start={start_parameter} @is_test True, if invoice is test
745//@need_shipping_address True, if shipping address should be specified @receipt_message_id Identifier of message with receipt after the goods are paid
746messageInvoice title:string description:string photo:photo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 = MessageContent;
747
748//@description Message with an information about ended call @discard_reason Call discard reason @duration Call duration in seconds
749messageCall discard_reason:CallDiscardReason duration:int32 = MessageContent;
750
751//@description New group chat created @title Title of created group chat @member_user_ids User identifiers of members of created group chat
752messageGroupChatCreate title:string member_user_ids:vector<int32> = MessageContent;
753
754//@description New channel chat created @title Title of created channel chat
755messageChannelChatCreate title:string = MessageContent;
756
757//@description Chat title changed @title New chat title
758messageChatChangeTitle title:string = MessageContent;
759
760//@description Chat photo changed @photo New chat photo
761messageChatChangePhoto photo:photo = MessageContent;
762
763//@description Chat photo deleted
764messageChatDeletePhoto = MessageContent;
765
766//@description Chat members added @member_user_ids User identifiers of new chat members
767messageChatAddMembers member_user_ids:vector<int32> = MessageContent;
768
769//@description Chat member joined by invite link
770messageChatJoinByLink = MessageContent;
771
772//@description Chat member deleted @user_id User identifier of deleted chat memeber
773messageChatDeleteMember user_id:int32 = MessageContent;
774
775//@description Group chat is migrated to supergroup channel and deactivated @channel_id Identifier of the channel it is migrated to
776messageChatMigrateTo channel_id:int32 = MessageContent;
777
778//@description Supergroup channel is created from group chat @title Title of created channel chat @group_id Identifier of the group it is migrated from
779messageChatMigrateFrom title:string group_id:int32 = MessageContent;
780
781//@description Some message was pinned @message_id Identifier of the pinned message, can be identifier of the deleted message
782messagePinMessage message_id:int53 = MessageContent;
783
784//@description Screenshot of messages in the chat was taken
785messageScreenshotTaken = MessageContent;
786
787//@description Messages ttl setting in secret chat has changed @ttl New ttl
788messageChatSetTtl ttl:int32 = MessageContent;
789
790//@description New high score was achieved in a game @game_message_id Identifier of the message with the game, can be identifier of the deleted message @game_id Identifier of the game, may be different from the games presented in the message with the game @score New score
791messageGameScore game_message_id:int53 game_id:int64 score:int32 = MessageContent;
792
793//@description Payment completed @currency Currency for goods price @total_amount Goods total price in minimal quantity of the currency
794messagePaymentSuccessful currency:string total_amount:int53 = MessageContent;
795
796//@description Bots only. Payment completed @currency Currency for goods price @total_amount Goods total price in minimal quantity of the currency @invoice_payload Invoice payload @shipping_option_id Identifier of a choosed by user shipping option, may be empty if not applicable @order_info Information about the order, nullable
797//@telegram_payment_charge_id Telegram payment identifier @provider_payment_charge_id Provider payment identifier
798messagePaymentSuccessfulBot currency:string total_amount:int53 invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent;
799
800//@description Contact has registered
801messageContactRegistered = MessageContent;
802
803//@description Unsupported message content
804messageUnsupported = MessageContent;
805
806
807//@class TextEntityType @description Represent part of the text which needs to be formatted in some unusual way
808
809//@description Mention of the user by his username
810textEntityTypeMention = TextEntityType;
811
812//@description Hashtag beginning with #
813textEntityTypeHashtag = TextEntityType;
814
815//@description Bot command beginning with /. It shouldn't be highlighted if there is no bots in the chat
816textEntityTypeBotCommand = TextEntityType;
817
818//@description Url beginning with http
819textEntityTypeUrl = TextEntityType;
820
821//@description Email
822textEntityTypeEmail = TextEntityType;
823
824//@description Bold text
825textEntityTypeBold = TextEntityType;
826
827//@description Italic text
828textEntityTypeItalic = TextEntityType;
829
830//@description Text needs to be formatted as inside of code HTML tag
831textEntityTypeCode = TextEntityType;
832
833//@description Text needs to be formatted as inside of pre HTML tag
834textEntityTypePre = TextEntityType;
835
836//@description Text needs to be formatted as inside of pre and code HTML tags @language Language of code as defined by sender
837textEntityTypePreCode language:string = TextEntityType;
838
839//@description Text description showed instead of the url @url Url to be opened after link will be clicked
840textEntityTypeTextUrl url:string = TextEntityType;
841
842//@description Mention of the user by some text @user_id Identifier of the mentioned user
843textEntityTypeMentionName user_id:int32 = TextEntityType;
844
845
846//@class TextParseMode @description Describes a way text should be parsed for MessageEntities, by default text is treated as is
847
848//@description Text should be parsed in markdown-style way
849textParseModeMarkdown = TextParseMode;
850
851//@description Text should be parsed in the HTML-style way
852textParseModeHTML = TextParseMode;
853
854
855//@description Contains a list ot text entities @entities The entities
856textEntities entities:vector<textEntity> = TextEntities;
857
858
859//@description Thumb to send along with a file, should be in jpeg format or webp format for stickers and less than 200KB in size @thumb Thumb file to send, sending thumbs by file_id is currently not supported
860//@width Thumb width, usually shouldn't excceed 90. Use 0 if unknown @height Thumb height, usually shouldn't excceed 90. Use 0 if unknown
861inputThumb thumb:InputFile width:int32 height:int32 = InputThumb;
862
863
864//@class InputMessageContent @description Content of a message to send
865
866//@description Text message @text Text to send @disable_web_page_preview Pass true to disable rich preview for link in the message text @clear_draft Pass true if chat draft message should be deleted
867//@entities Bold, Italic, Code, Pre, PreCode and TextUrl entities contained in the text. Non-bot users can't use TextUrl entities. Can't be used with non-null parse_mode @parse_mode Text parse mode, nullable. Can't be used along with enitities
868inputMessageText text:string disable_web_page_preview:Bool clear_draft:Bool entities:vector<textEntity> parse_mode:TextParseMode = InputMessageContent;
869
870//@description Animation message @animation Animation file to send @thumb Animation thumb, if available @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, 0-200 characters
871inputMessageAnimation animation:InputFile thumb:inputThumb duration:int32 width:int32 height:int32 caption:string = InputMessageContent;
872
873//@description Audio message @audio Audio file to send @album_cover_thumb Thumb of the album's cover, if available @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
874//@performer Performer of the audio, 0-64 characters, may be replaced by the server @caption Audio caption, 0-200 characters
875inputMessageAudio audio:InputFile album_cover_thumb:inputThumb duration:int32 title:string performer:string caption:string = InputMessageContent;
876
877//@description Document message @document Document to send @thumb Document thumb, if available @caption Document caption, 0-200 characters
878inputMessageDocument document:InputFile thumb:inputThumb caption:string = InputMessageContent;
879
880//@description Photo message @photo Photo to send @thumb Photo thumb to send, is sent to the other party in secret chats only @added_sticker_file_ids File identifiers of stickers added onto the photo @width Photo width @height Photo height @caption Photo caption, 0-200 characters
881//@ttl Photo TTL in seconds, 0-60. Non-zero TTL can be only specified in private chats
882inputMessagePhoto photo:InputFile thumb:inputThumb added_sticker_file_ids:vector<int32> width:int32 height:int32 caption:string ttl:int32 = InputMessageContent;
883
884//@description Sticker message @sticker Sticker to send @thumb Sticker thumb, if available @width Sticker width @height Sticker height
885inputMessageSticker sticker:InputFile thumb:inputThumb width:int32 height:int32 = InputMessageContent;
886
887//@description Video message @video Video to send @thumb Video thumb, if available @added_sticker_file_ids File identifiers of stickers added onto the video @duration Duration of the video in seconds @width Video width @height Video height @caption Video caption, 0-200 characters
888//@ttl Video TTL in seconds, 0-60. Non-zero TTL can be only specified in private chats
889inputMessageVideo video:InputFile thumb:inputThumb added_sticker_file_ids:vector<int32> duration:int32 width:int32 height:int32 caption:string ttl:int32 = InputMessageContent;
890
891//@description Video note message @video_note Video note to send @thumb Video thumb, if available @duration Duration of the video in seconds @length Video width and height, should be positive and not greater than 640
892inputMessageVideoNote video_note:InputFile thumb:inputThumb duration:int32 length:int32 = InputMessageContent;
893
894//@description Voice message @voice Voice file to send @duration Duration of the voice in seconds @waveform Waveform representation of the voice in 5-bit format @caption Voice caption, 0-200 characters
895inputMessageVoice voice:InputFile duration:int32 waveform:bytes caption:string = InputMessageContent;
896
897//@description Message with location @location Location to send
898inputMessageLocation location:location = InputMessageContent;
899
900//@description Message with information about venue @venue Venue to send
901inputMessageVenue venue:venue = InputMessageContent;
902
903//@description User contact message @contact Contact to send
904inputMessageContact contact:contact = InputMessageContent;
905
906//@description Message with a game, can't be used in broadcast channels and secret chats @bot_user_id User identifier of a bot owned the game @game_short_name Game short name
907inputMessageGame bot_user_id:int32 game_short_name:string = InputMessageContent;
908
909//@description Message with an invoice, can be used only by bots and in private chats only @invoice The invoice @title Product title, 1-32 characters @param_description Product description, 0-255 characters @photo_url Goods photo URL, optional @photo_size Goods photo size @photo_width Goods photo width @photo_height Goods photo height
910//@payload Invoice payload @provider_token Payments provider token @start_parameter Unique invoice bot start_parameter for generation of this invoice
911inputMessageInvoice invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string start_parameter:string = InputMessageContent;
912
913//@description Forwarded message @from_chat_id Chat identifier of the message to forward @message_id Identifier of the message to forward @in_game_share Pass true to share a game message within a launched game, for Game messages only
914inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool = InputMessageContent;
915
916
917//@class SearchMessagesFilter @description Represents filter for content of searched messages
918
919//@description Return all found messages
920searchMessagesFilterEmpty = SearchMessagesFilter;
921
922//@description Return only animation messages
923searchMessagesFilterAnimation = SearchMessagesFilter;
924
925//@description Return only audio messages
926searchMessagesFilterAudio = SearchMessagesFilter;
927
928//@description Return only document messages
929searchMessagesFilterDocument = SearchMessagesFilter;
930
931//@description Return only photo messages
932searchMessagesFilterPhoto = SearchMessagesFilter;
933
934//@description Return only video messages
935searchMessagesFilterVideo = SearchMessagesFilter;
936
937//@description Return only voice messages
938searchMessagesFilterVoice = SearchMessagesFilter;
939
940//@description Return only photo and video messages
941searchMessagesFilterPhotoAndVideo = SearchMessagesFilter;
942
943//@description Return only messages containing url
944searchMessagesFilterUrl = SearchMessagesFilter;
945
946//@description Return only messages containing chat photos
947searchMessagesFilterChatPhoto = SearchMessagesFilter;
948
949//@description Return only call messages
950searchMessagesFilterCall = SearchMessagesFilter;
951
952//@description Return only incoming call messages with missed/declined discard reason
953searchMessagesFilterMissedCall = SearchMessagesFilter;
954
955//@description Return only video note messages
956searchMessagesFilterVideoNote = SearchMessagesFilter;
957
958//@description Return only voice and video note messages
959searchMessagesFilterVoiceAndVideoNote = SearchMessagesFilter;
960
961//@description Return only messages with mentions of current logged in user or which are replies to his messages
962searchMessagesFilterMention = SearchMessagesFilter;
963
964//@description Return only messages with unread mentions of current logged in user or which are replies to his messages. When this filter is used result can't be additionally filtered by a query or a sender user
965searchMessagesFilterUnreadMention = SearchMessagesFilter;
966
967
968//@class ChatAction @description Describes different types of activity in a chat
969
970//@description User typing a message
971chatActionTyping = ChatAction;
972//@description User records a video
973chatActionRecordingVideo = ChatAction;
974//@description User uploads a video @progress Upload progress in percents
975chatActionUploadingVideo progress:int32 = ChatAction;
976//@description User records voice message
977chatActionRecordingVoice = ChatAction;
978//@description User uploads voice message @progress Upload progress in percents
979chatActionUploadingVoice progress:int32 = ChatAction;
980//@description User uploads a photo @progress Upload progress in percents
981chatActionUploadingPhoto progress:int32 = ChatAction;
982//@description User uploads a document @progress Upload progress in percents
983chatActionUploadingDocument progress:int32 = ChatAction;
984//@description User chooses location or venue to send
985chatActionChoosingLocation = ChatAction;
986//@description User chooses contact to send
987chatActionChoosingContact = ChatAction;
988//@description User starts to play a game
989chatActionStartPlayingGame = ChatAction;
990//@description User records video note
991chatActionRecordingVideoNote = ChatAction;
992//@description User uploads a video note @progress Upload progress in percents
993chatActionUploadingVideoNote progress:int32 = ChatAction;
994//@description User cancels previous action
995chatActionCancel = ChatAction;
996
997
998//@class UserStatus @description Describes last time user was online
999
1000//@description User status was newer changed
1001userStatusEmpty = UserStatus;
1002
1003//@description User is online @expires Unix time when user's online status will expire
1004userStatusOnline expires:int32 = UserStatus;
1005
1006//@description User is offline @was_online Unix time user was online last time
1007userStatusOffline was_online:int32 = UserStatus;
1008
1009//@description User was online recently
1010userStatusRecently = UserStatus;
1011
1012//@description User is offline, but was online last week
1013userStatusLastWeek = UserStatus;
1014
1015//@description User is offline, but was online last month
1016userStatusLastMonth = UserStatus;
1017
1018
1019//@description Represents list of stickers @stickers Stickers
1020stickers stickers:vector<sticker> = Stickers;
1021
1022//@description Represents list of all emojis corresponding to a sticker in a sticker set. The list is only for informational purposes because sticker is always sent with a fixed emoji from the corresponding Sticker object @emojis List of emojis
1023stickerEmojis emojis:vector<string> = StickerEmojis;
1024
1025//@description Represents sticker set @id Sticker set identifier @title Title of the sticker set @name Name of the sticker set @is_installed True if sticker set is installed by logged in user
1026//@is_archived True if sticker set is archived. A sticker set can't be installed and archived simultaneously @is_official True if sticker set is official @is_masks True if stickers in the set are masks
1027//@is_viewed True for viewed trending sticker set @stickers List of stickers in this set @emojis Lists of emojis corresponding to the stickers in the same order
1028stickerSet id:int64 title:string name:string is_installed:Bool is_archived:Bool is_official:Bool is_masks:Bool is_viewed:Bool stickers:vector<sticker> emojis:vector<stickerEmojis> = StickerSet;
1029
1030//@description Represents short information about sticker set @id Sticker set identifier @title Title of the sticker set @name Name of the sticker set @is_installed True if sticker set is installed by logged in user
1031//@is_archived True if sticker set is archived. A sticker set can't be installed and archived simultaneously @is_official True if sticker set is official @is_masks True if stickers in the set are masks
1032//@is_viewed True for viewed trending sticker set @size Total number of stickers in the set @covers Up to 5 first stickers from the set depending on the context. If client needs more stickers it should request full sticker set
1033stickerSetInfo id:int64 title:string name:string is_installed:Bool is_archived:Bool is_official:Bool is_masks:Bool is_viewed:Bool size:int32 covers:vector<sticker> = StickerSetInfo;
1034
1035//@description Represents list of sticker sets @total_count Approximate total count of found sticker sets @sets List of sticker sets
1036stickerSets total_count:int32 sets:vector<stickerSetInfo> = StickerSets;
1037
1038
1039//@class CallDiscardReason @description Describes reason a call was discarded
1040
1041//@description Call wasn't discarded or the reason is unknown
1042callDiscardReasonEmpty = CallDiscardReason;
1043
1044//@description Call has ended before conversation begins. It was cancelled by the caller or was missed by the callee
1045callDiscardReasonMissed = CallDiscardReason;
1046
1047//@description Call has ended before conversation begins. It was declined by the callee
1048callDiscardReasonDeclined = CallDiscardReason;
1049
1050//@description Call has ended during conversation because users was disconnected
1051callDiscardReasonDisconnected = CallDiscardReason;
1052
1053//@description Call was hung up by the caller or by the callee
1054callDiscardReasonHungUp = CallDiscardReason;
1055
1056
1057//@description Specifies supported call protocols @udp_p2p True, if UDP peer to peer connections are supported @udp_reflector True, if connection through UDP reflectors are supported @min_layer Minimum supported layer, use 65 @max_layer Maximum supported layer, use 65
1058callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 = CallProtocol;
1059
1060//@description Describes address of UDP reflectors @id Reflector identifier @ip IPv4 reflector address @ipv6 IPv6 reflector address @port Reflector port @peer_tag Connection peer tag
1061callConnection id:int64 ip:string ipv6:string port:int32 peer_tag:bytes = CallConnection;
1062
1063
1064//@description Contains call identifier @id Call identifier
1065callId id:int32 = CallId;
1066
1067
1068//@class CallState @description Describes current call state
1069
1070//@description Call is pending for acception by a user @is_created True, if the call is already created by the server @is_received True, if the call is already received by the other party
1071callStatePending is_created:Bool is_received:Bool = CallState;
1072
1073//@description Call is answered and encryption keys are exchanged
1074callStateExchangingKeys = CallState;
1075
1076//@description Call is ready to use @protocol Call protocols supported by the peer @connections Available UDP reflectors @config JSON-encoded call config @encryption_key Call encryption key @emojis Encryption key emojis fingerprint
1077callStateReady protocol:callProtocol connections:vector<callConnection> config:string encryption_key:bytes emojis:vector<string> = CallState;
1078
1079//@description Call is hanging up after discardCall is called
1080callStateHangingUp = CallState;
1081
1082//@description Call has ended successfully @reason A reason, why call has ended @need_rating If true, call rating should be sent to the server @need_debug If true, call debug should be sent to the server
1083callStateDiscarded reason:CallDiscardReason need_rating:Bool need_debug:Bool = CallState;
1084
1085//@description Call has ended with an error @error The error. Error with the code 4005000 returned if an outgoing call is missed because of expired timeout
1086callStateError error:error = CallState;
1087
1088
1089//@description Describes a call @id Call identifier, not persistent @user_id Peer user identifier @is_outgoing True, if the call is outgoing @state Call state
1090call id:int32 user_id:int32 is_outgoing:Bool state:CallState = Call;
1091
1092
1093//@description Represents list of animations @animations Animations
1094animations animations:vector<animation> = Animations;
1095
1096
1097//@description Represent result for ImportContacts request @user_ids User identifiers of imported contacts in the same order as they was specified in the request. 0 if contact is not yet registered
1098//@importer_count Number of users which imported corresponding contact. 0 for already registered users or if unavailable
1099importedContacts user_ids:vector<int32> importer_count:vector<int32> = ImportedContacts;
1100
1101
1102//@class InputInlineQueryResult @description Represents one result of the inline query received from the bot
1103
1104//@description Represents link to an animated gif @id Unique identifier of this result @title Title of the result @thumb_url Url of the static result thumb (jpeg or gif), if exists
1105//@gif_url Url of the gif-file (file size must not exceed 1MB) @gif_duration Duration of the gif in seconds @gif_width Width of the gif @gif_height Height of the gif
1106//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1107//@input_message_content Content of the message to be sent, should be of type inputMessageText or inputMessageAnimation or InputMessageLocation or InputMessageVenue or InputMessageContact
1108inputInlineQueryResultAnimatedGif id:string title:string thumb_url:string gif_url:string gif_duration:int32 gif_width:int32 gif_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1109
1110//@description Represents link to an animated (i.e. without sound) H.264/MPEG-4 AVC video @id Unique identifier of this result @title Title of the result @thumb_url Url of the static result thumb (jpeg or gif), if exists
1111//@mpeg4_url Url of the mp4-file (file size must not exceed 1MB) @mpeg4_duration Duration of the video in seconds @mpeg4_width Width of the video @mpeg4_height Height of the video
1112//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1113//@input_message_content Content of the message to be sent, should be of type inputMessageText or inputMessageAnimation or InputMessageLocation or InputMessageVenue or InputMessageContact
1114inputInlineQueryResultAnimatedMpeg4 id:string title:string thumb_url:string mpeg4_url:string mpeg4_duration:int32 mpeg4_width:int32 mpeg4_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1115
1116//@description Represents link to an article or web page @id Unique identifier of this result @url Url of the result, if exists @hide_url True, if url must be not shown @title Title of the result
1117//@param_description Short description of the result @thumb_url Url of the result thumb, if exists @thumb_width Thumb width, if known @thumb_height Thumb height, if known
1118//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1119//@input_message_content Content of the message to be sent, should be of type inputMessageText or InputMessageLocation or InputMessageVenue or InputMessageContact
1120inputInlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumb_url:string thumb_width:int32 thumb_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1121
1122//@description Represents link to a mp3 audio file @id Unique identifier of this result @title Title of the audio @performer Performer of the audio
1123//@audio_url Url of the audio file @audio_duration Audio duration in seconds
1124//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1125//@input_message_content Content of the message to be sent, should be of type inputMessageText or inputMessageAudio or InputMessageLocation or InputMessageVenue or InputMessageContact
1126inputInlineQueryResultAudio id:string title:string performer:string audio_url:string audio_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1127
1128//@description Represents user contact @id Unique identifier of this result @contact User contact @thumb_url Url of the result thumb, if exists @thumb_width Thumb width, if known @thumb_height Thumb height, if known
1129//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1130//@input_message_content Content of the message to be sent, should be of type inputMessageText or InputMessageLocation or InputMessageVenue or InputMessageContact
1131inputInlineQueryResultContact id:string contact:contact thumb_url:string thumb_width:int32 thumb_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1132
1133//@description Represents link to a file @id Unique identifier of this result @title Title of the result @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 allowed now
1134//@thumb_url Url of the file thumb, if exists @thumb_width Width of the thumb @thumb_height Height of the thumb
1135//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1136//@input_message_content Content of the message to be sent, should be of type inputMessageText or inputMessageDocument or InputMessageLocation or InputMessageVenue or InputMessageContact
1137inputInlineQueryResultDocument id:string title:string description:string document_url:string mime_type:string thumb_url:string thumb_width:int32 thumb_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1138
1139//@description Represents a game @id Unique identifier of this result @game_short_name Game short name @reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1140inputInlineQueryResultGame id:string game_short_name:string reply_markup:ReplyMarkup = InputInlineQueryResult;
1141
1142//@description Represents a point on the map @id Unique identifier of this result @location Result @title Title of the result @thumb_url Url of the result thumb, if exists @thumb_width Thumb width, if known @thumb_height Thumb height, if known
1143//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1144//@input_message_content Content of the message to be sent, should be of type inputMessageText or InputMessageLocation or InputMessageVenue or InputMessageContact
1145inputInlineQueryResultLocation id:string location:location title:string thumb_url:string thumb_width:int32 thumb_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1146
1147//@description Represents link to a jpeg photo @id Unique identifier of this result @title Title of the result, if known @param_description Short description of the result, if known @thumb_url Url of the photo thumb, if exists
1148//@photo_url Url of the jpeg photo (photo must not exceed 5MB) @photo_width Width of the photo @photo_height Height of the photo
1149//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1150//@input_message_content Content of the message to be sent, should be of type inputMessageText or inputMessagePhoto or InputMessageLocation or InputMessageVenue or InputMessageContact
1151inputInlineQueryResultPhoto id:string title:string description:string thumb_url:string photo_url:string photo_width:int32 photo_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1152
1153//@description Represents link to a webp sticker @id Unique identifier of this result @thumb_url Url of the sticker thumb, if exists
1154//@sticker_url Url of the webp sticker (file with a sticker must not exceed 5MB) @sticker_width Width of the sticker @sticker_height Height of the sticker
1155//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1156//@input_message_content Content of the message to be sent, should be of type inputMessageText or inputMessageSticker or InputMessageLocation or InputMessageVenue or InputMessageContact
1157inputInlineQueryResultSticker id:string thumb_url:string sticker_url:string sticker_width:int32 sticker_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1158
1159//@description Represents information about a venue @id Unique identifier of this result @venue Result @thumb_url Url of the result thumb, if exists @thumb_width Thumb width, if known @thumb_height Thumb height, if known
1160//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1161//@input_message_content Content of the message to be sent, should be of type inputMessageText or InputMessageLocation or InputMessageVenue or InputMessageContact
1162inputInlineQueryResultVenue id:string venue:venue thumb_url:string thumb_width:int32 thumb_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1163
1164//@description Represents link to a page containing an embedded video player or a video file @id Unique identifier of this result @title Title of the result @param_description Short description of the result, if known
1165//@thumb_url Url of the video thumb (jpeg), if exists @video_url Url of the embedded video player or video file @mime_type MIME type of the content of video url, only "text/html" or "video/mp4" are allowed now
1166//@video_width Video width @video_height Video height @video_duration Video duration in seconds
1167//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1168//@input_message_content Content of the message to be sent, should be of type inputMessageText or inputMessageVideo or InputMessageLocation or InputMessageVenue or InputMessageContact
1169inputInlineQueryResultVideo id:string title:string description:string thumb_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;
1170
1171//@description Represents link to a opus encoded audio file in ogg container @id Unique identifier of this result @title Title of the voice file
1172//@voice_url Url of the voice file @voice_duration Voice duration in seconds
1173//@reply_markup Message reply markup, should be of type replyMarkupInlineKeyboard or null
1174//@input_message_content Content of the message to be sent, should be of type inputMessageText or inputMessageVoice or InputMessageLocation or InputMessageVenue or InputMessageContact
1175inputInlineQueryResultVoice id:string title:string voice_url:string voice_duration:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
1176
1177
1178//@class InlineQueryResult @description Represents one result of the inline query
1179
1180//@description Represents link to an article or web page @id Unique identifier of this result @url Url of the result, if exists @hide_url True, if url must be not shown @title Title of the result
1181//@param_description Short description of the result @thumb Result thumb, nullable
1182inlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumb:photoSize = InlineQueryResult;
1183
1184//@description Represents user contact @id Unique identifier of this result @contact User contact @thumb Result thumb, nullable
1185inlineQueryResultContact id:string contact:contact thumb:photoSize = InlineQueryResult;
1186
1187//@description Represents a point on the map @id Unique identifier of this result @location The result @title Title of the result @thumb Result thumb, nullable
1188inlineQueryResultLocation id:string location:location title:string thumb:photoSize = InlineQueryResult;
1189
1190//@description Represents information about a venue @id Unique identifier of this result @venue The result @thumb Result thumb, nullable
1191inlineQueryResultVenue id:string venue:venue thumb:photoSize = InlineQueryResult;
1192
1193//@description Represents information about a game @id Unique identifier of this result @game The result
1194inlineQueryResultGame id:string game:game = InlineQueryResult;
1195
1196//@description Represents an animation cached on the telegram server @id Unique identifier of this result @animation The animation @title Animation title
1197inlineQueryResultAnimation id:string animation:animation title:string = InlineQueryResult;
1198
1199//@description Represents an audio cached on the telegram server @id Unique identifier of this result @audio The audio
1200inlineQueryResultAudio id:string audio:audio = InlineQueryResult;
1201
1202//@description Represents a document cached on the telegram server @id Unique identifier of this result @document The document @title Document title @param_description Document description
1203inlineQueryResultDocument id:string document:document title:string description:string = InlineQueryResult;
1204
1205//@description Represents a photo cached on the telegram server @id Unique identifier of this result @photo The photo @title Title of the result, if known @param_description Short description of the result, if known
1206inlineQueryResultPhoto id:string photo:photo title:string description:string = InlineQueryResult;
1207
1208//@description Represents a sticker cached on the telegram server @id Unique identifier of this result @sticker The sticker
1209inlineQueryResultSticker id:string sticker:sticker = InlineQueryResult;
1210
1211//@description Represents a video cached on the telegram server @id Unique identifier of this result @video The video @title Title of the video @param_description Description of the video
1212inlineQueryResultVideo id:string video:video title:string description:string = InlineQueryResult;
1213
1214//@description Represents a voice cached on the telegram server @id Unique identifier of this result @voice The voice @title Title of the voice file
1215inlineQueryResultVoice id:string voice:voice title:string = InlineQueryResult;
1216
1217
1218//@description Represents 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 Offset for the next request. If it is empty, there is no more results @results Results of the query
1219//@switch_pm_text If non-empty, this text should be shown on the button, which opens private chat with the bot and sends bot start message with parameter switch_pm_parameter @switch_pm_parameter Parameter for the bot start message
1220inlineQueryResults inline_query_id:int64 next_offset:string results:vector<InlineQueryResult> switch_pm_text:string switch_pm_parameter:string = InlineQueryResults;
1221
1222
1223//@class CallbackQueryPayload @description Represents payload of a callback query
1224
1225//@description Payload from a general callback button @data Data that was attached to the callback button
1226callbackQueryPayloadData data:bytes = CallbackQueryPayload;
1227
1228//@description Payload from a game callback button @game_short_name Short name of the game that was attached to the callback button
1229callbackQueryPayloadGame game_short_name:string = CallbackQueryPayload;
1230
1231
1232//@description Contains answer of a bot to a callback query @text Text of the answer @show_alert If true, an alert should be shown to the user instead of a toast @url URL to be open
1233callbackQueryAnswer text:string show_alert:Bool url:string = CallbackQueryAnswer;
1234
1235
1236//@description Contains result of a custom request @result JSON-serialized result
1237customRequestResult result:string = CustomRequestResult;
1238
1239
1240//@description Contains one row of the game high scores table @position Position in the high score table @user_id User identifier @score User score
1241gameHighScore position:int32 user_id:int32 score:int32 = GameHighScore;
1242
1243//@description Contains list of game high scores @scores List of game high scores
1244gameHighScores scores:vector<gameHighScore> = GameHighScores;
1245
1246
1247//@class ChatEventAction @description Represents a chat event
1248
1249//@description A message was edited @old_message Message before edit @new_message Message after edit
1250chatEventMessageEdited old_message:message new_message:message = ChatEventAction;
1251
1252//@description A message was deleted @message Deleted message
1253chatEventMessageDeleted message:message = ChatEventAction;
1254
1255//@description A message was pinned @message Pinned message
1256chatEventMessagePinned message:message = ChatEventAction;
1257
1258//@description A message was unpinned
1259chatEventMessageUnpinned = ChatEventAction;
1260
1261//@description New chat member joined
1262chatEventMemberJoined = ChatEventAction;
1263
1264//@description A chat member left
1265chatEventMemberLeft = ChatEventAction;
1266
1267//@description New chat member invited @user_id New chat member user identifier @status New chat member status
1268chatEventMemberInvited user_id:int32 status:ChatMemberStatus = ChatEventAction;
1269
1270//@description A chat member promoted to/demoted from administrators @user_id Chat member user identifier @old_status Old chat member status @new_status New chat member status
1271chatEventMemberPromoted user_id:int32 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction;
1272
1273//@description A chat member restricted/unrestircted or banned/unbanned @user_id Chat member user identifier @old_status Old chat member status @new_status New chat member status
1274chatEventMemberRestricted user_id:int32 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction;
1275
1276//@description Chat title was changed @old_title Old title value @new_title New title value
1277chatEventTitleChanged old_title:string new_title:string = ChatEventAction;
1278
1279//@description Chat description was changed @old_description Old description value @new_description New description value
1280chatEventDescriptionChanged old_description:string new_description:string = ChatEventAction;
1281
1282//@description Chat username was changed @old_username Old username value @new_username New username value
1283chatEventUsernameChanged old_username:string new_username:string = ChatEventAction;
1284
1285//@description Chat photo was changed @old_photo Old photo value, nullable @new_photo New photo value, nullable
1286chatEventPhotoChanged old_photo:chatPhoto new_photo:chatPhoto = ChatEventAction;
1287
1288//@description Supergroup channel chat anyone_can_invite setting was toggled @anyone_can_invite New value of anyone_can_invite
1289chatEventInvitesToggled anyone_can_invite:Bool = ChatEventAction;
1290
1291//@description Broadcast channel chat sign_messages setting was toggled @sign_messages New value of sign_messages
1292chatEventSignMessagesToggled sign_messages:Bool = ChatEventAction;
1293
1294//@description Supergroup sticker set was changed @old_sticker_set_id Old identifier of chat sticker set, 0 if none @new_sticker_set_id New identifier of chat sticker set, 0 if none
1295chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction;
1296
1297//@description Represents a chat event @id Chat event identifier @date Date of the event, unix time @user_id Identifier of a user who made the action @action Action done by the user
1298chatEvent id:int64 date:int32 user_id:int32 action:ChatEventAction = ChatEvent;
1299
1300//@description Contains list of chat events @events The events
1301chatEvents events:vector<chatEvent> = ChatEvents;
1302
1303//@description Represents a set of filters used to obtain a chat event log
1304//@message_edits True, if message edits should be returned
1305//@message_deletions True, if message deletions should be returned
1306//@message_pins True, if message pins should be returned
1307//@member_joins True, if chat member joins should be returned
1308//@member_leaves True, if chat member leaves should be returned
1309//@member_invites True, if chat member invites should be returned
1310//@member_promotions True, if chat member promotions/demotions should be returned
1311//@member_restrictions True, if chat member restrictions/unrestrictions including bans/unbans should be returned
1312//@info_changes True, if changes of chat information should be returned
1313//@setting_changes True, if changes of chat settings should be returned
1314chatEventLogFilters 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 = ChatEventLogFilters;
1315
1316
1317//@class DeviceToken @description Represents a token for push notifications
1318
1319//@description Token for APNS @token The token, may be empty to unregister device
1320deviceTokenApns token:string = DeviceToken;
1321
1322//@description Token for GCM @token The token, may be empty to unregister device
1323deviceTokenGcm token:string = DeviceToken;
1324
1325//@description Token for MPNS @token The token, may be empty to unregister device
1326deviceTokenMpns token:string = DeviceToken;
1327
1328//@description Token for simple push @token The token, may be empty to unregister device
1329deviceTokenSimplePush token:string = DeviceToken;
1330
1331//@description Token for Ubuntu Push Service @token The token, may be empty to unregister device
1332deviceTokenUbuntuPhone token:string = DeviceToken;
1333
1334//@description Token for Blackberry Push Service @token The token, may be empty to unregister device
1335deviceTokenBlackberry token:string = DeviceToken;
1336
1337
1338//@description Contains information about one wallpaper @id Unique persistent wallpaper identifier @sizes Available variants of wallpaper of different sizes. These photos can be only downloaded and can't be sent in a message @color Main color of wallpaper in RGB24, should be treated as background color if no photos are specified
1339wallpaper id:int32 sizes:vector<photoSize> color:int32 = Wallpaper;
1340
1341//@description Contains list of wallpapers @wallpapers List of wallpapers
1342wallpapers wallpapers:vector<wallpaper> = Wallpapers;
1343
1344
1345//@description Contatins list of hashtags @hashtags List of hashtags
1346hashtags hashtags:vector<string> = Hashtags;
1347
1348
1349//@class OptionValue @description Represents value of an option
1350
1351//@description Boolean option @value Value of an option
1352optionValueBoolean value:Bool = OptionValue;
1353
1354//@description Unknown option or option having default value
1355optionValueEmpty = OptionValue;
1356
1357//@description Integer option @value Value of an option
1358optionValueInteger value:int32 = OptionValue;
1359
1360//@description String option @value Value of an option
1361optionValueString value:string = OptionValue;
1362
1363
1364//@class PrivacyRule @description Represents one rule for managing privacy settings
1365
1366//@description Rule to allow all users
1367privacyRuleAllowAll = PrivacyRule;
1368
1369//@description Rule to allow all user contacts
1370privacyRuleAllowContacts = PrivacyRule;
1371
1372//@description Rule to allow specified users @user_ids User identifiers
1373privacyRuleAllowUsers user_ids:vector<int32> = PrivacyRule;
1374
1375//@description Rule to disallow all users
1376privacyRuleDisallowAll = PrivacyRule;
1377
1378//@description Rule to disallow all user contacts
1379privacyRuleDisallowContacts = PrivacyRule;
1380
1381//@description Rule to disallow all specified users @user_ids User identifiers
1382privacyRuleDisallowUsers user_ids:vector<int32> = PrivacyRule;
1383
1384//@description List of privacy rules. Rules are matched in the specified order. First matched rule defines privacy setting for a given user. If no rule matches action is not allowed @rules List of rules
1385privacyRules rules:vector<PrivacyRule> = PrivacyRules;
1386
1387//@class PrivacyKey @description Describes available privacy settings
1388
1389//@description Privacy key for managing visibility of the user status
1390privacyKeyUserStatus = PrivacyKey;
1391
1392//@description Privacy key for managing ability of invitation of the user to chats
1393privacyKeyChatInvite = PrivacyKey;
1394
1395//@description Privacy key for managing ability to call the user
1396privacyKeyCall = PrivacyKey;
1397
1398
1399//@description Contains information about period of inactivity, after which the account of currently logged in user will be automatically deleted @days Number of days of inactivity before account deletion, should be from 30 and up to 366
1400accountTtl days:int32 = AccountTtl;
1401
1402
1403//@description Contains information about one session in some application used by the user @id Session identifier @is_current True, if it is current session @app_id Application identifier, provided by the application @app_name Name of the application, provided by the application
1404//@app_version Version of the application, provided by the application @is_official_app True, if the application is an official application or uses the app_id of some official application @device_model Model of a device application is runned on, provided by the application @platform Operating system application is runned on, provided by the application
1405//@system_version Version of operating system application is runned on, provided by the application @log_in_date Date the user has logged in, unix time @last_active_date Date the session was used last time, unix time @ip An ip address from which session was created in a human-readable format
1406//@country Two-letter country code from which session was created based on the ip @region Region code from which session was created based on the ip
1407session id:int64 is_current:Bool app_id:int32 app_name:string app_version:string is_official_app:Bool device_model:string platform:string system_version:string log_in_date:int32 last_active_date:int32 ip:string country:string region:string = Session;
1408
1409//@description Contains list of sessions @sessions List of sessions
1410sessions sessions:vector<session> = Sessions;
1411
1412
1413//@description Contains information about chat report spam state @can_report_spam If true, prompt with "Report spam" action should be shown to the user
1414chatReportSpamState can_report_spam:Bool = ChatReportSpamState;
1415
1416//@class ChatReportReason @description Describes a reason, why a chat is reported
1417
1418//@description The chat contains spam messages
1419chatReportReasonSpam = ChatReportReason;
1420
1421//@description The chat contains violent messages
1422chatReportReasonViolence = ChatReportReason;
1423
1424//@description The chat contains pornography messages
1425chatReportReasonPornography = ChatReportReason;
1426
1427//@description Other reason provided by the user @text Report text
1428chatReportReasonOther text:string = ChatReportReason;
1429
1430
1431//@description Contains public HTTPS link to a message in a public channel @url The link
1432publicMessageLink url:string = PublicMessageLink;
1433
1434
1435//@class FileType @description Represents type of a file
1436
1437//@description Data is not a file
1438fileTypeNone = FileType;
1439
1440//@description File is an animation
1441fileTypeAnimation = FileType;
1442
1443//@description File is an audio
1444fileTypeAudio = FileType;
1445
1446//@description File is a document
1447fileTypeDocument = FileType;
1448
1449//@description File is a photo
1450fileTypePhoto = FileType;
1451
1452//@description File is a profile photo
1453fileTypeProfilePhoto = FileType;
1454
1455//@description File sent to a secret chat
1456fileTypeSecret = FileType;
1457
1458//@description File is a sticker
1459fileTypeSticker = FileType;
1460
1461//@description File is a thumbnail of another file
1462fileTypeThumb = FileType;
1463
1464//@description File type is yet unknown
1465fileTypeUnknown = FileType;
1466
1467//@description File is a video
1468fileTypeVideo = FileType;
1469
1470//@description File is a video note
1471fileTypeVideoNote = FileType;
1472
1473//@description File is a voice audio
1474fileTypeVoice = FileType;
1475
1476//@description File is a wallpaper
1477fileTypeWallpaper = FileType;
1478
1479//@description File is a thumbnail of a file from a secret chat
1480fileTypeSecretThumb = FileType;
1481
1482
1483//@description Contains storage usage statistics for the specific file type @file_type The file type @size Total size of files @count Total number of files
1484storageStatisticsByFileType file_type:FileType size:int53 count:int32 = StorageStatisticsByFileType;
1485
1486//@description Contains storage usage statistics for the specific chat @chat_id Chat identifier, 0 if none @size Total size of files @count Total number of files @by_file_type Statistics splitted by file types
1487storageStatisticsByChat chat_id:int53 size:int53 count:int32 by_file_type:vector<storageStatisticsByFileType> = StorageStatisticsByChat;
1488
1489//@description Contains exact storage usage statistics splitted by chats and file types @size Total size of files @count Total number of files @by_chat Statistics splitted by chats
1490storageStatistics size:int53 count:int32 by_chat:vector<storageStatisticsByChat> = StorageStatistics;
1491
1492//@description Contains approximate storage usage statistics, not containing files of Unknown type @files_size Approximate total size of files @files_count Approximate number of files @database_size Size of database
1493storageStatisticsFast files_size:int53 files_count:int32 database_size:int53 = StorageStatisticsFast;
1494
1495
1496//@class NetworkType @description Represents type of a network
1497
1498//@description Network is not available
1499networkTypeNone = NetworkType;
1500
1501//@description Mobile network
1502networkTypeMobile = NetworkType;
1503
1504//@description Mobile roaming network
1505networkTypeMobileRoaming = NetworkType;
1506
1507//@description Wi-Fi network
1508networkTypeWiFi = NetworkType;
1509
1510//@description Other network type, for example, Ethernet network
1511networkTypeOther = NetworkType;
1512
1513
1514//@class NetworkStatisticsEntry @description Contains statistics about network usage
1515
1516//@description Contains information about total received and sent files data @file_type Type of a file the data is part of @network_type Type of a network the data was sent through. Call setNetworkType to maintain actual network type
1517//@sent_bytes Total number of sent bytes @received_bytes Total number of received bytes
1518networkStatisticsEntryFile file_type:FileType network_type:NetworkType sent_bytes:int53 received_bytes:int53 = NetworkStatisticsEntry;
1519
1520//@description Contains information about total received and sent calls data @network_type Type of a network the data was sent through. Call setNetworkType to maintain actual network type
1521//@sent_bytes Total number of sent bytes @received_bytes Total number of received bytes @duration Total calls duration in seconds
1522networkStatisticsEntryCall network_type:NetworkType sent_bytes:int53 received_bytes:int53 duration:double = NetworkStatisticsEntry;
1523
1524//@description Full list of available network statistics entries @since_date Date since which statistics are collected, unix time @entries Network statistics entries
1525networkStatistics since_date:int32 entries:vector<NetworkStatisticsEntry> = NetworkStatistics;
1526
1527
1528//@class ConnectionState @description Describes current state of the connection to Telegram servers
1529
1530//@description Waiting for network to be available. Use SetNetworkType to change available network type
1531connectionStateWaitingForNetwork = ConnectionState;
1532
1533//@description Establishing connection to set up proxy server
1534connectionStateConnectingToProxy = ConnectionState;
1535
1536//@description Establishing connection to Telegram servers
1537connectionStateConnecting = ConnectionState;
1538
1539//@description Downloading date received, while client was offline
1540connectionStateUpdating = ConnectionState;
1541
1542//@description There is a working connection to the Telegram servers
1543connectionStateReady = ConnectionState;
1544
1545
1546//@class TopChatCategory @description Represents categories of chats for which list of frequently used chats can be retrieved
1547
1548//@description The category containing private chats with non-bot users
1549topChatCategoryUsers = TopChatCategory;
1550
1551//@description The category containing private chats with bot users
1552topChatCategoryBots = TopChatCategory;
1553
1554//@description The category containing group chats and supergroup channel chats
1555topChatCategoryGroups = TopChatCategory;
1556
1557//@description The category containing broadcast channel chats
1558topChatCategoryChannels = TopChatCategory;
1559
1560//@description The category containing chats with inline bots sorted by their usage in the inline mode
1561topChatCategoryInlineBots = TopChatCategory;
1562
1563//@description The category containing chats frequently used for calls
1564topChatCategoryCalls = TopChatCategory;
1565
1566
1567//@description Contains some count @count The count
1568count count:int32 = Count;
1569
1570//@description Contains some text @text The text
1571text text:string = Text;
1572
1573
1574//@class Proxy @description Contains information about a proxy server
1575
1576//@description An empty proxy
1577proxyEmpty = Proxy;
1578
1579//@description A SOCKS5 proxy @server Proxy server ip address @port Proxy server port @username Username to log in @password Password to log in
1580proxySocks5 server:string port:int32 username:string password:string = Proxy;
1581
1582
1583//@description Description of a sticker which should be added to a sticker set @png_sticker Png image with the sticker, must be up to 512 kilobytes in size and fit in 512x512 square @emojis Emojis corresponding to the sticker @mask_position Position where the mask should be placed, nullable
1584inputSticker png_sticker:InputFile emojis:string mask_position:maskPosition = InputSticker;
1585
1586
1587//@class Update @description Contains notifications about data changes
1588
1589//@description User authorization state has changed @auth_state New authorization state
1590updateAuthState auth_state:AuthState = Update;
1591
1592//@description New message received, maybe outcoming message sent from other device @message New message @disable_notification If true, notification about the message should be disabled @contains_mention True, if the message contains mention of the current user
1593updateNewMessage message:message disable_notification:Bool contains_mention:Bool = Update;
1594
1595//@description Message send request has reached Telegram server. It doesn't mean that message send will be successful or even that message send request will be processed. Update will not come, unless option "use_quick_ack" is set to true. The update may come many times for the same message
1596//@chat_id Chat identifier of sent message @message_id Temporary message identifier
1597updateMessageSendAcknowledged chat_id:int53 message_id:int53 = Update;
1598
1599//@description Message is successfully sent @message Information about sent message. Usually only message identifier, date and content are changed, but almost any other fields can also change @old_message_id Previous temporary message identifier
1600updateMessageSendSucceeded message:message old_message_id:int53 = Update;
1601
1602//@description Message fails to send. Be aware that some being sent messages can be irrecoverably deleted and updateDeleteMessages will come instead of this update
1603//@message Information about failed to send message @old_message_id Previous temporary message identifier @error_code Error code @error_message Error message
1604updateMessageSendFailed message:message old_message_id:int53 error_code:int32 error_message:string = Update;
1605
1606//@description Message content has changed @chat_id Chat identifier @message_id Message identifier @new_content New message content
1607updateMessageContent chat_id:int53 message_id:int53 new_content:MessageContent = Update;
1608
1609//@description Message was edited. Changes in the message content will come in a separate updateMessageContent @chat_id Chat identifier @message_id Message identifier @edit_date Date the message was edited, unix time @reply_markup New message reply markup, nullable
1610updateMessageEdited chat_id:int53 message_id:int53 edit_date:int32 reply_markup:ReplyMarkup = Update;
1611
1612//@description View count of the message has changed @chat_id Chat identifier @message_id Message identifier @views New value of view count
1613updateMessageViews chat_id:int53 message_id:int53 views:int32 = Update;
1614
1615//@description Message content was opened. It makes voice messages listened, video note messages viewed and runs ttl timer @chat_id Chat identifier @message_id Message identifier
1616updateOpenMessageContent chat_id:int53 message_id:int53 = Update;
1617
1618//@description Message with an unread mention was read @chat_id Chat identifier @message_id Message identifier @unread_mention_count New number of unread mention messages left in the chat
1619updateMessageMentionRead chat_id:int53 message_id:int53 unread_mention_count:int32 = Update;
1620
1621//@description New chat has been loaded/created. This update is guaranteed to come before chat identifier is returned to the client. Chat field changes will be reported through separate updates @chat The chat
1622updateNewChat chat:chat = Update;
1623
1624//@description Title of the chat was changed @chat_id Chat identifier @title New chat title
1625updateChatTitle chat_id:int53 title:string = Update;
1626
1627//@description Chat photo was changed @chat_id Chat identifier @photo New chat photo, nullable
1628updateChatPhoto chat_id:int53 photo:chatPhoto = Update;
1629
1630//@description Top message of the chat has changed. If top_message is null then top message in the chat became unknown. Some new unknown messages might be added to the chat in that case @chat_id Chat identifier @top_message New top message of the chat, nullable @order New value of the chat order
1631updateChatTopMessage chat_id:int53 top_message:message order:int64 = Update;
1632
1633//@description Order of the chat in the chat list has changed. Instead of that update updateChatTopMessage, updateChatIsPinned or updateChatDraftMessage may be sent @chat_id Chat identifier @order New value of the order
1634updateChatOrder chat_id:int53 order:int64 = Update;
1635
1636//@description Chat was pinned or unpinned @chat_id Chat identifier @is_pinned New value of is_pinned @order New value of the chat order
1637updateChatIsPinned chat_id:int53 is_pinned:Bool order:int64 = Update;
1638
1639//@description Some incoming messages was read @chat_id Chat identifier @last_read_inbox_message_id Identifier of last read incoming message @unread_count Number of unread messages left in the chat
1640updateChatReadInbox chat_id:int53 last_read_inbox_message_id:int53 unread_count:int32 = Update;
1641
1642//@description Some outcoming messages was read @chat_id Chat identifier @last_read_outbox_message_id Identifier of last read outgoing message
1643updateChatReadOutbox chat_id:int53 last_read_outbox_message_id:int53 = Update;
1644
1645//@description Chat unread_mention_count has changed @chat_id Chat identifier @unread_mention_count Number of unread mention messages left in the chat
1646updateChatUnreadMentionCount chat_id:int53 unread_mention_count:int32 = Update;
1647
1648//@description Notification settings for some chats was updated @scope Kinds of chats for which notification settings was updated @notification_settings New notification settings
1649updateNotificationSettings scope:NotificationSettingsScope notification_settings:notificationSettings = Update;
1650
1651//@description Default chat reply markup has changed. It can happen because new message with reply markup has come or old reply markup was hidden by user
1652//@chat_id Chat identifier @reply_markup_message_id Identifier of the message from which reply markup need to be used or 0 if there is no default custom reply markup in the chat
1653updateChatReplyMarkup chat_id:int53 reply_markup_message_id:int53 = Update;
1654
1655//@description Chat draft has changed. Be aware that the update may come in the currently open chat with the old content of the draft. If the user has changed the content of the draft, the update shouldn't be applied @chat_id Chat identifier @draft_message New chat draft_message, nullable @order New value of the chat order
1656updateChatDraftMessage chat_id:int53 draft_message:draftMessage order:int64 = Update;
1657
1658//@description Some messages was deleted @chat_id Chat identifier @message_ids Identifiers of deleted message
1659updateDeleteMessages chat_id:int53 message_ids:vector<int53> = Update;
1660
1661//@description User activity in the chat has changed @chat_id Chat identifier @user_id Identifier of user doing action @action Action description
1662updateUserChatAction chat_id:int53 user_id:int32 action:ChatAction = Update;
1663
1664//@description User went online/offline @user_id User identifier @status New user status
1665updateUserStatus user_id:int32 status:UserStatus = Update;
1666
1667//@description Some data about a user has been changed. This update is guaranteed to come before user identifier is returned to the client, if library knows anything about the user @user New data about the user
1668updateUser user:user = Update;
1669
1670//@description Some data about a group has been changed. This update is guaranteed to come before group identifier is returned to the client, if library knows anything about the group @group New data about the group
1671updateGroup group:group = Update;
1672
1673//@description Some data about a channel has been changed. This update is guaranteed to come before channel identifier is returned to the client, if library knows anything about the channel @channel New data about the channel
1674updateChannel channel:channel = Update;
1675
1676//@description Some data about a secret chat has been changed. This update is guaranteed to come before secret chat identifier is returned to the client, if library knows anything about the secret chat @secret_chat New data about the secret chat
1677updateSecretChat secret_chat:secretChat = Update;
1678
1679//@description Some data from userFull has been changed @user_id User identifier @user_full New full information about the user
1680updateUserFull user_id:int32 user_full:userFull = Update;
1681
1682//@description Some data from groupFull has been changed @group_id Group identifier @group_full New full information about the group
1683updateGroupFull group_id:int32 group_full:groupFull = Update;
1684
1685//@description Some data from channelFull has been changed @channel_id Channel identifier @channel_full New full information about the channel
1686updateChannelFull channel_id:int32 channel_full:channelFull = Update;
1687
1688//@description Service notification from the server. Upon receiving client should show popup with content of the notification @type Type of the notification @content Notification content
1689updateServiceNotification type:string content:MessageContent = Update;
1690
1691//@description DEPRECATED. Use updateFile instead. File is partly downloaded/uploaded @file_id File identifier @size Total file size (0 means unknown) @ready Number of bytes already downloaded/uploaded. Negative number means that download/upload has failed and was terminated
1692updateFileProgress file_id:int32 size:int32 ready:int32 = Update;
1693
1694//@description Information about a file was updated @file New data about a file
1695updateFile file:file = Update;
1696
1697//@description File generation process need to be started by the client @generation_id Unique identifier for the generation process @original_path Path to a file from which new file is generated, may be empty
1698//@destination_path Path to a file which should be created and to which new file should be generated @conversion String specifying conversion applied to the original file
1699updateFileGenerationStart generation_id:int64 original_path:string destination_path:string conversion:string = Update;
1700
1701//@description Informs that a file is being generated @file_id File identifier @size Expected size of the generated file @ready Number of bytes already generated. Negative number means that generation has failed and was terminated
1702updateFileGenerationProgress file_id:int32 size:int32 ready:int32 = Update;
1703
1704//@description DEPRECATED. Use updateFile instead. File generation is finished @file Generated file
1705updateFileGenerationFinish file:file = Update;
1706
1707//@description Information about a call was updated @call New data about a call
1708updateCall call:call = Update;
1709
1710//@description Some privacy settings has changed @key Privacy key @rules New privacy rules
1711updatePrivacy key:PrivacyKey rules:privacyRules = Update;
1712
1713//@description Some option changed its value @name Option name @value New option value
1714updateOption name:string value:OptionValue = Update;
1715
1716//@description List of installed sticker sets was updated @is_masks True, if list of installed mask sticker sets was updated @sticker_set_ids New list of installed ordinary sticker sets
1717updateInstalledStickerSets is_masks:Bool sticker_set_ids:vector<int64> = Update;
1718
1719//@description List of trending sticker sets was updated or some of them was viewed @sticker_sets New list of trending sticker sets
1720updateTrendingStickerSets sticker_sets:stickerSets = Update;
1721
1722//@description 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 New list of file identifiers of recently used stickers
1723updateRecentStickers is_attached:Bool sticker_ids:vector<int32> = Update;
1724
1725//@description List of favorite stickers was updated @sticker_ids New list of file identifiers of favorite stickers
1726updateFavoriteStickers sticker_ids:vector<int32> = Update;
1727
1728//@description List of saved animations was updated @animation_ids New list of file identifiers of saved animations
1729updateSavedAnimations animation_ids:vector<int32> = Update;
1730
1731//@description Connection state has changed @state New connection state
1732updateConnectionState state:ConnectionState = Update;
1733
1734//@description Bots only. New incoming inline query @id Unique query identifier @sender_user_id Identifier of the user who sent the query @user_location User location, provided by the client, nullable @query Text of the query @offset Offset of the first entry to return
1735updateNewInlineQuery id:int64 sender_user_id:int32 user_location:location query:string offset:string = Update;
1736
1737//@description Bots only. User has chosen a result of the inline query @sender_user_id Identifier of the user who sent the query @user_location User location, provided by the client, nullable @query Text of the query @result_id Identifier of the chosen result @inline_message_id Identifier of the sent inline message, if known
1738updateNewChosenInlineResult sender_user_id:int32 user_location:location query:string result_id:string inline_message_id:string = Update;
1739
1740//@description Bots only. New incoming callback query @id Unique query identifier @sender_user_id Identifier of the user who sent the query @chat_id Identifier of the chat, in which the query was sent
1741//@message_id Identifier of the message, from which the query is originated @chat_instance Identifier, uniquely corresponding to the chat a message was sent to @payload Query payload
1742updateNewCallbackQuery id:int64 sender_user_id:int32 chat_id:int53 message_id:int53 chat_instance:int64 payload:CallbackQueryPayload = Update;
1743
1744//@description Bots only. New incoming callback query from message sent via bot @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 is originated
1745//@chat_instance Identifier, uniquely corresponding to the chat a message was sent to @payload Query payload
1746updateNewInlineCallbackQuery id:int64 sender_user_id:int32 inline_message_id:string chat_instance:int64 payload:CallbackQueryPayload = Update;
1747
1748//@description Bots only. New incoming shipping query. 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
1749updateNewShippingQuery id:int64 sender_user_id:int32 invoice_payload:string shipping_address:shippingAddress = Update;
1750
1751//@description Bots only. New incoming pre-checkout query. Contains full information about checkout @id Unique query identifier @sender_user_id Identifier of the user who sent the query @currency Currency for goods price @total_amount Goods total price in minimal quantity of the currency
1752//@invoice_payload Invoice payload @shipping_option_id Identifier of a choosed by user shipping option, may be empty if not applicable @order_info Information about the order, nullable
1753updateNewPreCheckoutQuery id:int64 sender_user_id:int32 currency:string total_amount:int53 invoice_payload:bytes shipping_option_id:string order_info:orderInfo = Update;
1754
1755//@description Bots only. New incoming event @event JSON-serialized event
1756updateNewCustomEvent event:string = Update;
1757
1758//@description Bots only. New incoming query @id Query identifier @data JSON-serialized query data @timeout Query timeout
1759updateNewCustomQuery id:int64 data:string timeout:int32 = Update;
1760
1761
1762//@description Tests only. A simple object containing just a number @value The number
1763testInt value:int32 = TestInt;
1764//@description Tests only. A simple object containing just a string @value The string
1765testString value:string = TestString;
1766//@description Tests only. A simple object containing just a bytes @value The bytes
1767testBytes value:bytes = TestBytes;
1768//@description Tests only. A simple object containing just a vector of numbers @value The vector of numbers
1769testVectorInt value:vector<int32> = TestVectorInt;
1770//@description Tests only. A simple object containing just a vector of objects containing a number @value The vector of objects
1771testVectorIntObject value:vector<testInt> = TestVectorIntObject;
1772//@description Tests only. A simple object containing just a vector of strings @value The vector of strings
1773testVectorString value:vector<string> = TestVectorString;
1774//@description Tests only. A simple object containing just a vector of objects containing a string @value The vector of objects
1775testVectorStringObject value:vector<testString> = TestVectorStringObject;
1776
1777---functions---
1778
1779//@description Returns current authorization state, offline request
1780getAuthState = AuthState;
1781
1782//@description Sets user's phone number and sends authentication code to the user. Works only when getAuthState returns authStateWaitPhoneNumber. If phone number is not recognized or another error has happened, returns an error. Otherwise returns authStateWaitCode
1783//@phone_number User's phone number in any reasonable format @allow_flash_call Pass True, if code can be sent via flash call to the specified phone number @is_current_phone_number Pass true, if the phone number is used on the current device. Ignored if allow_flash_call is False
1784setAuthPhoneNumber phone_number:string allow_flash_call:Bool is_current_phone_number:Bool = AuthState;
1785
1786//@description Resends authentication code to the user. Works only when getAuthState returns authStateWaitCode and next_code_type of result is not null. Returns authStateWaitCode on success
1787resendAuthCode = AuthState;
1788
1789//@description Checks authentication code. Works only when getAuthState returns authStateWaitCode. Returns authStateWaitPassword or authStateOk on success @code Verification code from SMS, Telegram message, phone call or flash call
1790//@first_name User first name, if user is yet not registered, 1-255 characters @last_name Optional user last name, if user is yet not registered, 0-255 characters
1791checkAuthCode code:string first_name:string last_name:string = AuthState;
1792
1793//@description Checks password for correctness. Works only when getAuthState returns authStateWaitPassword. Returns authStateOk on success @password Password to check
1794checkAuthPassword password:string = AuthState;
1795
1796//@description Requests to send password recovery code to email. Works only when getAuthState returns authStateWaitPassword. Returns authStateWaitPassword on success
1797requestAuthPasswordRecovery = AuthState;
1798
1799//@description Recovers password with recovery code sent to email. Works only when getAuthState returns authStateWaitPassword. Returns authStateOk on success @recovery_code Recovery code to check
1800recoverAuthPassword recovery_code:string = AuthState;
1801
1802//@description Logs out user. If force == false, begins to perform soft log out, returns authStateLoggingOut after completion. If force == true then succeeds almost immediately without cleaning anything at the server, but returns error with code 401 and description "Unauthorized"
1803//@force If true, just delete all local data. Session will remain in list of active sessions
1804resetAuth force:Bool = AuthState;
1805
1806//@description Check bot's authentication token to log in as a bot. Works only when getAuthState returns authStateWaitPhoneNumber. Can be used instead of setAuthPhoneNumber and checkAuthCode to log in. Returns authStateOk on success @token Bot token
1807checkAuthBotToken token:string = AuthState;
1808
1809
1810//@description Returns current state of two-step verification
1811getPasswordState = PasswordState;
1812
1813//@description Changes user password. If new recovery email is specified, then error EMAIL_UNCONFIRMED is returned and password change will not be applied until email confirmation. Application should call getPasswordState from time to time to check if email is already confirmed
1814//@old_password Old user password @new_password New user password, may be empty to remove the password @new_hint New password hint, can be empty @set_recovery_email Pass True, if recovery email should be changed @new_recovery_email New recovery email, may be empty
1815setPassword old_password:string new_password:string new_hint:string set_recovery_email:Bool new_recovery_email:string = PasswordState;
1816
1817//@description Returns set up recovery email. This method can be used to verify a password provided by the user @password Current user password
1818getRecoveryEmail password:string = RecoveryEmail;
1819
1820//@description Changes user recovery email. If new recovery email is specified, then error EMAIL_UNCONFIRMED is returned and email will not be changed until email confirmation. Application should call getPasswordState from time to time to check if email is already confirmed.
1821//-If new_recovery_email coincides with the current set up email succeeds immediately and aborts all other requests waiting for email confirmation @password Current user password @new_recovery_email New recovery email
1822setRecoveryEmail password:string new_recovery_email:string = PasswordState;
1823
1824//@description Requests to send password recovery code to email
1825requestPasswordRecovery = PasswordRecoveryInfo;
1826
1827//@description Recovers password with recovery code sent to email @recovery_code Recovery code to check
1828recoverPassword recovery_code:string = PasswordState;
1829
1830//@description Creates new temporary password for payments processing @password Persistent user password @valid_for Time before temporary password will expire, seconds. Should be between 60 and 86400
1831createTemporaryPassword password:string valid_for:int32 = TemporaryPasswordState;
1832
1833//@description Returns information about current temporary password
1834getTemporaryPasswordState = TemporaryPasswordState;
1835
1836
1837//@description Handles DC_UPDATE push service notification. Can be called before authorization @dc Value of 'dc' paramater of the notification @addr Value of 'addr' parameter of the notification
1838processDcUpdate dc:string addr:string = Ok;
1839
1840
1841//@description Returns current logged in user
1842getMe = User;
1843
1844//@description Returns information about a user by its identifier, offline request if current user is not a bot @user_id User identifier
1845getUser user_id:int32 = User;
1846
1847//@description Returns full information about a user by its identifier @user_id User identifier
1848getUserFull user_id:int32 = UserFull;
1849
1850//@description Returns information about a group by its identifier, offline request if current user is not a bot @group_id Group identifier
1851getGroup group_id:int32 = Group;
1852
1853//@description Returns full information about a group by its identifier @group_id Group identifier
1854getGroupFull group_id:int32 = GroupFull;
1855
1856//@description Returns information about a channel by its identifier, offline request if current user is not a bot @channel_id Channel identifier
1857getChannel channel_id:int32 = Channel;
1858
1859//@description Returns full information about a channel by its identifier, cached for at most 1 minute @channel_id Channel identifier
1860getChannelFull channel_id:int32 = ChannelFull;
1861
1862//@description Returns information about a secret chat by its identifier, offline request @secret_chat_id Secret chat identifier
1863getSecretChat secret_chat_id:int32 = SecretChat;
1864
1865//@description Returns information about a chat by its identifier, offline request if current user is not a bot @chat_id Chat identifier
1866getChat chat_id:int53 = Chat;
1867
1868//@description Returns information about a message @chat_id Identifier of the chat, message belongs to @message_id Identifier of the message to get
1869getMessage chat_id:int53 message_id:int53 = Message;
1870
1871//@description Returns information about messages. If message is not found, returns null on the corresponding position of the result @chat_id Identifier of the chat, messages belongs to @message_ids Identifiers of the messages to get
1872getMessages chat_id:int53 message_ids:vector<int53> = Messages;
1873
1874//@description Returns information about a file, offline request @file_id Identifier of the file to get
1875getFile file_id:int32 = File;
1876
1877//@description Returns information about a file by its persistent id, offline request. May be used to register a URL as a file for further uploading or sending as message @persistent_file_id Persistent identifier of the file to get @file_type File type, if known
1878getFilePersistent persistent_file_id:string file_type:FileType = File;
1879
1880//@description Returns list of chats in the right order, chats are sorted by (order, chat_id) in decreasing order. For example, to get list of chats from the beginning, the offset_order should be equal 2^63 - 1 @offset_order Chat order to return chats from @offset_chat_id Chat identifier to return chats from
1881//@limit Maximum number of chats to be returned. There may be less than limit chats returned even the end of the list is not reached
1882getChats offset_order:int64 offset_chat_id:int53 limit:int32 = Chats;
1883
1884//@description Searches public chat by its username. Currently only private and channel chats can be public. Returns chat if found, otherwise some error is returned @username Username to be resolved
1885searchPublicChat username:string = Chat;
1886
1887//@description Searches public chats by prefix of their username. Currently only private and channel (including supergroup) chats can be public. Returns meaningful number of results. Returns nothing if length of the searched username prefix is less than 5. Excludes private chats with contacts from the results @username_prefix Prefix of the username to search
1888searchPublicChats username_prefix:string = Chats;
1889
1890//@description Searches for specified query in the title and username of known chats, offline request. Returns chats in the order of them in the chat list @query Query to search for, if query is empty, returns up to 20 recently found chats @limit Maximum number of chats to be returned
1891searchChats query:string limit:int32 = Chats;
1892
1893//@description Returns a list of frequently used chats. Supported only if chat info database is enabled @category Category of chats to return @limit Maximum number of chats to be returned, at most 30
1894getTopChats category:TopChatCategory limit:int32 = Chats;
1895
1896//@description Delete a chat from a list of frequently used chats. Supported only if chat info database is enabled @category Category of frequently used chats @chat_id Chat identifier
1897deleteTopChat category:TopChatCategory chat_id:int53 = Ok;
1898
1899//@description Adds 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, at first it is removed from the list @chat_id Identifier of the chat to add
1900addRecentlyFoundChat chat_id:int53 = Ok;
1901
1902//@description Deletes chat from the list of recently found chats @chat_id Identifier of the chat to delete
1903deleteRecentlyFoundChat chat_id:int53 = Ok;
1904
1905//@description Clears list of recently found chats
1906deleteRecentlyFoundChats = Ok;
1907
1908//@description Returns list of common chats with an other given user. Chats are sorted by their type and creation date @user_id User identifier @offset_chat_id Chat identifier to return chats from, use 0 for the first request @limit Maximum number of chats to be returned, up to 100
1909getCommonChats user_id:int32 offset_chat_id:int53 limit:int32 = Chats;
1910
1911//@description Returns list of created public chats
1912getCreatedPublicChats = Chats;
1913
1914
1915//@description Returns messages in a chat. Returns result in reverse chronological order, i.e. in order of decreasing message.message_id. Offline request if only_local is true @chat_id Chat identifier
1916//@from_message_id Identifier of the message near which we need a history, you can use 0 to get results from the beginning, i.e. from oldest to newest
1917//@offset Specify 0 to get results exactly from from_message_id or negative offset to get specified message and some newer messages
1918//@limit Maximum number of messages to be returned, should be positive and can't be greater than 100. If offset is negative, limit must be greater than -offset. There may be less than limit messages returned even the end of the history is not reached
1919//@only_local Return only locally available messages without sending network requests
1920getChatHistory chat_id:int53 from_message_id:int53 offset:int32 limit:int32 only_local:Bool = Messages;
1921
1922//@description Deletes all messages in the chat. Can't be used for channel chats @chat_id Chat identifier @remove_from_chat_list Pass true, if chat should be removed from the chat list
1923deleteChatHistory chat_id:int53 remove_from_chat_list:Bool = Ok;
1924
1925//@description Searches for messages with given words in the chat. Returns result in reverse chronological order, i. e. in order of decreasing message_id. Doesn't work in secret chats with non-empty query (searchSecretMessages should be used instead) or without enabled message database @chat_id Chat identifier to search messages in
1926//@query Query to search for
1927//@sender_user_id If not 0, only messages sent by the specified user will be returned. Doesn't supported in secret chats
1928//@from_message_id Identifier of the message from which we need a history, you can use 0 to get results from the beginning
1929//@offset Specify 0 to get results exactly from from_message_id or negative offset to get specified message and some newer messages
1930//@limit Maximum number of messages to be returned, should be positive and can't be greater than 100. If offset is negative, limit must be greater than -offset. There may be less than limit messages returned even the end of the history is not reached
1931//@filter Filter for content of the searched messages
1932searchChatMessages chat_id:int53 query:string sender_user_id:int32 from_message_id:int53 offset:int32 limit:int32 filter:SearchMessagesFilter = Messages;
1933
1934//@description Searches for messages in all chats except secret chats. Returns result in reverse chronological order, i. e. in order of decreasing (date, chat_id, message_id)
1935//@query Query to search for
1936//@offset_date Date of the message to search from, you can use 0 or any date in the future to get results from the beginning
1937//@offset_chat_id Chat identifier of the last found message or 0 for the first request
1938//@offset_message_id Message identifier of the last found message or 0 for the first request
1939//@limit Maximum number of messages to be returned, at most 100
1940searchMessages query:string offset_date:int32 offset_chat_id:int53 offset_message_id:int53 limit:int32 = Messages;
1941
1942//@description Searches for messages in secret chats. Returns result in reverse chronological order @chat_id Identifier of a chat to search in. Specify 0 to search in all secret chats @query Query to search for. If empty, searchChatMessages should be used instead
1943//@from_search_id Identifier from the result of previous request, use 0 to get results from the beginning @limit Maximum number of messages to be returned, can't be greater than 100 @filter Filter for content of searched messages
1944searchSecretMessages chat_id:int53 query:string from_search_id:int64 limit:int32 filter:SearchMessagesFilter = FoundMessages;
1945
1946//@description Searches for call messages. Returns result in reverse chronological order, i. e. in order of decreasing message_id @from_message_id Identifier of the message from which to search, you can use 0 to get results from beginning
1947//@limit Maximum number of messages to be returned, can't be greater than 100. There may be less than limit messages returned even the end of the history is not reached filter @only_missed If true, return only messages with missed calls
1948searchCallMessages from_message_id:int53 limit:int32 only_missed:Bool = Messages;
1949
1950//@description Returns public HTTPS link to a message. Available only for messages in public channels @chat_id Identifier of the chat, message belongs to @message_id Identifier of the message
1951getPublicMessageLink chat_id:int53 message_id:int53 = PublicMessageLink;
1952
1953//@description Sends a message. Returns sent message @chat_id Chat to send message @reply_to_message_id Identifier of a message to reply to or 0
1954//@disable_notification Pass true, to disable notification about the message, doesn't works in secret chats @from_background Pass true, if the message is sent from background
1955//@reply_markup Bots only. Markup for replying to message @input_message_content Content of a message to send
1956sendMessage chat_id:int53 reply_to_message_id:int53 disable_notification:Bool from_background:Bool reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message;
1957
1958//@description Invites bot to a chat (if it is not in the chat) and send /start to it. Bot can't be invited to a private chat other than chat with the bot. Bots can't be invited to broadcast channel chats and secret chats. Returns sent message
1959//@bot_user_id Identifier of the bot @chat_id Identifier of the chat @parameter Hidden parameter sent to bot for deep linking (https://api.telegram.org/bots#deep-linking)
1960sendBotStartMessage bot_user_id:int32 chat_id:int53 parameter:string = Message;
1961
1962//@description Sends result of the inline query as a message. Returns sent message. Always clears chat draft message @chat_id Chat to send message @reply_to_message_id Identifier of a message to reply to or 0
1963//@disable_notification Pass true, to disable notification about the message, doesn't works in secret chats @from_background Pass true, if the message is sent from background
1964//@query_id Identifier of the inline query @result_id Identifier of the inline result
1965sendInlineQueryResultMessage chat_id:int53 reply_to_message_id:int53 disable_notification:Bool from_background:Bool query_id:int64 result_id:string = Message;
1966
1967//@description Forwards previously sent messages. Returns forwarded messages in the same order as message identifiers passed in message_ids. If message can't be forwarded, null will be returned instead of the message
1968//@chat_id Identifier of a chat to forward messages @from_chat_id Identifier of a chat to forward from @message_ids Identifiers of messages to forward
1969//@disable_notification Pass true, to disable notification about the message, doesn't works if messages are forwarded to secret chat @from_background Pass true, if the message is sent from background
1970forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector<int53> disable_notification:Bool from_background:Bool = Messages;
1971
1972//@description Changes current ttl setting in a secret chat and sends corresponding message @chat_id Chat identifier @ttl New value of ttl in seconds
1973sendChatSetTtlMessage chat_id:int53 ttl:int32 = Message;
1974
1975//@description Sends notification about screenshot taken in a chat. Works only in private and secret chats @chat_id Chat identifier
1976sendChatScreenshotTakenNotification chat_id:int53 = Ok;
1977
1978//@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of messages to delete @revoke Pass true to try to delete sent messages for all chat members (may fail if messages are too old). Is always true for Channels and SecretChats
1979deleteMessages chat_id:int53 message_ids:vector<int53> revoke:Bool = Ok;
1980
1981//@description Deletes all messages in the chat sent by the specified user. Works only in supergroup channel chats, needs can_delete_messages administrator privileges @chat_id Chat identifier @user_id User identifier
1982deleteMessagesFromUser chat_id:int53 user_id:int32 = Ok;
1983
1984
1985//@description Edits text of text or game message. Non-bots can edit message in a limited period of time. Returns edited message after edit is complete server side
1986//@chat_id Chat the message belongs to @message_id Identifier of the message @reply_markup Bots only. New message reply markup @input_message_content New text content of the message. Should be of type InputMessageText
1987editMessageText chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message;
1988
1989//@description Edits message content caption. Non-bots can edit message in a limited period of time. Returns edited message after edit is complete server side
1990//@chat_id Chat the message belongs to @message_id Identifier of the message @reply_markup Bots only. New message reply markup @caption New message content caption, 0-200 characters
1991editMessageCaption chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:string = Message;
1992
1993//@description Bots only. Edits message reply markup. Returns edited message after edit is complete server side
1994//@chat_id Chat the message belongs to @message_id Identifier of the message @reply_markup New message reply markup
1995editMessageReplyMarkup chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Message;
1996
1997//@description Bots only. Edits text of an inline text or game message sent via bot @inline_message_id Inline message identifier @reply_markup New message reply markup @input_message_content New text content of the message. Should be of type InputMessageText
1998editInlineMessageText inline_message_id:string reply_markup:ReplyMarkup input_message_content:InputMessageContent = Ok;
1999
2000//@description Bots only. Edits caption of an inline message content sent via bot @inline_message_id Inline message identifier @reply_markup New message reply markup @caption New message content caption, 0-200 characters
2001editInlineMessageCaption inline_message_id:string reply_markup:ReplyMarkup caption:string = Ok;
2002
2003//@description Bots only. Edits reply markup of an inline message sent via bot @inline_message_id Inline message identifier @reply_markup New message reply markup
2004editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = Ok;
2005
2006
2007//@description Returns all mentions, hashtags, bot commands, URLs and emails contained in the text. Offline method. Can be called before authorization. Can be called synchronously @text Text to find entites in
2008getTextEntities text:string = TextEntities;
2009
2010//@description Returns file's mime type guessing only by its extension. Returns empty string on failure. Offline method. Can be called before authorization. Can be called synchronously @file_name Name of the file or path to the file
2011getFileMimeType file_name:string = Text;
2012
2013//@description Returns file's extension guessing only by its mime type. Returns empty string on failure. Offline method. Can be called before authorization. Can be called synchronously @mime_type Mime type of the file
2014getFileExtension mime_type:string = Text;
2015
2016
2017//@description Sends inline query to a bot and returns its results. Returns error with code 502 if bot fails to answer the query before query timeout expires. Unavailable for bots @bot_user_id Identifier of the bot send query to
2018//@chat_id Identifier of the chat, where the query is sent @user_location User location, only if needed @query Text of the query @offset Offset of the first entry to return
2019getInlineQueryResults bot_user_id:int32 chat_id:int53 user_location:location query:string offset:string = InlineQueryResults;
2020
2021//@description Bots only. Sets result of an inline query @inline_query_id Identifier of the inline query @is_personal Does result of the query can be cached only for specified user
2022//@results Results of the query @cache_time Allowed time to cache results of the query in seconds @next_offset Offset for the next inline query, pass empty string if there is no more results
2023//@switch_pm_text If non-empty, this text should be shown on the button, which opens private chat with the bot and sends bot start message with parameter switch_pm_parameter @switch_pm_parameter Parameter for the bot start message
2024answerInlineQuery 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;
2025
2026
2027//@description Sends callback query to a bot and returns answer to it. Returns error with code 502 if bot fails to answer the query before query timeout expires. Unavailable for bots @chat_id Identifier of the chat with a message @message_id Identifier of the message, from which the query is originated @payload Query payload
2028getCallbackQueryAnswer chat_id:int53 message_id:int53 payload:CallbackQueryPayload = CallbackQueryAnswer;
2029
2030//@description Bots only. Sets result of a callback query @callback_query_id Identifier of the callback query @text Text of the answer @show_alert If true, an alert should be shown to the user instead of a toast @url Url to be opened @cache_time Allowed time to cache result of the query in seconds
2031answerCallbackQuery callback_query_id:int64 text:string show_alert:Bool url:string cache_time:int32 = Ok;
2032
2033
2034//@description Bots only. Sets result of a shipping query @shipping_query_id Identifier of the shipping query @shipping_options Available shipping options @error_message Error message, empty on success
2035answerShippingQuery shipping_query_id:int64 shipping_options:vector<shippingOption> error_message:string = Ok;
2036
2037//@description Bots only. Sets result of a pre checkout query @pre_checkout_query_id Identifier of the pre-checkout query @error_message Error message, empty on success
2038answerPreCheckoutQuery pre_checkout_query_id:int64 error_message:string = Ok;
2039
2040
2041//@description Bots only. Updates game score of the specified user in the game @chat_id Chat a message with the game belongs to @message_id Identifier of the message @edit_message True, if message should be edited @user_id User identifier @score New score
2042//@force Pass True to update the score even if it decreases. If score is 0, user will be deleted from the high scores table
2043setGameScore chat_id:int53 message_id:int53 edit_message:Bool user_id:int32 score:int32 force:Bool = Message;
2044
2045//@description Bots only. Updates game score of the specified user in the game @inline_message_id Inline message identifier @edit_message True, if message should be edited @user_id User identifier @score New score
2046//@force Pass True to update the score even if it decreases. If score is 0, user will be deleted from the high scores table
2047setInlineGameScore inline_message_id:string edit_message:Bool user_id:int32 score:int32 force:Bool = Ok;
2048
2049//@description Bots only. Returns game high scores and some part of the score table around of the specified user in the game @chat_id Chat a message with the game belongs to @message_id Identifier of the message @user_id User identifie
2050getGameHighScores chat_id:int53 message_id:int53 user_id:int32 = GameHighScores;
2051
2052//@description Bots only. Returns game high scores and some part of the score table around of the specified user in the game @inline_message_id Inline message identifier @user_id User identifier
2053getInlineGameHighScores inline_message_id:string user_id:int32 = GameHighScores;
2054
2055
2056//@description Deletes default reply markup from chat. This method needs to be called after one-time keyboard or ForceReply reply markup has been used. UpdateChatReplyMarkup will be send if reply markup will be changed @chat_id Chat identifier
2057//@message_id Message identifier of used keyboard
2058deleteChatReplyMarkup chat_id:int53 message_id:int53 = Ok;
2059
2060
2061//@description Sends notification about user activity in a chat @chat_id Chat identifier @action Action description
2062sendChatAction chat_id:int53 action:ChatAction = Ok;
2063
2064
2065//@description Chat is opened by the user. Many useful activities depends on chat being opened or closed. For example, in channels all updates are received only for opened chats @chat_id Chat identifier
2066openChat chat_id:int53 = Ok;
2067
2068//@description Chat is closed by the user. Many useful activities depends on chat being opened or closed. @chat_id Chat identifier
2069closeChat chat_id:int53 = Ok;
2070
2071//@description Messages are viewed by the user. Many useful activities depends on message being viewed. For example, marking messages as read, incrementing of view counter, updating of view counter, removing of deleted messages in channels @chat_id Chat identifier @message_ids Identifiers of viewed messages
2072viewMessages chat_id:int53 message_ids:vector<int53> = Ok;
2073
2074//@description Message content is opened, for example the user has opened a photo, a video, a document, a location or a venue or have listened to an audio or a voice message. You will receive updateOpenMessageContent if something has changed @chat_id Chat identifier of the message @message_id Identifier of the message with opened content
2075openMessageContent chat_id:int53 message_id:int53 = Ok;
2076
2077
2078//@description Returns existing chat corresponding to the given user @user_id User identifier
2079createPrivateChat user_id:int32 = Chat;
2080
2081//@description Returns existing chat corresponding to the known group @group_id Group identifier
2082createGroupChat group_id:int32 = Chat;
2083
2084//@description Returns existing chat corresponding to the known channel @channel_id Channel identifier
2085createChannelChat channel_id:int32 = Chat;
2086
2087//@description Returns existing chat corresponding to the known secret chat @secret_chat_id SecretChat identifier
2088createSecretChat secret_chat_id:int32 = Chat;
2089
2090//@description Creates new group chat and send corresponding messageGroupChatCreate, returns created chat @user_ids Identifiers of users to add to the group @title Title of new group chat, 1-255 characters
2091createNewGroupChat user_ids:vector<int32> title:string = Chat;
2092
2093//@description Creates new channel chat and send corresponding messageChannelChatCreate, returns created chat @title Title of new channel chat, 1-255 characters @is_supergroup True, if supergroup chat should be created @param_description Channel description, 0-255 characters
2094createNewChannelChat title:string is_supergroup:Bool description:string = Chat;
2095
2096//@description Creates new secret chat, returns created chat @user_id Identifier of a user to create secret chat with
2097createNewSecretChat user_id:int32 = Chat;
2098
2099//@description Creates new channel supergroup chat from existing group chat and send corresponding messageChatMigrateTo and messageChatMigrateFrom. Deactivates group @chat_id Group chat identifier
2100migrateGroupChatToChannelChat chat_id:int53 = Chat;
2101
2102
2103//@description Changes chat title. Works only for group and channel chats. Requires administrator rights in groups and appropriate administrator right in channels. Title will not change before request to the server completes
2104//@chat_id Chat identifier @title New title of the chat, 1-255 characters
2105changeChatTitle chat_id:int53 title:string = Ok;
2106
2107//@description Changes chat photo. Works only for group and channel chats. Requires administrator rights in groups and appropriate administrator right in channels. Photo will not change before request to the server completes
2108//@chat_id Chat identifier @photo New chat photo. You can use zero InputFileId to delete chat photo. Files accessible only by HTTP URL are not acceptable
2109changeChatPhoto chat_id:int53 photo:InputFile = Ok;
2110
2111//@description Changes chat draft message @chat_id Chat identifier @draft_message New draft message, nullable
2112changeChatDraftMessage chat_id:int53 draft_message:draftMessage = Ok;
2113
2114//@description Changes chat pinned state. You can pin up to getOption("pinned_chat_count_max") non-secret chats and the same number of secret chats @chat_id Chat identifier @is_pinned New value of is_pinned
2115toggleChatIsPinned chat_id:int53 is_pinned:Bool = Ok;
2116
2117//@description Changes client data associated with a chat @chat_id Chat identifier @client_data New value of client_data
2118setChatClientData chat_id:int53 client_data:string = Ok;
2119
2120//@description Adds new member to chat. Members can't be added to private or secret chats. Member will not be added until chat state will be synchronized with the server
2121//@chat_id Chat identifier @user_id Identifier of the user to add @forward_limit Number of previous messages from chat to forward to new member, ignored for channel chats. Can't be greater than 300
2122addChatMember chat_id:int53 user_id:int32 forward_limit:int32 = Ok;
2123
2124//@description Adds many new members to the chat. Currently, available only for channels. Can't be used to join the channel. Members can't be added to broadcast channel if it has more than 200 members. Members will not be added until chat state will be synchronized with the server
2125//@chat_id Chat identifier @user_ids Identifiers of the users to add
2126addChatMembers chat_id:int53 user_ids:vector<int32> = Ok;
2127
2128//@description Changes status of the chat member, need appropriate privileges. This function is currently not suitable for adding new members to the chat, use addChatMember instead. Status will not be changed until chat state will be synchronized with the server
2129//@chat_id Chat identifier @user_id Identifier of the user to edit status @status New status of the member in the chat
2130changeChatMemberStatus chat_id:int53 user_id:int32 status:ChatMemberStatus = Ok;
2131
2132//@description Returns information about one participant of the chat @chat_id Chat identifier @user_id User identifier
2133getChatMember chat_id:int53 user_id:int32 = ChatMember;
2134
2135//@description Searches for the specified query in the first name, last name and username among members of the specified chat. Requires administrator rights in broadcast channels @chat_id Chat identifier @query Query to search for @limit Maximum number of users to be returned
2136searchChatMembers chat_id:int53 query:string limit:int32 = ChatMembers;
2137
2138
2139//@description Changes list or order of pinned chats @chat_ids New list of pinned chats
2140setPinnedChats chat_ids:vector<int53> = Ok;
2141
2142
2143//@description Asynchronously downloads file from cloud. Updates updateFile will notify about download progress and successful download @file_id Identifier of file to download
2144//@priority Priority of download, 1-32. The higher priority, the earlier file will be downloaded. If priorities of two files are equal then the last one for which downloadFile is called will be downloaded first
2145downloadFile file_id:int32 priority:int32 = Ok;
2146
2147//@description Stops file downloading. If file is already downloaded, does nothing @file_id Identifier of file to cancel download
2148cancelDownloadFile file_id:int32 = Ok;
2149
2150//@description Asynchronously uploads file to the cloud without sending it in a message. Updates updateFile will notify about upload progress and successful upload. The file will not have persistent identifier until it will be sent in a message @file File to upload @file_type File type
2151//@priority Priority of upload, 1-32. The higher priority, the earlier file will be uploaded. If priorities of two files are equal then the first one for which uploadFile is called will be uploaded first
2152uploadFile file:InputFile file_type:FileType priority:int32 = File;
2153
2154//@description Stops file uploading. Works only for files uploaded using uploadFile. For other files the behavior is undefined @file_id Identifier of file to cancel upload
2155cancelUploadFile file_id:int32 = Ok;
2156
2157//@description Next part of a file was generated
2158//@generation_id Identifier of the generation process
2159//@size Full size of file in bytes, 0 if unknown.
2160//@local_size Number of bytes already generated. Negative number means that generation has failed and should be terminated
2161setFileGenerationProgress generation_id:int64 size:int32 local_size:int32 = Ok;
2162
2163//@description Finishes file generation @generation_id Identifier of the generation process
2164finishFileGeneration generation_id:int64 = Ok;
2165
2166//@description Deletes a file from TDLib file cache @file_id Identifier of the file to delete
2167deleteFile file_id:int32 = Ok;
2168
2169
2170//@description Generates new chat invite link, previously generated link is revoked. Available for group and channel chats. In groups can be called only by creator, in channels requires appropriate rights @chat_id Chat identifier
2171exportChatInviteLink chat_id:int53 = ChatInviteLink;
2172
2173//@description Checks chat invite link for validness and returns information about the corresponding chat @invite_link Invite link to check. Should begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/" or "https://telegram.dog/joinchat/"
2174checkChatInviteLink invite_link:string = ChatInviteLinkInfo;
2175
2176//@description Imports chat invite link, adds current user to a chat if possible. Member will not be added until chat state will be synchronized with the server
2177//@invite_link Invite link to import. Should begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/" or "https://telegram.dog/joinchat/"
2178importChatInviteLink invite_link:string = Ok;
2179
2180
2181//@description Creates new call @user_id Identifier of user to call @protocol Description of supported by the client call protocols
2182createCall user_id:int32 protocol:callProtocol = CallId;
2183
2184//@description Accepts incoming call @call_id Call identifier @protocol Description of supported by the client call protocols
2185acceptCall call_id:int32 protocol:callProtocol = Ok;
2186
2187//@description Discards a call @call_id Call identifier @is_disconnected True, if users was disconnected @duration Call duration in seconds @connection_id Identifier of a connection used during the call
2188discardCall call_id:int32 is_disconnected:Bool duration:int32 connection_id:int64 = Ok;
2189
2190//@description Sends call rating @call_id Call identifier @rating Call rating, 1-5 @comment Optional user comment if rating is less than 5
2191rateCall call_id:int32 rating:int32 comment:string = Ok;
2192
2193//@description Sends call debug information @call_id Call identifier @debug Debug information in application specific format
2194debugCall call_id:int32 debug:string = Ok;
2195
2196
2197
2198//@description Adds user to black list @user_id User identifier
2199blockUser user_id:int32 = Ok;
2200
2201//@description Removes user from black list @user_id User identifier
2202unblockUser user_id:int32 = Ok;
2203
2204//@description Returns users blocked by the current user @offset Number of users to skip in result, must be non-negative @limit Maximum number of users to return, can't be greater than 100
2205getBlockedUsers offset:int32 limit:int32 = Users;
2206
2207
2208//@description Adds new contacts/edits existing contacts, contacts user identifiers are ignored @contacts List of contacts to import/edit
2209importContacts contacts:vector<contact> = ImportedContacts;
2210
2211//@description Searches for specified query in the first name, last name and username of the known user contacts @query Query to search for, can be empty to return all contacts @limit Maximum number of users to be returned
2212searchContacts query:string limit:int32 = Users;
2213
2214//@description Deletes users from contacts list @user_ids Identifiers of users to be deleted
2215deleteContacts user_ids:vector<int32> = Ok;
2216
2217//@description Returns total number of imported contacts
2218getImportedContactCount = Count;
2219
2220//@description Deletes all imported contacts
2221deleteImportedContacts = Ok;
2222
2223
2224//@description Returns profile photos of the user. Result of this query may be outdated: some photos may be already deleted @user_id User identifier @offset Photos to skip, must be non-negative @limit Maximum number of photos to be returned, can't be greater than 100
2225getUserProfilePhotos user_id:int32 offset:int32 limit:int32 = UserProfilePhotos;
2226
2227
2228//@description Returns stickers from installed ordinary sticker sets corresponding to the given emoji. If emoji is not empty, elso favorite and recently used stickers may be returned @emoji String representation of emoji. If empty, returns all known stickers @limit Maximum number of stickers to return
2229getStickers emoji:string limit:int32 = Stickers;
2230
2231//@description Returns list of installed sticker sets @is_masks Pass true to return mask sticker sets, pass false to return ordinary sticker sets
2232getInstalledStickerSets is_masks:Bool = StickerSets;
2233
2234//@description Returns list of archived sticker sets @is_masks Pass true to return mask stickers sets, pass false to return ordinary sticker sets @offset_sticker_set_id Identifier of the sticker set from which return the result @limit Maximum number of sticker sets to return
2235getArchivedStickerSets is_masks:Bool offset_sticker_set_id:int64 limit:int32 = StickerSets;
2236
2237//@description Returns list of trending sticker sets
2238getTrendingStickerSets = StickerSets;
2239
2240//@description Returns list of sticker sets attached to a file, currently only photos and videos can have attached sticker sets @file_id File identifier
2241getAttachedStickerSets file_id:int32 = StickerSets;
2242
2243//@description Returns information about sticker set by its identifier @set_id Identifier of the sticker set
2244getStickerSet set_id:int64 = StickerSet;
2245
2246//@description Searches sticker set by its short name @name Name of the sticker set
2247searchStickerSet name:string = StickerSet;
2248
2249//@description Installs/uninstalls or enables/archives sticker set @set_id Identifier of the sticker set @is_installed New value of is_installed @is_archived New value of is_archived. A sticker set can't be installed and archived simultaneously
2250changeStickerSet set_id:int64 is_installed:Bool is_archived:Bool = Ok;
2251
2252//@description Informs that some trending sticker sets are viewed by the user @sticker_set_ids Identifiers of viewed trending sticker sets
2253viewTrendingStickerSets sticker_set_ids:vector<int64> = Ok;
2254
2255//@description Changes the order of installed sticker sets @is_masks Pass true to change mask sticker sets order, pass false to change ordinary sticker sets order @sticker_set_ids Identifiers of installed sticker sets in the new right order
2256reorderInstalledStickerSets is_masks:Bool sticker_set_ids:vector<int64> = Ok;
2257
2258//@description Returns list of recently used stickers @is_attached Pass true to return stickers and masks recently attached to photo or video files, pass false to return recently sent stickers
2259getRecentStickers is_attached:Bool = Stickers;
2260
2261//@description Manually adds new sticker to the list of recently used stickers. New sticker is added to the beginning of the list. If the sticker is already in the list, at first it is removed from the list. Only stickers belonging to a sticker set can be added to the list
2262//@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
2263addRecentSticker is_attached:Bool sticker:InputFile = Stickers;
2264
2265//@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
2266deleteRecentSticker is_attached:Bool sticker:InputFile = Ok;
2267
2268//@description Clears list of recently used stickers @is_attached Pass true to clear list of stickers recently attached to photo or video files, pass false to clear the list of recently sent stickers
2269clearRecentStickers is_attached:Bool = Ok;
2270
2271//@description Returns favorite stickers
2272getFavoriteStickers = Stickers;
2273
2274//@description Adds new sticker to the list of favorite stickers. New sticker is added to the beginning of the list. If the sticker is already in the list, at first it is removed from the list. Only stickers belonging to a sticker set can be added to the list
2275//@sticker Sticker file to add
2276addFavoriteSticker sticker:InputFile = Ok;
2277
2278//@description Removes a sticker from the list of favorite stickers @sticker Sticker file to delete from the list
2279deleteFavoriteSticker sticker:InputFile = Ok;
2280
2281//@description Returns emojis corresponding to a sticker @sticker Sticker file identifier
2282getStickerEmojis sticker:InputFile = StickerEmojis;
2283
2284
2285//@description Returns saved animations
2286getSavedAnimations = Animations;
2287
2288//@description Manually adds new animation to the list of saved animations. New animation is added to the beginning of the list. If the animation is already in the list, at first it is removed from the list. Only non-secret video animations with MIME type "video/mp4" can be added to the list
2289//@animation Animation file to add. Only known to server animations (i. e. successfully sent via message) can be added to the list
2290addSavedAnimation animation:InputFile = Ok;
2291
2292//@description Removes an animation from the list of saved animations @animation Animation file to delete
2293deleteSavedAnimation animation:InputFile = Ok;
2294
2295
2296//@description Returns up to 20 recently used inline bots in the order of the last usage
2297getRecentInlineBots = Users;
2298
2299
2300//@description Searches for recently used hashtags by their prefix @prefix Hashtag prefix to search for @limit Maximum number of hashtags to return
2301searchHashtags prefix:string limit:int32 = Hashtags;
2302
2303//@description Deletes a hashtag from the list of recently used hashtags @hashtag The hashtag to delete
2304deleteRecentHashtag hashtag:string = Ok;
2305
2306
2307//@description Returns web page preview by text of the message. Do not call this function to often. Returns error 404 if web page has no preview @message_text Message text
2308getWebPagePreview message_text:string = WebPage;
2309
2310//@description Returns web page instant view if available. Returns error 404 if web page has no instant view @url Web page URL @force_full If true, full web page instant view will be returned
2311getWebPageInstantView url:string force_full:Bool = WebPageInstantView;
2312
2313
2314//@description Returns notification settings for a given scope @scope Scope to return information about notification settings
2315getNotificationSettings scope:NotificationSettingsScope = NotificationSettings;
2316
2317//@description Changes notification settings for a given scope @scope Scope to change notification settings
2318//@notification_settings New notification settings for given scope
2319setNotificationSettings scope:NotificationSettingsScope notification_settings:notificationSettings = Ok;
2320
2321//@description Resets all notification settings to the default value. By default the only muted chats are supergroups, sound is set to 'default' and message previews are showed
2322resetAllNotificationSettings = Ok;
2323
2324
2325//@description Uploads new profile photo for logged in user. If something changes, updateUser will be sent @photo Profile photo to set. inputFileId and inputFilePersistentId may be unsupported
2326setProfilePhoto photo:InputFile = Ok;
2327
2328//@description Deletes profile photo. If something changes, updateUser will be sent @profile_photo_id Identifier of profile photo to delete
2329deleteProfilePhoto profile_photo_id:int64 = Ok;
2330
2331//@description Changes first and last names of logged in user. If something changes, updateUser will be sent @first_name New value of user first name, 1-255 characters @last_name New value of optional user last name, 0-255 characters
2332changeName first_name:string last_name:string = Ok;
2333
2334//@description Changes about information of logged in user @about New value of userFull.about, 0-70 characters without line feeds
2335changeAbout about:string = Ok;
2336
2337//@description Changes username of logged in user. If something changes, updateUser will be sent @username New value of username. Use empty string to remove username
2338changeUsername username:string = Ok;
2339
2340//@description Changes user's phone number and sends authentication code to the new user's phone number. Returns authStateWaitCode with information about sent code on success
2341//@phone_number New user's phone number in any reasonable format @allow_flash_call Pass True, if code can be sent via flash call to the specified phone number @is_current_phone_number Pass true, if the phone number is used on the current device. Ignored if allow_flash_call is False
2342changePhoneNumber phone_number:string allow_flash_call:Bool is_current_phone_number:Bool = AuthState;
2343
2344//@description Resends authentication code sent to change user's phone number. Wotks only if in previously received authStateWaitCode next_code_type was not null. Returns authStateWaitCode on success
2345resendChangePhoneNumberCode = AuthState;
2346
2347//@description Checks authentication code sent to change user's phone number. Returns authStateOk on success @code Verification code from SMS, phone call or flash call
2348checkChangePhoneNumberCode code:string = AuthState;
2349
2350
2351//@description Returns all active sessions of logged in user
2352getActiveSessions = Sessions;
2353
2354//@description Terminates another session of logged in user @session_id Session identifier
2355terminateSession session_id:int64 = Ok;
2356
2357//@description Terminates all other sessions of logged in user
2358terminateAllOtherSessions = Ok;
2359
2360
2361//@description Gives or revokes all members of the group administrator rights. Needs creator privileges in the group @group_id Identifier of the group @everyone_is_administrator New value of everyone_is_administrator
2362toggleGroupAdministrators group_id:int32 everyone_is_administrator:Bool = Ok;
2363
2364
2365//@description Changes username of the channel. Needs creator privileges in the channel @channel_id Identifier of the channel @username New value of username. Use empty string to remove username
2366changeChannelUsername channel_id:int32 username:string = Ok;
2367
2368//@description Changes sticker set of the channel. Needs appropriate rights in the channel @channel_id Identifier of the channel @sticker_set_id New value of channel sticker set identifier. Use 0 to remove channel sticker set
2369setChannelStickerSet channel_id:int32 sticker_set_id:int64 = Ok;
2370
2371//@description Gives or revokes right to invite new members to all current members of the channel. Needs appropriate rights in the channel. Available only for supergroups @channel_id Identifier of the channel @anyone_can_invite New value of anyone_can_invite
2372toggleChannelInvites channel_id:int32 anyone_can_invite:Bool = Ok;
2373
2374//@description Enables or disables sender signature on sent messages in the channel. Needs appropriate rights in the channel. Not available for supergroups @channel_id Identifier of the channel @sign_messages New value of sign_messages
2375toggleChannelSignMessages channel_id:int32 sign_messages:Bool = Ok;
2376
2377//@description Changes information about the channel. Needs appropriate rights in the channel @channel_id Identifier of the channel @param_description New channel description, 0-255 characters
2378changeChannelDescription channel_id:int32 description:string = Ok;
2379
2380//@description Pins a message in a supergroup channel chat. Needs appropriate rights in the channel @channel_id Identifier of the channel @message_id Identifier of the new pinned message @disable_notification True, if there should be no notification about the pinned message
2381pinChannelMessage channel_id:int32 message_id:int53 disable_notification:Bool = Ok;
2382
2383//@description Removes pinned message in the supergroup channel. Needs appropriate rights in the channel @channel_id Identifier of the channel
2384unpinChannelMessage channel_id:int32 = Ok;
2385
2386//@description Reports some supergroup channel messages from a user as spam messages @channel_id Channel identifier @user_id User identifier @message_ids Identifiers of messages sent in the supergroup by the user, the list should be non-empty
2387reportChannelSpam channel_id:int32 user_id:int32 message_ids:vector<int53> = Ok;
2388
2389//@description Returns information about channel members or banned users. Can be used only if channel_full->can_get_members == true. Administrator privileges may be additionally needed for some filters @channel_id Identifier of the channel
2390//@filter Kind of channel users to return, defaults to channelMembersRecent @offset Number of channel users to skip @limit Maximum number of users be returned, can't be greater than 200
2391getChannelMembers channel_id:int32 filter:ChannelMembersFilter offset:int32 limit:int32 = ChatMembers;
2392
2393//@description Deletes channel along with all messages in corresponding chat. Releases channel username and removes all members. Needs creator privileges in the channel. Channels with more than 1000 members can't be deleted @channel_id Identifier of the channel
2394deleteChannel channel_id:int32 = Ok;
2395
2396
2397//@description Closes secret chat, effectively transfering its state to "Closed" @secret_chat_id Secret chat identifier
2398closeSecretChat secret_chat_id:int32 = Ok;
2399
2400
2401//@description Returns list of service actions taken by chat members and administrators in the last 48 hours, available only in channels. Requires administrator rights. Returns result in reverse chronological order, i. e. in order of decreasing event_id
2402//@chat_id Chat identifier @query Search query to filter events @from_event_id Identifier of an event from which to return result, you can use 0 to get results from the latest events @limit Maximum number of events to return, can't be greater than 100
2403//@filters Types of events to return, defaults to all @user_ids User identifiers, which events to return, defaults to all users
2404getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector<int32> = ChatEvents;
2405
2406
2407//@description Returns invoice payment form. The method should be called when user presses inlineKeyboardButtonBuy @chat_id Chat identifier of the Invoice message @message_id Message identifier
2408getPaymentForm chat_id:int53 message_id:int53 = PaymentForm;
2409
2410//@description Validates order information provided by the user and returns available shipping options for flexible invoice @chat_id Chat identifier of the Invoice message @message_id Message identifier @order_info Order information, provided by the user @allow_save True, if order information can be saved
2411validateOrderInfo chat_id:int53 message_id:int53 order_info:orderInfo allow_save:Bool = ValidatedOrderInfo;
2412
2413//@description Sends filled payment form to the bot for the final verification @chat_id Chat identifier of the Invoice message @message_id Message identifier @order_info_id Identifier returned by ValidateOrderInfo or empty string @shipping_option_id Identifier of a chosen shipping option, if applicable
2414//@credentials Credentials choosed by user for payment
2415sendPaymentForm chat_id:int53 message_id:int53 order_info_id:string shipping_option_id:string credentials:InputCredentials = PaymentResult;
2416
2417//@description Returns information about successful payment @chat_id Chat identifier of the PaymentSuccessful message @message_id Message identifier
2418getPaymentReceipt chat_id:int53 message_id:int53 = PaymentReceipt;
2419
2420//@description Returns saved order info if any
2421getSavedOrderInfo = OrderInfo;
2422
2423//@description Deletes saved order info
2424deleteSavedOrderInfo = Ok;
2425
2426//@description Deletes saved credentials for all payments provider bots
2427deleteSavedCredentials = Ok;
2428
2429
2430//@description Returns user that can be contacted to get support
2431getSupportUser = User;
2432
2433//@description Returns background wallpapers
2434getWallpapers = Wallpapers;
2435
2436
2437//@description Registers current used device for receiving push notifications @device_token Device token
2438registerDevice device_token:DeviceToken = Ok;
2439
2440
2441//@description Changes privacy settings @key Privacy key @rules New privacy rules
2442setPrivacy key:PrivacyKey rules:privacyRules = Ok;
2443
2444//@description Returns current privacy settings @key Privacy key
2445getPrivacy key:PrivacyKey = PrivacyRules;
2446
2447
2448//@description Returns value of an option by its name. See list of available options on https://core.telegram.org/tdlib/options. Can be called before authorization
2449//@name Name of the option
2450getOption name:string = OptionValue;
2451
2452//@description Sets value of an option. See list of available options on https://core.telegram.org/tdlib/options. Only writable options can be set. Can be called before authorization
2453//@name Name of the option @value New value of the option
2454setOption name:string value:OptionValue = Ok;
2455
2456
2457//@description Changes period of inactivity, after which the account of currently logged in user will be automatically deleted @ttl New account TTL
2458changeAccountTtl ttl:accountTtl = Ok;
2459
2460//@description Returns period of inactivity, after which the account of currently logged in user will be automatically deleted
2461getAccountTtl = AccountTtl;
2462
2463//@description Deletes the account of currently logged in user, deleting from the server all information associated with it. Account's phone number can be used to create new account, but only once in two weeks @reason Optional reason of account deletion
2464deleteAccount reason:string = Ok;
2465
2466
2467//@description Returns current chat report spam state @chat_id Chat identifier
2468getChatReportSpamState chat_id:int53 = ChatReportSpamState;
2469
2470//@description Reports chat as a spam chat or as not a spam chat. Can be used only if ChatReportSpamState.can_report_spam is true. After this request ChatReportSpamState.can_report_spam became false forever @chat_id Chat identifier @is_spam_chat If true, chat will be reported as a spam chat, otherwise it will be marked as not a spam chat
2471changeChatReportSpamState chat_id:int53 is_spam_chat:Bool = Ok;
2472
2473//@description Reports chat to Telegram moderators. Can be used only for a channel chat or a private chat with a bot, because all other chats can't be checked by moderators @chat_id Chat identifier @reason Reason, the chat is reported
2474reportChat chat_id:int53 reason:ChatReportReason = Ok;
2475
2476
2477//@description Returns storage usage statistics @chat_limit Maximum number of chats with biggest storage usage for which separate statistics should be returned. All other chats will be grouped in entries with chat_id == 0. If chat info database is not used, chat_limit is ignored and is always set to 0
2478getStorageStatistics chat_limit:int32 = StorageStatistics;
2479
2480//@description Quickly returns approximate storage usage statistics
2481getStorageStatisticsFast = StorageStatisticsFast;
2482
2483//@description Optimizes storage usage, i.e. deletes some files and return new storage usage statistics. Secret thumbnails can't be deleted
2484//@size Limit on total size of files after deletion. Pass -1 to use default limit
2485//@ttl Limit on time passed since last access time (or creation time on some filesystems) to a file. Pass -1 to use default limit
2486//@count Limit on total count of files after deletion. Pass -1 to use default limit
2487//@immunity_delay Number of seconds after creation of a file, it can't be delited. Pass -1 to use default value
2488//@file_types If not empty, only files with given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted
2489//@chat_ids If not empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat, for example profile photos
2490//@exclude_chat_ids If not empty, files from the given chats are exluded. Use 0 as chat identifier to exclude all files not belonging to any chat, for example profile photos
2491//@chat_limit Same as in getStorageStatistics. Affects only returned statistics
2492optimizeStorage size:int53 ttl:int32 count:int32 immunity_delay:int32 file_types:vector<FileType> chat_ids:vector<int53> exclude_chat_ids:vector<int53> chat_limit:int32 = StorageStatistics;
2493
2494
2495//@description Sets current network type. Can be called before authorization. Call to this method forces reopening of all network connections mitigating delay in switching between different networks, so it should be called whenever network is changed even network type remains the same.
2496//-Network type is used to check if library can use network at all and for collecting detailed network data usage statistics @type New network type, defaults to networkTypeNone
2497setNetworkType type:NetworkType = Ok;
2498
2499//@description Returns network data usage statistics. Can be called before authorization @only_current If true, returns only data for the current library launch
2500getNetworkStatistics only_current:Bool = NetworkStatistics;
2501
2502//@description Adds specified data to data usage statistics. Can be called before authorization @entry Network statistics entry with a data to add to statistics
2503addNetworkStatistics entry:NetworkStatisticsEntry = Ok;
2504
2505//@description Resets all network data usage statistics to zero. Can be called before authorization
2506resetNetworkStatistics = Ok;
2507
2508
2509//@description Bots only. Informs server about number of pending bot updates if they aren't processed for a long time @pending_update_count Number of pending updates @error_message Last error's message
2510setBotUpdatesStatus pending_update_count:int32 error_message:string = Ok;
2511
2512
2513//@description Bots only. Uploads a png image with a sticker. Returns uploaded file @user_id Sticker file owner @png_sticker Png image with the sticker, must be up to 512 kilobytes in size and fit in 512x512 square
2514uploadStickerFile user_id:int32 png_sticker:InputFile = File;
2515
2516//@description Bots only. Creates new sticker set. Returns created sticker set @user_id Sticker set owner @title Sticker set title, 1-64 characters @name Sticker set name. Can contain only english letters, digits and underscores. Should end on *"_by_<bot username>"*. *<bot_username>* is case insensitive, 1-64 characters
2517//@is_masks True, is stickers are masks @stickers List of stickers to add to the set
2518createNewStickerSet user_id:int32 title:string name:string is_masks:Bool stickers:vector<inputSticker> = StickerSet;
2519
2520//@description Bots only. Adds new sticker to a set. Returns the sticker set @user_id Sticker set owner @name Sticker set name @sticker Sticker to add to the set
2521addStickerToSet user_id:int32 name:string sticker:inputSticker = StickerSet;
2522
2523//@description Bots only. Changes position of a sticker in the set it belongs to. Sticker set should be created by the bot @sticker The sticker @position New sticker position in the set, zero-based
2524setStickerPositionInSet sticker:InputFile position:int32 = Ok;
2525
2526//@description Bots only. Deletes a sticker from the set it belongs to. Sticker set should be created by the bot @sticker The sticker
2527deleteStickerFromSet sticker:InputFile = Ok;
2528
2529
2530//@description Bots only. Sends custom request @method Method name @parameters JSON-serialized method parameters
2531sendCustomRequest method:string parameters:string = CustomRequestResult;
2532
2533//@description Bots only. Answers a custom query @custom_query_id Identifier of a custom query @data JSON-serialized answer to the query
2534answerCustomQuery custom_query_id:int64 data:string = Ok;
2535
2536
2537//@description Returns Ok after specified amount of the time passed. Can be called before authorization @seconds Number of seconds before that function returns
2538setAlarm seconds:double = Ok;
2539
2540
2541//@description Returns invite text for invitation of new users
2542getInviteText = Text;
2543
2544//@description Returns terms of service. Can be called before authorization
2545getTermsOfService = Text;
2546
2547
2548//@description Sets proxy server for network requests. Can be called before authorization @proxy The proxy to use. You can specify null to remove proxy server
2549setProxy proxy:Proxy = Ok;
2550
2551//@description Returns current set up proxy. Can be called before authorization
2552getProxy = Proxy;
2553
2554
2555//@description Test request. Does nothing
2556testCallEmpty = Ok;
2557//@description Test request. Returns back received string @x String to return
2558testCallString x:string = TestString;
2559//@description Test request. Returns back received bytes @x Bytes to return
2560testCallBytes x:bytes = TestBytes;
2561//@description Test request. Returns back received vector of numbers @x Vector of numbers to return
2562testCallVectorInt x:vector<int32> = TestVectorInt;
2563//@description Test request. Returns back received vector of objects containing a number @x Vector of objects to return
2564testCallVectorIntObject x:vector<testInt> = TestVectorIntObject;
2565//@description Test request. Returns back received vector of strings @x Vector of strings to return
2566testCallVectorString x:vector<string> = TestVectorString;
2567//@description Test request. Returns back received vector of objects containing a string @x Vector of objects to return
2568testCallVectorStringObject x:vector<testString> = TestVectorStringObject;
2569//@description Test request. Returns squared received number @x Number to square
2570testSquareInt x:int32 = TestInt;
2571//@description Test request. Sends simple network request to telegram servers
2572testNetwork = Ok;
2573//@description Test request. Forces updates.getDifference call to telegram servers
2574testGetDifference = Ok;
2575//@description Test request. Does nothing, ensures that the Update object is used
2576testUseUpdate = Update;
2577//@description Test request. Does nothing, ensures that the Error object is used
2578testUseError = Error;